Commit 78347549 authored by James Almer's avatar James Almer

avutil/intmath: check for ICC before GCC

Intel compiler also defines __GNUC__, so the Intel specific intrinsics were not
really being used.
Reviewed-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 9a829a2b
...@@ -39,22 +39,22 @@ ...@@ -39,22 +39,22 @@
*/ */
#if HAVE_FAST_CLZ #if HAVE_FAST_CLZ
#if AV_GCC_VERSION_AT_LEAST(3,4) #if defined( __INTEL_COMPILER )
#ifndef ff_log2 #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 # ifndef ff_log2_16bit
# define ff_log2_16bit av_log2 # define ff_log2_16bit av_log2
# endif # endif
#endif /* ff_log2 */ #endif /* ff_log2 */
#elif defined( __INTEL_COMPILER ) #elif AV_GCC_VERSION_AT_LEAST(3,4)
#ifndef ff_log2 #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 # ifndef ff_log2_16bit
# define ff_log2_16bit av_log2 # define ff_log2_16bit av_log2
# endif # endif
#endif /* ff_log2 */ #endif /* ff_log2 */
#endif
#endif /* AV_GCC_VERSION_AT_LEAST(3,4) */ #endif /* AV_GCC_VERSION_AT_LEAST(3,4) */
#endif
extern const uint8_t ff_log2_tab[256]; 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) ...@@ -115,13 +115,13 @@ static av_always_inline av_const int ff_log2_16bit_c(unsigned int v)
*/ */
#if HAVE_FAST_CLZ #if HAVE_FAST_CLZ
#if AV_GCC_VERSION_AT_LEAST(3,4) #if defined( __INTEL_COMPILER )
#ifndef ff_ctz #ifndef ff_ctz
#define ff_ctz(v) __builtin_ctz(v) #define ff_ctz(v) _bit_scan_forward(v)
#endif #endif
#elif defined( __INTEL_COMPILER ) #elif AV_GCC_VERSION_AT_LEAST(3,4)
#ifndef ff_ctz #ifndef ff_ctz
#define ff_ctz(v) _bit_scan_forward(v) #define ff_ctz(v) __builtin_ctz(v)
#endif #endif
#endif #endif
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment