LCOV - code coverage report
Current view: top level - src/libavutil/x86 - float_dsp_init.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 29 30 96.7 %
Date: 2017-07-20 10:18:08 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /*
       2             :  * This file is part of FFmpeg.
       3             :  *
       4             :  * FFmpeg is free software; you can redistribute it and/or
       5             :  * modify it under the terms of the GNU Lesser General Public
       6             :  * License as published by the Free Software Foundation; either
       7             :  * version 2.1 of the License, or (at your option) any later version.
       8             :  *
       9             :  * FFmpeg is distributed in the hope that it will be useful,
      10             :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      11             :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      12             :  * Lesser General Public License for more details.
      13             :  *
      14             :  * You should have received a copy of the GNU Lesser General Public
      15             :  * License along with FFmpeg; if not, write to the Free Software
      16             :  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
      17             :  */
      18             : 
      19             : #include "config.h"
      20             : 
      21             : #include "libavutil/attributes.h"
      22             : #include "libavutil/cpu.h"
      23             : #include "libavutil/float_dsp.h"
      24             : #include "cpu.h"
      25             : #include "asm.h"
      26             : 
      27             : void ff_vector_fmul_sse(float *dst, const float *src0, const float *src1,
      28             :                         int len);
      29             : void ff_vector_fmul_avx(float *dst, const float *src0, const float *src1,
      30             :                         int len);
      31             : 
      32             : void ff_vector_fmac_scalar_sse(float *dst, const float *src, float mul,
      33             :                                int len);
      34             : void ff_vector_fmac_scalar_avx(float *dst, const float *src, float mul,
      35             :                                int len);
      36             : void ff_vector_fmac_scalar_fma3(float *dst, const float *src, float mul,
      37             :                                 int len);
      38             : 
      39             : void ff_vector_fmul_scalar_sse(float *dst, const float *src, float mul,
      40             :                                int len);
      41             : 
      42             : void ff_vector_dmac_scalar_sse2(double *dst, const double *src, double mul,
      43             :                                 int len);
      44             : void ff_vector_dmac_scalar_avx(double *dst, const double *src, double mul,
      45             :                                int len);
      46             : void ff_vector_dmac_scalar_fma3(double *dst, const double *src, double mul,
      47             :                                 int len);
      48             : 
      49             : void ff_vector_dmul_scalar_sse2(double *dst, const double *src,
      50             :                                 double mul, int len);
      51             : void ff_vector_dmul_scalar_avx(double *dst, const double *src,
      52             :                                double mul, int len);
      53             : 
      54             : void ff_vector_fmul_window_3dnowext(float *dst, const float *src0,
      55             :                                     const float *src1, const float *win, int len);
      56             : void ff_vector_fmul_window_sse(float *dst, const float *src0,
      57             :                                const float *src1, const float *win, int len);
      58             : 
      59             : void ff_vector_fmul_add_sse(float *dst, const float *src0, const float *src1,
      60             :                             const float *src2, int len);
      61             : void ff_vector_fmul_add_avx(float *dst, const float *src0, const float *src1,
      62             :                             const float *src2, int len);
      63             : void ff_vector_fmul_add_fma3(float *dst, const float *src0, const float *src1,
      64             :                              const float *src2, int len);
      65             : 
      66             : void ff_vector_fmul_reverse_sse(float *dst, const float *src0,
      67             :                                 const float *src1, int len);
      68             : void ff_vector_fmul_reverse_avx(float *dst, const float *src0,
      69             :                                 const float *src1, int len);
      70             : void ff_vector_fmul_reverse_avx2(float *dst, const float *src0,
      71             :                                  const float *src1, int len);
      72             : 
      73             : float ff_scalarproduct_float_sse(const float *v1, const float *v2, int order);
      74             : 
      75             : void ff_butterflies_float_sse(float *av_restrict src0, float *av_restrict src1, int len);
      76             : 
      77         696 : av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp)
      78             : {
      79         696 :     int cpu_flags = av_get_cpu_flags();
      80             : 
      81         696 :     if (EXTERNAL_AMD3DNOWEXT(cpu_flags)) {
      82           0 :         fdsp->vector_fmul_window = ff_vector_fmul_window_3dnowext;
      83             :     }
      84         696 :     if (EXTERNAL_SSE(cpu_flags)) {
      85          57 :         fdsp->vector_fmul = ff_vector_fmul_sse;
      86          57 :         fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_sse;
      87          57 :         fdsp->vector_fmul_scalar = ff_vector_fmul_scalar_sse;
      88          57 :         fdsp->vector_fmul_window = ff_vector_fmul_window_sse;
      89          57 :         fdsp->vector_fmul_add    = ff_vector_fmul_add_sse;
      90          57 :         fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_sse;
      91          57 :         fdsp->scalarproduct_float = ff_scalarproduct_float_sse;
      92          57 :         fdsp->butterflies_float   = ff_butterflies_float_sse;
      93             :     }
      94         696 :     if (EXTERNAL_SSE2(cpu_flags)) {
      95          56 :         fdsp->vector_dmac_scalar = ff_vector_dmac_scalar_sse2;
      96          56 :         fdsp->vector_dmul_scalar = ff_vector_dmul_scalar_sse2;
      97             :     }
      98         696 :     if (EXTERNAL_AVX_FAST(cpu_flags)) {
      99          50 :         fdsp->vector_fmul = ff_vector_fmul_avx;
     100          50 :         fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_avx;
     101          50 :         fdsp->vector_dmul_scalar = ff_vector_dmul_scalar_avx;
     102          50 :         fdsp->vector_dmac_scalar = ff_vector_dmac_scalar_avx;
     103          50 :         fdsp->vector_fmul_add    = ff_vector_fmul_add_avx;
     104          50 :         fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_avx;
     105             :     }
     106         696 :     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
     107          48 :         fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_avx2;
     108             :     }
     109         696 :     if (EXTERNAL_FMA3_FAST(cpu_flags)) {
     110          49 :         fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_fma3;
     111          49 :         fdsp->vector_fmul_add    = ff_vector_fmul_add_fma3;
     112          49 :         fdsp->vector_dmac_scalar = ff_vector_dmac_scalar_fma3;
     113             :     }
     114         696 : }

Generated by: LCOV version 1.13