diff options
author | Matt Turner <[email protected]> | 2014-09-21 17:25:49 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2014-09-25 13:52:55 -0700 |
commit | 4a96df73e770bcca6396d3c8ffe3fd1693c73e50 (patch) | |
tree | 6f0d990309a36c1b62b091fd17c0dd93645c186d /src/mesa/drivers | |
parent | 3e0082261959762460dde18553ce0615df5c7a0a (diff) |
mesa: Replace a priori knowledge of gcc builtins with configure tests.
Presumbly this will let clang and other compilers use the built-ins as
well.
Notice two changes specifically:
- in _mesa_next_pow_two_64(), always use __builtin_clzll and add a
static assertion that this is safe.
- in macros.h, remove the clang-specific definition since it should
be able to detect __builtin_unreachable in configure.
Reviewed-by: Jason Ekstrand <[email protected]> [C bits]
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp index 105acdd11b7..844f5e43029 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp @@ -1343,7 +1343,7 @@ brw_blorp_blit_program::single_to_blend() */ inline int count_trailing_one_bits(unsigned value) { -#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 304) /* gcc 3.4 or later */ +#ifdef HAVE___BUILTIN_CTZ return __builtin_ctz(~value); #else return _mesa_bitcount(value & ~(value + 1)); |