diff options
author | James Almer <jamrial@gmail.com> | 2015-07-18 16:52:42 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2015-07-18 19:59:34 -0300 |
commit | 78347549a4449ebac65add844b93a53bbbf559da (patch) | |
tree | 621d85085f541fb1969f6590694382f170d301b0 /libavutil | |
parent | 9a829a2b6a7a5bc7f6fb492577daaaec43c9f6c8 (diff) | |
download | ffmpeg-78347549a4449ebac65add844b93a53bbbf559da.tar.gz |
avutil/intmath: check for ICC before GCC
Intel compiler also defines __GNUC__, so the Intel specific intrinsics were not
really being used.
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/intmath.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libavutil/intmath.h b/libavutil/intmath.h index f5ecc77b7d..ef347f4108 100644 --- a/libavutil/intmath.h +++ b/libavutil/intmath.h @@ -39,22 +39,22 @@ */ #if HAVE_FAST_CLZ -#if AV_GCC_VERSION_AT_LEAST(3,4) +#if defined( __INTEL_COMPILER ) #ifndef ff_log2 -# define ff_log2(x) (31 - __builtin_clz((x)|1)) +# define ff_log2(x) (_bit_scan_reverse((x)|1)) # ifndef ff_log2_16bit # define ff_log2_16bit av_log2 # endif #endif /* ff_log2 */ -#elif defined( __INTEL_COMPILER ) +#elif AV_GCC_VERSION_AT_LEAST(3,4) #ifndef ff_log2 -# define ff_log2(x) (_bit_scan_reverse((x)|1)) +# define ff_log2(x) (31 - __builtin_clz((x)|1)) # ifndef ff_log2_16bit # define ff_log2_16bit av_log2 # endif #endif /* ff_log2 */ -#endif #endif /* AV_GCC_VERSION_AT_LEAST(3,4) */ +#endif extern const uint8_t ff_log2_tab[256]; @@ -115,13 +115,13 @@ static av_always_inline av_const int ff_log2_16bit_c(unsigned int v) */ #if HAVE_FAST_CLZ -#if AV_GCC_VERSION_AT_LEAST(3,4) +#if defined( __INTEL_COMPILER ) #ifndef ff_ctz -#define ff_ctz(v) __builtin_ctz(v) +#define ff_ctz(v) _bit_scan_forward(v) #endif -#elif defined( __INTEL_COMPILER ) +#elif AV_GCC_VERSION_AT_LEAST(3,4) #ifndef ff_ctz -#define ff_ctz(v) _bit_scan_forward(v) +#define ff_ctz(v) __builtin_ctz(v) #endif #endif #endif |