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

Submitted by Marek Olšák on Oct. 11, 2015, 1:29 a.m.

Details

Message ID 1444526990-14029-11-git-send-email-maraeo@gmail.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Marek Olšák Oct. 11, 2015, 1:29 a.m.
From: Marek Olšák <marek.olsak@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(-)

Patch hide | download patch | download mbox

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);