Skip to content

Commit 7631328

Browse files
committed
[AMDGPU] Fix ieee mode default value
Previously, the default value for ieee mode was - on for compute kernels and compute shaders, - off for all shaders except compute shaders. This commit changes the default to be - on for compute kernels, - off for shaders. This aligns the default value with the settings that are actually in use. To my knowledge, all users of shader calling conventions (mesa and llpc) disable the ieee mode by default. Differential Revision: https://reviews.llvm.org/D89388
1 parent 985a5d9 commit 7631328

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -774,10 +774,8 @@ struct SIModeRegisterDefaults {
774774
SIModeRegisterDefaults(const Function &F);
775775

776776
static SIModeRegisterDefaults getDefaultForCallingConv(CallingConv::ID CC) {
777-
const bool IsCompute = AMDGPU::isCompute(CC);
778-
779777
SIModeRegisterDefaults Mode;
780-
Mode.IEEE = IsCompute;
778+
Mode.IEEE = !AMDGPU::isShader(CC);
781779
return Mode;
782780
}
783781

llvm/test/CodeGen/AMDGPU/amdgcn-ieee.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ define void @func_ieee_mode_off() #2 {
9393
; GCN-LABEL: {{^}}cs_ieee_mode_default:
9494
; GCN: {{buffer|global|flat}}_load_dword [[VAL0:v[0-9]+]]
9595
; GCN-NEXT: {{buffer|global|flat}}_load_dword [[VAL1:v[0-9]+]]
96-
; GCN-DAG: v_mul_f32_e32 [[QUIET0:v[0-9]+]], 1.0, [[VAL0]]
97-
; GCN-DAG: v_mul_f32_e32 [[QUIET1:v[0-9]+]], 1.0, [[VAL1]]
96+
; GCN-NOT: [[VAL0]]
97+
; GCN-NOT: [[VAL1]]
9898
; GCN: v_min_f32_e32 [[MIN:v[0-9]+]], [[QUIET0]], [[QUIET1]]
9999
; GCN-NOT: v_mul_f32
100100
define amdgpu_cs void @cs_ieee_mode_default() #0 {

llvm/test/CodeGen/AMDGPU/amdpal-msgpack-default.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
; RUN: llc -mtriple=amdgcn--amdpal -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=GFX9 -enable-var-scope %s
44

55
; amdpal compute shader: check for 0x2e12 (COMPUTE_PGM_RSRC1) in pal metadata
6-
; SI-DAG: 0x2e12 (COMPUTE_PGM_RSRC1): 0xaf0000{{$}}
7-
; VI-DAG: 0x2e12 (COMPUTE_PGM_RSRC1): 0xaf02c0{{$}}
8-
; GFX9-DAG: 0x2e12 (COMPUTE_PGM_RSRC1): 0xaf0000{{$}}
6+
; SI-DAG: 0x2e12 (COMPUTE_PGM_RSRC1): 0x2f0000{{$}}
7+
; VI-DAG: 0x2e12 (COMPUTE_PGM_RSRC1): 0x2f02c0{{$}}
8+
; GFX9-DAG: 0x2e12 (COMPUTE_PGM_RSRC1): 0x2f0000{{$}}
99
define amdgpu_cs half @cs_amdpal(half %arg0) {
1010
%add = fadd half %arg0, 1.0
1111
ret half %add

llvm/test/CodeGen/AMDGPU/amdpal-msgpack-denormal.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
; RUN: llc -mtriple=amdgcn--amdpal -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=GFX9 -enable-var-scope %s
44

55
; amdpal compute shader: check for 0x2e12 (COMPUTE_PGM_RSRC1) in pal metadata
6-
; SI-DAG: 0x2e12 (COMPUTE_PGM_RSRC1): 0xac0000{{$}}
7-
; VI-DAG: 0x2e12 (COMPUTE_PGM_RSRC1): 0xac02c0{{$}}
8-
; GFX9-DAG: 0x2e12 (COMPUTE_PGM_RSRC1): 0xac0000{{$}}
6+
; SI-DAG: 0x2e12 (COMPUTE_PGM_RSRC1): 0x2c0000{{$}}
7+
; VI-DAG: 0x2e12 (COMPUTE_PGM_RSRC1): 0x2c02c0{{$}}
8+
; GFX9-DAG: 0x2e12 (COMPUTE_PGM_RSRC1): 0x2c0000{{$}}
99
define amdgpu_cs half @cs_amdpal(half %arg0) #0 {
1010
%add = fadd half %arg0, 1.0
1111
ret half %add

llvm/test/CodeGen/AMDGPU/amdpal-msgpack-dx10-clamp.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
; RUN: llc -mtriple=amdgcn--amdpal -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=GFX9 -enable-var-scope %s
44

55
; amdpal compute shader: check for 0x2e12 (COMPUTE_PGM_RSRC1) in pal metadata
6-
; SI-DAG: 0x2e12 (COMPUTE_PGM_RSRC1): 0x8f0000{{$}}
7-
; VI-DAG: 0x2e12 (COMPUTE_PGM_RSRC1): 0x8f02c0{{$}}
8-
; GFX9-DAG: 0x2e12 (COMPUTE_PGM_RSRC1): 0x8f0000{{$}}
6+
; SI-DAG: 0x2e12 (COMPUTE_PGM_RSRC1): 0xf0000{{$}}
7+
; VI-DAG: 0x2e12 (COMPUTE_PGM_RSRC1): 0xf02c0{{$}}
8+
; GFX9-DAG: 0x2e12 (COMPUTE_PGM_RSRC1): 0xf0000{{$}}
99
define amdgpu_cs half @cs_amdpal(half %arg0) #0 {
1010
%add = fadd half %arg0, 1.0
1111
ret half %add

0 commit comments

Comments
 (0)