[llvm] r329440 - [AMDGPU][MC][GFX9] Added s_call_b64
Dmitry Preobrazhensky via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 6 11:24:49 PDT 2018
Author: dpreobra
Date: Fri Apr 6 11:24:49 2018
New Revision: 329440
URL: http://llvm.org/viewvc/llvm-project?rev=329440&view=rev
Log:
[AMDGPU][MC][GFX9] Added s_call_b64
See bug 36843: https://bugs.llvm.org/show_bug.cgi?id=36843
Differential Revision: https://reviews.llvm.org/D45268
Reviewers: artem.tamazov, arsenm, timcorringham
Modified:
llvm/trunk/lib/Target/AMDGPU/SOPInstructions.td
llvm/trunk/test/MC/AMDGPU/data.s
llvm/trunk/test/MC/AMDGPU/sopk.s
llvm/trunk/test/MC/Disassembler/AMDGPU/sopk_gfx9.txt
Modified: llvm/trunk/lib/Target/AMDGPU/SOPInstructions.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SOPInstructions.td?rev=329440&r1=329439&r2=329440&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SOPInstructions.td (original)
+++ llvm/trunk/lib/Target/AMDGPU/SOPInstructions.td Fri Apr 6 11:24:49 2018
@@ -672,6 +672,16 @@ def S_SETREG_IMM32_B32 : SOPK_Pseudo <
} // End hasSideEffects = 1
+let SubtargetPredicate = isGFX9 in {
+ def S_CALL_B64 : SOPK_Pseudo<
+ "s_call_b64",
+ (outs SReg_64:$sdst),
+ (ins s16imm:$simm16),
+ "$sdst, $simm16"> {
+ let isCall = 1;
+ }
+}
+
//===----------------------------------------------------------------------===//
// SOPC Instructions
//===----------------------------------------------------------------------===//
@@ -1333,6 +1343,8 @@ def S_SETREG_B32_vi : SOPK_Real_v
def S_SETREG_IMM32_B32_vi : SOPK_Real64<0x14, S_SETREG_IMM32_B32>,
Select_vi<S_SETREG_IMM32_B32.Mnemonic>;
+def S_CALL_B64_vi : SOPK_Real_vi <0x15, S_CALL_B64>;
+
//===----------------------------------------------------------------------===//
// SOP1 - GFX9.
//===----------------------------------------------------------------------===//
Modified: llvm/trunk/test/MC/AMDGPU/data.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AMDGPU/data.s?rev=329440&r1=329439&r2=329440&view=diff
==============================================================================
--- llvm/trunk/test/MC/AMDGPU/data.s (original)
+++ llvm/trunk/test/MC/AMDGPU/data.s Fri Apr 6 11:24:49 2018
@@ -4,13 +4,13 @@
.text
v_mov_b32 v7, s24
- v_mov_b32 v8, s25
- .long 0xabadc0de
- s_nop 0
- s_endpgm
- .long 0xbadc0de1, 0xbadc0de2, 0xbadc0de3, 0xbadc0de4
- .byte 0x0a, 0x0b
- .byte 0x0c
+ v_mov_b32 v8, s25
+ .long 0xabadc0de
+ s_nop 0
+ s_endpgm
+ .long 0xabadc0d1, 0xabadc0d2, 0xabadc0d3, 0xabadc0d4
+ .byte 0x0a, 0x0b
+ .byte 0x0c
// CHECK: .text
// CHECK: v_mov_b32
@@ -18,10 +18,10 @@
// CHECK: .long 0xabadc0de
// CHECK_SAME: : ABADC0DE
// CHECK: s_endpgm
-// CHECK: .long 0xbadc0de1
-// CHECK: .long 0xbadc0de2
-// CHECK: .long 0xbadc0de3
-// CHECK: .long 0xbadc0de4
+// CHECK: .long 0xabadc0d1
+// CHECK: .long 0xabadc0d2
+// CHECK: .long 0xabadc0d3
+// CHECK: .long 0xabadc0d4
// CHECK: .byte 0x0a, 0x0b, 0x0c
// CHECK-SAME: : 0A 0B 0C
// CHECK-NOT: .long
Modified: llvm/trunk/test/MC/AMDGPU/sopk.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AMDGPU/sopk.s?rev=329440&r1=329439&r2=329440&view=diff
==============================================================================
--- llvm/trunk/test/MC/AMDGPU/sopk.s (original)
+++ llvm/trunk/test/MC/AMDGPU/sopk.s Fri Apr 6 11:24:49 2018
@@ -175,3 +175,15 @@ s_setreg_imm32_b32 hwreg(HW_REG_GPR_ALLO
s_endpgm_ordered_ps_done
// GFX9: s_endpgm_ordered_ps_done ; encoding: [0x00,0x00,0x9e,0xbf]
// NOSICIVI: error: instruction not supported on this GPU
+
+s_call_b64 s[12:13], 12609
+// GFX9: s_call_b64 s[12:13], 0x3141 ; encoding: [0x41,0x31,0x8c,0xba]
+// NOSICIVI: error: instruction not supported on this GPU
+
+s_call_b64 s[100:101], 12609
+// GFX9: s_call_b64 s[100:101], 0x3141 ; encoding: [0x41,0x31,0xe4,0xba]
+// NOSICIVI: error: instruction not supported on this GPU
+
+s_call_b64 s[10:11], 49617
+// GFX9: s_call_b64 s[10:11], 0xc1d1 ; encoding: [0xd1,0xc1,0x8a,0xba]
+// NOSICIVI: error: instruction not supported on this GPU
Modified: llvm/trunk/test/MC/Disassembler/AMDGPU/sopk_gfx9.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/AMDGPU/sopk_gfx9.txt?rev=329440&r1=329439&r2=329440&view=diff
==============================================================================
--- llvm/trunk/test/MC/Disassembler/AMDGPU/sopk_gfx9.txt (original)
+++ llvm/trunk/test/MC/Disassembler/AMDGPU/sopk_gfx9.txt Fri Apr 6 11:24:49 2018
@@ -2,3 +2,12 @@
# GFX9: s_endpgm_ordered_ps_done ; encoding: [0x00,0x00,0x9e,0xbf]
0x00,0x00,0x9e,0xbf
+
+# GFX9: s_call_b64 s[10:11], 0x3141 ; encoding: [0x41,0x31,0x8a,0xba]
+0x41,0x31,0x8a,0xba
+
+# GFX9: s_call_b64 s[100:101], 0x3141 ; encoding: [0x41,0x31,0xe4,0xba]
+0x41,0x31,0xe4,0xba
+
+# GFX9: s_call_b64 s[10:11], 0xc1d1 ; encoding: [0xd1,0xc1,0x8a,0xba]
+0xd1,0xc1,0x8a,0xba
More information about the llvm-commits
mailing list