Statistics
| Branch: | Tag: | Revision:

root / gnuradio-core / src / lib / filter / gr_fir_fsf_simd.h @ 2b60291c

History | View | Annotate | Download (1.8 kB)

1 5d69a524 jcorgan
/* -*- c++ -*- */
2 5d69a524 jcorgan
/*
3 5d69a524 jcorgan
 * Copyright 2002 Free Software Foundation, Inc.
4 5d69a524 jcorgan
 * 
5 5d69a524 jcorgan
 * This file is part of GNU Radio
6 5d69a524 jcorgan
 * 
7 5d69a524 jcorgan
 * GNU Radio is free software; you can redistribute it and/or modify
8 5d69a524 jcorgan
 * it under the terms of the GNU General Public License as published by
9 937b719d eb
 * the Free Software Foundation; either version 3, or (at your option)
10 5d69a524 jcorgan
 * any later version.
11 5d69a524 jcorgan
 * 
12 5d69a524 jcorgan
 * GNU Radio is distributed in the hope that it will be useful,
13 5d69a524 jcorgan
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 5d69a524 jcorgan
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 5d69a524 jcorgan
 * GNU General Public License for more details.
16 5d69a524 jcorgan
 * 
17 5d69a524 jcorgan
 * You should have received a copy of the GNU General Public License
18 5d69a524 jcorgan
 * along with GNU Radio; see the file COPYING.  If not, write to
19 86f5c924 eb
 * the Free Software Foundation, Inc., 51 Franklin Street,
20 86f5c924 eb
 * Boston, MA 02110-1301, USA.
21 5d69a524 jcorgan
 */
22 5d69a524 jcorgan
#ifndef _GR_FIR_FSF_SIMD_H_
23 5d69a524 jcorgan
#define _GR_FIR_FSF_SIMD_H_
24 5d69a524 jcorgan
25 5d69a524 jcorgan
#include <gr_fir_fsf_generic.h>
26 5d69a524 jcorgan
27 5d69a524 jcorgan
/*!
28 5d69a524 jcorgan
 * \brief common base class for SIMD versions of gr_fir_fsf
29 ed236703 eb
 * \ingroup filter_primitive
30 5d69a524 jcorgan
 *
31 5d69a524 jcorgan
 * This base class handles alignment issues common to SSE and 3DNOW
32 5d69a524 jcorgan
 * subclasses.
33 5d69a524 jcorgan
 */
34 5d69a524 jcorgan
35 5d69a524 jcorgan
class gr_fir_fsf_simd : public gr_fir_fsf_generic
36 5d69a524 jcorgan
{
37 5d69a524 jcorgan
protected:
38 5d69a524 jcorgan
  typedef float (*float_dotprod_t)(const float *input,
39 5d69a524 jcorgan
                                   const float *taps,
40 5d69a524 jcorgan
                                   unsigned n_4_float_blocks);
41 5d69a524 jcorgan
42 5d69a524 jcorgan
  /*!
43 5d69a524 jcorgan
   * \p aligned_taps holds 4 copies of the coefficients preshifted
44 5d69a524 jcorgan
   * by 0, 1, 2, or 3 floats to meet all possible input data alignments.
45 5d69a524 jcorgan
   * This allows us to always fetch data and taps that are 128-bit aligned.
46 5d69a524 jcorgan
   */
47 5d69a524 jcorgan
  float                 *d_aligned_taps[4];
48 5d69a524 jcorgan
49 5d69a524 jcorgan
  float_dotprod_t        d_float_dotprod;         // fast dot product primitive
50 5d69a524 jcorgan
51 5d69a524 jcorgan
public:
52 5d69a524 jcorgan
53 5d69a524 jcorgan
  // CREATORS
54 5d69a524 jcorgan
  gr_fir_fsf_simd ();
55 5d69a524 jcorgan
  gr_fir_fsf_simd (const std::vector<float> &taps);
56 5d69a524 jcorgan
  ~gr_fir_fsf_simd ();
57 5d69a524 jcorgan
58 5d69a524 jcorgan
  // MANIPULATORS
59 5d69a524 jcorgan
  virtual void set_taps (const std::vector<float> &taps);
60 5d69a524 jcorgan
  virtual short filter (const float input[]);
61 5d69a524 jcorgan
};
62 5d69a524 jcorgan
63 5d69a524 jcorgan
#endif