diff options
author | Chuck Atkins <[email protected]> | 2016-06-28 15:50:47 -0400 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2016-06-30 16:55:01 -0500 |
commit | c1bf6692beb662e5749e5680e0ebd15af2cd032a (patch) | |
tree | 1894669381f50d032d68811bdc4d125029a5cb62 /src/gallium/drivers/swr/swr_scratch.h | |
parent | eb79b2b33117ea8fe6f463198322e7478be63a72 (diff) |
swr: Refactor checks for compiler feature flags
Encapsulate the test for which flags are needed to get a compiler to
support certain features. Along with this, give various options to try
for AVX and AVX2 support. Ideally we want to use specific instruction
set feature flags, like -mavx2 for instance instead of -march=haswell,
but the flags required for certain compilers are different. This
allows, for AVX2 for instance, GCC to use -mavx2 -mfma -mbmi2 -mf16c
while the Intel compiler which doesn't support those flags can fall
back to using -march=core-avx2.
This addresses a bug where the Intel compiler will silently ignore the
AVX2 instruction feature flags and then potentially fail to build.
v2: Pass preprocessor-check argument as true-state instead of
false-state for clarity.
v3: Reduce AVX2 define test to just __AVX2__. Additional defines suchas
__FMA__, __BMI2__, and __F16C__ appear to be inconsistently defined
w.r.t thier availability.
v4: Fix C++11 flags being added globally and add more logic to
swr_require_cxx_feature_flags
Cc: <[email protected]>
Reviewed-by: Tim Rowley <[email protected]>
Tested-by: Tim Rowley <[email protected]>
Signed-off-by: Chuck Atkins <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/swr_scratch.h')
0 files changed, 0 insertions, 0 deletions