diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/amd/llvm/ac_llvm_helper.cpp | 14 | ||||
-rw-r--r-- | src/amd/llvm/ac_llvm_util.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader_llvm.c | 2 |
3 files changed, 14 insertions, 4 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, }; diff --git a/src/gallium/drivers/radeonsi/si_shader_llvm.c b/src/gallium/drivers/radeonsi/si_shader_llvm.c index d8bcb4ad55c..63c9c033ab4 100644 --- a/src/gallium/drivers/radeonsi/si_shader_llvm.c +++ b/src/gallium/drivers/radeonsi/si_shader_llvm.c @@ -134,7 +134,7 @@ void si_llvm_context_init(struct si_shader_context *ctx, struct si_screen *sscre ctx->compiler = compiler; ac_llvm_context_init(&ctx->ac, compiler, sscreen->info.chip_class, sscreen->info.family, - AC_FLOAT_MODE_NO_SIGNED_ZEROS_FP_MATH, wave_size, 64); + AC_FLOAT_MODE_DEFAULT_OPENGL, wave_size, 64); } void si_llvm_create_func(struct si_shader_context *ctx, const char *name, LLVMTypeRef *return_types, |