[Mesa-dev] [PATCH 10/10] radeonsi: really enable the no-nans-fp-math option

Marek Olšák maraeo at gmail.com
Sat Oct 10 18:29:50 PDT 2015


From: Marek Olšák <marek.olsak at amd.com>

Include compute shaders too, which includes OpenGL, but not OpenCL.

LLVM doesn't use this much according to shader-db:

Totals:
SGPRS: 344944 -> 344944 (0.00 %)
VGPRS: 197024 -> 197024 (0.00 %)
Code Size: 7325688 -> 7325624 (-0.00 %) bytes
LDS: 91 -> 91 (0.00 %) blocks
Scratch: 1510400 -> 1510400 (0.00 %) bytes per wave

Totals from affected shaders:
SGPRS: 664 -> 664 (0.00 %)
VGPRS: 480 -> 480 (0.00 %)
Code Size: 25356 -> 25292 (-0.25 %) bytes
LDS: 0 -> 0 (0.00 %) blocks
Scratch: 0 -> 0 (0.00 %) bytes per wave
---
 src/gallium/drivers/radeonsi/si_shader.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 8da2f77..aa4cfa0 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -3587,7 +3587,7 @@ static void create_function(struct si_shader_context *si_shader_ctx)
 
 	if (shader->dx10_clamp_mode)
 		LLVMAddTargetDependentFunctionAttr(si_shader_ctx->radeon_bld.main_fn,
-						   "enable-no-nans-fp-math", "true");
+						   "no-nans-fp-math", "true");
 
 	for (i = 0; i <= last_sgpr; ++i) {
 		LLVMValueRef P = LLVMGetParam(si_shader_ctx->radeon_bld.main_fn, i);
@@ -4095,8 +4095,7 @@ int si_shader_create(struct si_screen *sscreen, LLVMTargetMachineRef tm,
 	radeon_llvm_context_init(&si_shader_ctx.radeon_bld);
 	bld_base = &si_shader_ctx.radeon_bld.soa.bld_base;
 
-	if (sel->type != PIPE_SHADER_COMPUTE)
-		shader->dx10_clamp_mode = true;
+	shader->dx10_clamp_mode = true;
 
 	if (sel->info.uses_kill)
 		shader->db_shader_control |= S_02880C_KILL_ENABLE(1);
-- 
2.1.4



More information about the mesa-dev mailing list