summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigori Goronzy <[email protected]>2014-07-17 18:44:25 +0200
committerTom Stellard <[email protected]>2014-07-23 10:40:33 -0400
commit0e9cdedd2e3943bdb7f3543a3508b883b167e427 (patch)
treed28669bce19f80ed81957e98843bbfc78a7146a1
parent467f1585e28adba0e94ef593de131bc327f098bb (diff)
radeon/llvm: enable unsafe math for graphics shaders
Accuracy of some operations was recently improved in the R600 backend, at the cost of slower code. This is required for compute shaders, but not for graphics shaders. Add unsafe-fp-math hint to make LLVM generate faster but possibly less accurate code. Piglit didn't indicate any regressions. Reviewed-by: Tom Stellard <[email protected]>
-rw-r--r--src/gallium/drivers/radeon/radeon_llvm_emit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.c b/src/gallium/drivers/radeon/radeon_llvm_emit.c
index 1b17dd4613f..171ccaadd5c 100644
--- a/src/gallium/drivers/radeon/radeon_llvm_emit.c
+++ b/src/gallium/drivers/radeon/radeon_llvm_emit.c
@@ -26,6 +26,7 @@
#include "radeon_llvm_emit.h"
#include "radeon_elf_util.h"
#include "util/u_memory.h"
+#include "pipe/p_shader_tokens.h"
#include <llvm-c/Target.h>
#include <llvm-c/TargetMachine.h>
@@ -50,6 +51,10 @@ void radeon_llvm_shader_type(LLVMValueRef F, unsigned type)
sprintf(Str, "%1d", type);
LLVMAddTargetDependentFunctionAttr(F, "ShaderType", Str);
+
+ if (type != TGSI_PROCESSOR_COMPUTE) {
+ LLVMAddTargetDependentFunctionAttr(F, "unsafe-fp-math", "true");
+ }
}
static void init_r600_target() {