Skip to content

Commit 1bac911

Browse files
committedApr 11, 2016
[SystemZ] Add SVC instruction
This is going to be useful for inline assembly only. Author: koriakin Differential Revision: http://reviews.llvm.org/D18952 llvm-svn: 265943
1 parent 3b425ff commit 1bac911

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed
 

‎llvm/lib/Target/SystemZ/SystemZInstrFormats.td

+11
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,17 @@ def getThreeOperandOpcode : InstrMapping {
158158
//
159159
//===----------------------------------------------------------------------===//
160160

161+
class InstI<bits<8> op, dag outs, dag ins, string asmstr, list<dag> pattern>
162+
: InstSystemZ<2, outs, ins, asmstr, pattern> {
163+
field bits<16> Inst;
164+
field bits<16> SoftFail = 0;
165+
166+
bits<8> I1;
167+
168+
let Inst{15-8} = op;
169+
let Inst{7-0} = I1;
170+
}
171+
161172
class InstRI<bits<12> op, dag outs, dag ins, string asmstr, list<dag> pattern>
162173
: InstSystemZ<4, outs, ins, asmstr, pattern> {
163174
field bits<32> Inst;

‎llvm/lib/Target/SystemZ/SystemZInstrInfo.td

+4
Original file line numberDiff line numberDiff line change
@@ -1570,6 +1570,10 @@ let mayLoad = 1, Defs = [CC] in
15701570
defm SRST : StringRRE<"srst", 0xb25e, z_search_string>;
15711571

15721572
// Other instructions for inline assembly
1573+
let hasSideEffects = 1, Defs = [CC], isCall = 1 in
1574+
def SVC : InstI<0x0A, (outs), (ins imm32zx8:$I1),
1575+
"svc\t$I1",
1576+
[]>;
15731577
let hasSideEffects = 1, Defs = [CC], mayStore = 1 in
15741578
def STCK : InstS<0xB205, (outs), (ins bdaddr12only:$BD2),
15751579
"stck\t$BD2",

‎llvm/test/MC/Disassembler/SystemZ/insns.txt

+12
Original file line numberDiff line numberDiff line change
@@ -8698,6 +8698,18 @@
86988698
# CHECK: sty %r15, 0
86998699
0xe3 0xf0 0x00 0x00 0x00 0x50
87008700

8701+
# CHECK: svc 0
8702+
0x0a 0x00
8703+
8704+
# CHECK: svc 3
8705+
0x0a 0x03
8706+
8707+
# CHECK: svc 128
8708+
0x0a 0x80
8709+
8710+
# CHECK: svc 255
8711+
0x0a 0xff
8712+
87018713
# CHECK: sxbr %f0, %f0
87028714
0xb3 0x4b 0x00 0x00
87038715

‎llvm/test/MC/SystemZ/insn-good.s

+10
Original file line numberDiff line numberDiff line change
@@ -8973,6 +8973,16 @@
89738973
strvg %r0,524287(%r15,%r1)
89748974
strvg %r15,0
89758975

8976+
#CHECK: svc 0 # encoding: [0x0a,0x00]
8977+
#CHECK: svc 3 # encoding: [0x0a,0x03]
8978+
#CHECK: svc 128 # encoding: [0x0a,0x80]
8979+
#CHECK: svc 255 # encoding: [0x0a,0xff]
8980+
8981+
svc 0
8982+
svc 3
8983+
svc 128
8984+
svc 0xff
8985+
89768986
#CHECK: sty %r0, -524288 # encoding: [0xe3,0x00,0x00,0x00,0x80,0x50]
89778987
#CHECK: sty %r0, -1 # encoding: [0xe3,0x00,0x0f,0xff,0xff,0x50]
89788988
#CHECK: sty %r0, 0 # encoding: [0xe3,0x00,0x00,0x00,0x00,0x50]

0 commit comments

Comments
 (0)
Please sign in to comment.