Skip to content
Snippets Groups Projects
Commit 0e9cdedd authored by Grigori Goronzy's avatar Grigori Goronzy Committed by Tom Stellard
Browse files

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: default avatarTom Stellard <thomas.stellard@amd.com>
parent 467f1585
No related branches found
No related tags found
No related merge requests found
......@@ -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() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment