diff options
author | Marek Olšák <[email protected]> | 2020-04-22 22:38:14 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-27 11:20:16 +0000 |
commit | f2c2a28073dd4ea0d104f284e874d136880a91a5 (patch) | |
tree | b59f6e81a53b552b7a047e79c016ff70fea2a4ad /src/amd/llvm | |
parent | 3bb65c06706a58b124e4a600eeb35a7b3c5c3a23 (diff) |
ac: update and document fast math flags used by radeonsi
This should have no effect, because we never use FP division, but
it's safer for the future.
Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4696>
Diffstat (limited to 'src/amd/llvm')
-rw-r--r-- | src/amd/llvm/ac_llvm_helper.cpp | 14 | ||||
-rw-r--r-- | src/amd/llvm/ac_llvm_util.h | 2 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/amd/llvm/ac_llvm_helper.cpp b/src/amd/llvm/ac_llvm_helper.cpp index 6b4610597ed..578521a6f2d 100644 --- a/src/amd/llvm/ac_llvm_helper.cpp +++ b/src/amd/llvm/ac_llvm_helper.cpp @@ -84,8 +84,18 @@ LLVMBuilderRef ac_create_builder(LLVMContextRef ctx, case AC_FLOAT_MODE_DEFAULT: case AC_FLOAT_MODE_DENORM_FLUSH_TO_ZERO: break; - case AC_FLOAT_MODE_NO_SIGNED_ZEROS_FP_MATH: - flags.setNoSignedZeros(); + + case AC_FLOAT_MODE_DEFAULT_OPENGL: + /* Allow optimizations to treat the sign of a zero argument or + * result as insignificant. + */ + flags.setNoSignedZeros(); /* nsz */ + + /* Allow optimizations to use the reciprocal of an argument + * rather than perform division. + */ + flags.setAllowReciprocal(); /* arcp */ + llvm::unwrap(builder)->setFastMathFlags(flags); break; } diff --git a/src/amd/llvm/ac_llvm_util.h b/src/amd/llvm/ac_llvm_util.h index 00372476d8e..4cfb3b55388 100644 --- a/src/amd/llvm/ac_llvm_util.h +++ b/src/amd/llvm/ac_llvm_util.h @@ -70,7 +70,7 @@ enum ac_target_machine_options { enum ac_float_mode { AC_FLOAT_MODE_DEFAULT, - AC_FLOAT_MODE_NO_SIGNED_ZEROS_FP_MATH, + AC_FLOAT_MODE_DEFAULT_OPENGL, AC_FLOAT_MODE_DENORM_FLUSH_TO_ZERO, }; |