During fdiv32 lowering use S_DENORM_MODE to select denorm mode in gfx10.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 36086 Build 36085: arc lint + arc unit
Event Timeline
llvm/lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
7536 | You do not need IsGFX10 if you have GCNSubtarget. | |
7541 | Why GFX10 is different here? It is equally controlled by the subtarget attribute on any ASIC. | |
7543 | I do not think this is right. When you restore mode you need to check current defaults, FP64Denomals and FP32Denormals. Otherwise you are restoring not what it was before. | |
7630 | The values for setreg and s_denorm_mode are different in size, you should not use the same constant, even if you mask it. |
llvm/lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
7543 | It is quite misleading, a better code separation is needed. |
LGTM. It seems like s_denorm_mode should have special syntax like setreg, but that's a separate patch
The test is failing on some bots: http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/27245/steps/ninja%20check%201/logs/FAIL%3A%20LLVM%3A%3Agfx10_dasm_all.txt
******************** TEST 'LLVM :: MC/Disassembler/AMDGPU/gfx10_dasm_all.txt' FAILED ******************** Script: -- : 'RUN: at line 1'; /export/users/atombot/llvm/clang-atom-d525-fedora-rel/stage1/bin/llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=+wavefrontsize32,-wavefrontsize64 -disassemble -show-encoding < /export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/test/MC/Disassembler/AMDGPU/gfx10_dasm_all.txt | /export/users/atombot/llvm/clang-atom-d525-fedora-rel/stage1/bin/FileCheck -check-prefixes=GFX10,W32 /export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/test/MC/Disassembler/AMDGPU/gfx10_dasm_all.txt : 'RUN: at line 2'; /export/users/atombot/llvm/clang-atom-d525-fedora-rel/stage1/bin/llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-wavefrontsize32,+wavefrontsize64 -disassemble -show-encoding < /export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/test/MC/Disassembler/AMDGPU/gfx10_dasm_all.txt | /export/users/atombot/llvm/clang-atom-d525-fedora-rel/stage1/bin/FileCheck -check-prefixes=GFX10,W64 /export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/test/MC/Disassembler/AMDGPU/gfx10_dasm_all.txt -- Exit Code: 1 Command Output (stderr): -- /export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/test/MC/Disassembler/AMDGPU/gfx10_dasm_all.txt:13619:10: error: GFX10: expected string not found in input # GFX10: s_denorm_mode 0x0 ; encoding: [0x00,0x00,0xa5,0xbf] ^ <stdin>:4540:2: note: scanning from here s_denorm_mode 0 ; encoding: [0x00,0x00,0xa5,0xbf] ^
Sorry, I reverted this commit, it broke the test MC/Disassembler/AMDGPU/gfx10_dasm_all.txt..
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/15915
I tried changing the test expectations to match 0 instead of 0x0 in rL367907, since both my Windows machine and Linux machine agree on that output. If that doesn't work and there is some platform variance, we can always use regexes to match both.
You do not need IsGFX10 if you have GCNSubtarget.