//
//===----------------------------------------------------------------------===//
+class InstE<bits<16> op, dag outs, dag ins, string asmstr, list<dag> pattern>
+ : InstSystemZ<2, outs, ins, asmstr, pattern> {
+ field bits<16> Inst;
+ field bits<16> SoftFail = 0;
+
+ let Inst = op;
+}
+
class InstI<bits<8> op, dag outs, dag ins, string asmstr, list<dag> pattern>
: InstSystemZ<2, outs, ins, asmstr, pattern> {
field bits<16> Inst;
let Inst{15-0} = BD2;
}
+class InstRSI<bits<8> op, dag outs, dag ins, string asmstr, list<dag> pattern>
+ : InstSystemZ<4, outs, ins, asmstr, pattern> {
+ field bits<32> Inst;
+ field bits<32> SoftFail = 0;
+
+ bits<4> R1;
+ bits<4> R3;
+ bits<16> RI2;
+
+ let Inst{31-24} = op;
+ let Inst{23-20} = R1;
+ let Inst{19-16} = R3;
+ let Inst{15-0} = RI2;
+}
+
class InstRSY<bits<16> op, dag outs, dag ins, string asmstr, list<dag> pattern>
: InstSystemZ<6, outs, ins, asmstr, pattern> {
field bits<48> Inst;
let Inst{15-0} = BD2;
}
+class InstSSd<bits<8> op, dag outs, dag ins, string asmstr, list<dag> pattern>
+ : InstSystemZ<6, outs, ins, asmstr, pattern> {
+ field bits<48> Inst;
+ field bits<48> SoftFail = 0;
+
+ bits<20> XBD1;
+ bits<16> BD2;
+ bits<4> R3;
+
+ let Inst{47-40} = op;
+ let Inst{39-36} = XBD1{19-16};
+ let Inst{35-32} = R3;
+ let Inst{31-16} = XBD1{15-0};
+ let Inst{15-0} = BD2;
+}
+
+class InstSSE<bits<16> op, dag outs, dag ins, string asmstr, list<dag> pattern>
+ : InstSystemZ<6, outs, ins, asmstr, pattern> {
+ field bits<48> Inst;
+ field bits<48> SoftFail = 0;
+
+ bits<16> BD1;
+ bits<16> BD2;
+
+ let Inst{47-32} = op;
+ let Inst{31-16} = BD1;
+ let Inst{15-0} = BD2;
+}
+
+class InstSSF<bits<12> op, dag outs, dag ins, string asmstr, list<dag> pattern>
+ : InstSystemZ<6, outs, ins, asmstr, pattern> {
+ field bits<48> Inst;
+ field bits<48> SoftFail = 0;
+
+ bits<16> BD1;
+ bits<16> BD2;
+ bits<4> R3;
+
+ let Inst{47-40} = op{11-4};
+ let Inst{39-36} = R3;
+ let Inst{35-32} = op{3-0};
+ let Inst{31-16} = BD1;
+ let Inst{15-0} = BD2;
+}
+
class InstS<bits<16> op, dag outs, dag ins, string asmstr, list<dag> pattern>
: InstSystemZ<4, outs, ins, asmstr, pattern> {
field bits<32> Inst;
// form of the source register in the destination register and
// branches on the result.
//
+// BranchBinary:
+// One register output operand, two register input operands and one branch
+// displacement. The instructions stores a modified form of one of the
+// source registers in the destination register and branches on the result.
+//
// LoadMultiple:
// One address input operand and two explicit output operands.
// The instruction loads a range of registers from the address,
let DisableEncoding = "$R1src";
}
+class BranchBinaryRSI<string mnemonic, bits<8> opcode, RegisterOperand cls>
+ : InstRSI<opcode, (outs cls:$R1), (ins cls:$R1src, cls:$R3, brtarget16:$RI2),
+ mnemonic##"\t$R1, $R3, $RI2", []> {
+ let isBranch = 1;
+ let isTerminator = 1;
+ let Constraints = "$R1 = $R1src";
+ let DisableEncoding = "$R1src";
+}
+
class LoadMultipleRS<string mnemonic, bits<8> opcode, RegisterOperand cls,
AddressingMode mode = bdaddr12only>
: InstRS<opcode, (outs cls:$R1, cls:$R3), (ins mode:$BD2),
brctg %r0, 1
brctg %r0, 0x10000
+#CHECK: error: offset out of range
+#CHECK: brxh %r0, %r2, -0x100002
+#CHECK: error: offset out of range
+#CHECK: brxh %r0, %r2, -1
+#CHECK: error: offset out of range
+#CHECK: brxh %r0, %r2, 1
+#CHECK: error: offset out of range
+#CHECK: brxh %r0, %r2, 0x10000
+
+ brxh %r0, %r2, -0x100002
+ brxh %r0, %r2, -1
+ brxh %r0, %r2, 1
+ brxh %r0, %r2, 0x10000
+
+#CHECK: error: offset out of range
+#CHECK: brxle %r0, %r2, -0x100002
+#CHECK: error: offset out of range
+#CHECK: brxle %r0, %r2, -1
+#CHECK: error: offset out of range
+#CHECK: brxle %r0, %r2, 1
+#CHECK: error: offset out of range
+#CHECK: brxle %r0, %r2, 0x10000
+
+ brxle %r0, %r2, -0x100002
+ brxle %r0, %r2, -1
+ brxle %r0, %r2, 1
+ brxle %r0, %r2, 0x10000
+
#CHECK: error: invalid operand
#CHECK: c %r0, -1
#CHECK: error: invalid operand
ex %r0, -1
ex %r0, 4096
+#CHECK: error: invalid use of indexed addressing
+#CHECK: ectg 160(%r1,%r15),160(%r15), %r2
+#CHECK: error: invalid operand
+#CHECK: ectg -1(%r1),160(%r15), %r2
+#CHECK: error: invalid operand
+#CHECK: ectg 4096(%r1),160(%r15), %r2
+#CHECK: error: invalid operand
+#CHECK: ectg 0(%r1),-1(%r15), %r2
+#CHECK: error: invalid operand
+#CHECK: ectg 0(%r1),4096(%r15), %r2
+
+ ectg 160(%r1,%r15),160(%r15), %r2
+ ectg -1(%r1),160(%r15), %r2
+ ectg 4096(%r1),160(%r15), %r2
+ ectg 0(%r1),-1(%r15), %r2
+ ectg 0(%r1),4096(%r15), %r2
+
#CHECK: error: invalid operand
#CHECK: fidbr %f0, -1, %f0
#CHECK: error: invalid operand
mvc 0(1,%r2), 0(%r1,%r2)
mvc 0(-), 0
+#CHECK: error: invalid use of length addressing
+#CHECK: mvck 0(%r1,%r1), 0(2,%r1), %r3
+#CHECK: error: %r0 used in an address
+#CHECK: mvck 0(%r0,%r1), 0(%r1), %r3
+#CHECK: error: invalid operand
+#CHECK: mvck -1(%r1,%r1), 0(%r1), %r3
+#CHECK: error: invalid operand
+#CHECK: mvck 4096(%r1,%r1), 0(%r1), %r3
+#CHECK: error: invalid operand
+#CHECK: mvck 0(%r1,%r1), -1(%r1), %r3
+#CHECK: error: invalid operand
+#CHECK: mvck 0(%r1,%r1), 4096(%r1), %r3
+#CHECK: error: %r0 used in an address
+#CHECK: mvck 0(%r1,%r0), 0(%r1), %r3
+#CHECK: error: %r0 used in an address
+#CHECK: mvck 0(%r1,%r1), 0(%r0), %r3
+#CHECK: error: invalid use of indexed addressing
+#CHECK: mvck 0(%r1,%r2), 0(%r1,%r2), %r3
+#CHECK: error: unknown token in expression
+#CHECK: mvck 0(-), 0, %r3
+
+ mvck 0(%r1,%r1), 0(2,%r1), %r3
+ mvck 0(%r0,%r1), 0(%r1), %r3
+ mvck -1(%r1,%r1), 0(%r1), %r3
+ mvck 4096(%r1,%r1), 0(%r1), %r3
+ mvck 0(%r1,%r1), -1(%r1), %r3
+ mvck 0(%r1,%r1), 4096(%r1), %r3
+ mvck 0(%r1,%r0), 0(%r1), %r3
+ mvck 0(%r1,%r1), 0(%r0), %r3
+ mvck 0(%r1,%r2), 0(%r1,%r2), %r3
+ mvck 0(-), 0, %r3
+
#CHECK: error: invalid operand
#CHECK: mvghi -1, 0
#CHECK: error: invalid operand
popcnt %r0, %r0
#CHECK: error: invalid operand
+#CHECK: pr %r0
+ pr %r0
+
+#CHECK: error: invalid operand
#CHECK: risbg %r0,%r0,0,0,-1
#CHECK: error: invalid operand
#CHECK: risbg %r0,%r0,0,0,64
stmy %r0, %r0, 524288
stmy %r0, %r0, 0(%r1,%r2)
+#CHECK: error: invalid use of indexed addressing
+#CHECK: strag 160(%r1,%r15),160(%r15)
+#CHECK: error: invalid operand
+#CHECK: strag -1(%r1),160(%r15)
+#CHECK: error: invalid operand
+#CHECK: strag 4096(%r1),160(%r15)
+#CHECK: error: invalid operand
+#CHECK: strag 0(%r1),-1(%r15)
+#CHECK: error: invalid operand
+#CHECK: strag 0(%r1),4096(%r15)
+
+ strag 160(%r1,%r15),160(%r15)
+ strag -1(%r1),160(%r15)
+ strag 4096(%r1),160(%r15)
+ strag 0(%r1),-1(%r15)
+ strag 0(%r1),4096(%r15)
+
#CHECK: error: offset out of range
#CHECK: strl %r0, -0x1000000002
#CHECK: error: offset out of range
#CHECK: fixup A - offset: 2, value: .[[LAB]]+2, kind: FK_390_PC16DBL
brctg %r15, 0
+#CHECK: brxh %r0, %r2, .[[LAB:L.*]]-65536 # encoding: [0x84,0x02,A,A]
+#CHECK: fixup A - offset: 2, value: (.[[LAB]]-65536)+2, kind: FK_390_PC16DBL
+ brxh %r0,%r2, -0x10000
+#CHECK: brxh %r0, %r2, .[[LAB:L.*]]-2 # encoding: [0x84,0x02,A,A]
+#CHECK: fixup A - offset: 2, value: (.[[LAB]]-2)+2, kind: FK_390_PC16DBL
+ brxh %r0, %r2, -2
+#CHECK: brxh %r0, %r2, .[[LAB:L.*]] # encoding: [0x84,0x02,A,A]
+#CHECK: fixup A - offset: 2, value: .[[LAB]]+2, kind: FK_390_PC16DBL
+ brxh %r0,%r2, 0
+#CHECK: brxh %r0, %r2, .[[LAB:L.*]]+65534 # encoding: [0x84,0x02,A,A]
+#CHECK: fixup A - offset: 2, value: (.[[LAB]]+65534)+2, kind: FK_390_PC16DBL
+ brxh %r0,%r2, 0xfffe
+
+#CHECK: brxh %r0, %r2, foo # encoding: [0x84,0x02,A,A]
+#CHECK: fixup A - offset: 2, value: foo+2, kind: FK_390_PC16DBL
+#CHECK: brxh %r14, %r2, foo # encoding: [0x84,0xe2,A,A]
+#CHECK: fixup A - offset: 2, value: foo+2, kind: FK_390_PC16DBL
+#CHECK: brxh %r15, %r2, foo # encoding: [0x84,0xf2,A,A]
+#CHECK: fixup A - offset: 2, value: foo+2, kind: FK_390_PC16DBL
+ brxh %r0,%r2,foo
+ brxh %r14,%r2,foo
+ brxh %r15,%r2,foo
+
+#CHECK: brxh %r0, %r2, bar+100 # encoding: [0x84,0x02,A,A]
+#CHECK: fixup A - offset: 2, value: (bar+100)+2, kind: FK_390_PC16DBL
+#CHECK: brxh %r14, %r2, bar+100 # encoding: [0x84,0xe2,A,A]
+#CHECK: fixup A - offset: 2, value: (bar+100)+2, kind: FK_390_PC16DBL
+#CHECK: brxh %r15, %r2, bar+100 # encoding: [0x84,0xf2,A,A]
+#CHECK: fixup A - offset: 2, value: (bar+100)+2, kind: FK_390_PC16DBL
+ brxh %r0,%r2,bar+100
+ brxh %r14,%r2,bar+100
+ brxh %r15,%r2,bar+100
+
+#CHECK: brxh %r0, %r2, bar@PLT # encoding: [0x84,0x02,A,A]
+#CHECK: fixup A - offset: 2, value: bar@PLT+2, kind: FK_390_PC16DBL
+#CHECK: brxh %r14, %r2, bar@PLT # encoding: [0x84,0xe2,A,A]
+#CHECK: fixup A - offset: 2, value: bar@PLT+2, kind: FK_390_PC16DBL
+#CHECK: brxh %r15, %r2, bar@PLT # encoding: [0x84,0xf2,A,A]
+#CHECK: fixup A - offset: 2, value: bar@PLT+2, kind: FK_390_PC16DBL
+ brxh %r0,%r2,bar@PLT
+ brxh %r14,%r2,bar@PLT
+ brxh %r15,%r2,bar@PLT
+
+#CHECK: brxle %r0, %r2, .[[LAB:L.*]]-65536 # encoding: [0x85,0x02,A,A]
+#CHECK: fixup A - offset: 2, value: (.[[LAB]]-65536)+2, kind: FK_390_PC16DBL
+ brxle %r0,%r2, -0x10000
+#CHECK: brxle %r0, %r2, .[[LAB:L.*]]-2 # encoding: [0x85,0x02,A,A]
+#CHECK: fixup A - offset: 2, value: (.[[LAB]]-2)+2, kind: FK_390_PC16DBL
+ brxle %r0, %r2, -2
+#CHECK: brxle %r0, %r2, .[[LAB:L.*]] # encoding: [0x85,0x02,A,A]
+#CHECK: fixup A - offset: 2, value: .[[LAB]]+2, kind: FK_390_PC16DBL
+ brxle %r0,%r2, 0
+#CHECK: brxle %r0, %r2, .[[LAB:L.*]]+65534 # encoding: [0x85,0x02,A,A]
+#CHECK: fixup A - offset: 2, value: (.[[LAB]]+65534)+2, kind: FK_390_PC16DBL
+ brxle %r0,%r2, 0xfffe
+
+#CHECK: brxle %r0, %r2, foo # encoding: [0x85,0x02,A,A]
+#CHECK: fixup A - offset: 2, value: foo+2, kind: FK_390_PC16DBL
+#CHECK: brxle %r14, %r2, foo # encoding: [0x85,0xe2,A,A]
+#CHECK: fixup A - offset: 2, value: foo+2, kind: FK_390_PC16DBL
+#CHECK: brxle %r15, %r2, foo # encoding: [0x85,0xf2,A,A]
+#CHECK: fixup A - offset: 2, value: foo+2, kind: FK_390_PC16DBL
+ brxle %r0,%r2,foo
+ brxle %r14,%r2,foo
+ brxle %r15,%r2,foo
+
+#CHECK: brxle %r0, %r2, bar+100 # encoding: [0x85,0x02,A,A]
+#CHECK: fixup A - offset: 2, value: (bar+100)+2, kind: FK_390_PC16DBL
+#CHECK: brxle %r14, %r2, bar+100 # encoding: [0x85,0xe2,A,A]
+#CHECK: fixup A - offset: 2, value: (bar+100)+2, kind: FK_390_PC16DBL
+#CHECK: brxle %r15, %r2, bar+100 # encoding: [0x85,0xf2,A,A]
+#CHECK: fixup A - offset: 2, value: (bar+100)+2, kind: FK_390_PC16DBL
+ brxle %r0,%r2,bar+100
+ brxle %r14,%r2,bar+100
+ brxle %r15,%r2,bar+100
+
+#CHECK: brxle %r0, %r2, bar@PLT # encoding: [0x85,0x02,A,A]
+#CHECK: fixup A - offset: 2, value: bar@PLT+2, kind: FK_390_PC16DBL
+#CHECK: brxle %r14, %r2, bar@PLT # encoding: [0x85,0xe2,A,A]
+#CHECK: fixup A - offset: 2, value: bar@PLT+2, kind: FK_390_PC16DBL
+#CHECK: brxle %r15, %r2, bar@PLT # encoding: [0x85,0xf2,A,A]
+#CHECK: fixup A - offset: 2, value: bar@PLT+2, kind: FK_390_PC16DBL
+ brxle %r0,%r2,bar@PLT
+ brxle %r14,%r2,bar@PLT
+ brxle %r15,%r2,bar@PLT
+
#CHECK: c %r0, 0 # encoding: [0x59,0x00,0x00,0x00]
#CHECK: c %r0, 4095 # encoding: [0x59,0x00,0x0f,0xff]
#CHECK: c %r0, 0(%r1) # encoding: [0x59,0x00,0x10,0x00]
ear %r7, %a8
ear %r15, %a15
+#CHECK: ectg 0, 0, %r0 # encoding: [0xc8,0x01,0x00,0x00,0x00,0x00]
+#CHECK: ectg 0(%r1), 0(%r15), %r2 # encoding: [0xc8,0x21,0x10,0x00,0xf0,0x00]
+#CHECK: ectg 1(%r1), 0(%r15), %r2 # encoding: [0xc8,0x21,0x10,0x01,0xf0,0x00]
+#CHECK: ectg 4095(%r1), 0(%r15), %r2 # encoding: [0xc8,0x21,0x1f,0xff,0xf0,0x00]
+#CHECK: ectg 0(%r1), 1(%r15), %r2 # encoding: [0xc8,0x21,0x10,0x00,0xf0,0x01]
+#CHECK: ectg 0(%r1), 4095(%r15), %r2 # encoding: [0xc8,0x21,0x10,0x00,0xff,0xff]
+
+ ectg 0,0,%r0
+ ectg 0(%r1),0(%r15),%r2
+ ectg 1(%r1),0(%r15),%r2
+ ectg 4095(%r1),0(%r15),%r2
+ ectg 0(%r1),1(%r15),%r2
+ ectg 0(%r1),4095(%r15),%r2
+
#CHECK: ex %r0, 0 # encoding: [0x44,0x00,0x00,0x00]
#CHECK: ex %r0, 4095 # encoding: [0x44,0x00,0x0f,0xff]
#CHECK: ex %r0, 0(%r1) # encoding: [0x44,0x00,0x10,0x00]
mvc 0(256,%r1), 0
mvc 0(256,%r15), 0
+#CHECK: mvck 0(%r1), 0, %r3 # encoding: [0xd9,0x03,0x10,0x00,0x00,0x00]
+#CHECK: mvck 0(%r1), 0(%r1), %r3 # encoding: [0xd9,0x03,0x10,0x00,0x10,0x00]
+#CHECK: mvck 0(%r1), 0(%r15), %r3 # encoding: [0xd9,0x03,0x10,0x00,0xf0,0x00]
+#CHECK: mvck 0(%r1), 4095, %r3 # encoding: [0xd9,0x03,0x10,0x00,0x0f,0xff]
+#CHECK: mvck 0(%r1), 4095(%r1), %r3 # encoding: [0xd9,0x03,0x10,0x00,0x1f,0xff]
+#CHECK: mvck 0(%r1), 4095(%r15), %r3 # encoding: [0xd9,0x03,0x10,0x00,0xff,0xff]
+#CHECK: mvck 0(%r2,%r1), 0, %r3 # encoding: [0xd9,0x23,0x10,0x00,0x00,0x00]
+#CHECK: mvck 0(%r2,%r15), 0, %r3 # encoding: [0xd9,0x23,0xf0,0x00,0x00,0x00]
+#CHECK: mvck 4095(%r2,%r1), 0, %r3 # encoding: [0xd9,0x23,0x1f,0xff,0x00,0x00]
+#CHECK: mvck 4095(%r2,%r15), 0, %r3 # encoding: [0xd9,0x23,0xff,0xff,0x00,0x00]
+#CHECK: mvck 0(%r2,%r1), 0, %r3 # encoding: [0xd9,0x23,0x10,0x00,0x00,0x00]
+#CHECK: mvck 0(%r2,%r15), 0, %r3 # encoding: [0xd9,0x23,0xf0,0x00,0x00,0x00]
+
+ mvck 0(%r1), 0, %r3
+ mvck 0(%r1), 0(%r1), %r3
+ mvck 0(%r1), 0(%r15), %r3
+ mvck 0(%r1), 4095, %r3
+ mvck 0(%r1), 4095(%r1), %r3
+ mvck 0(%r1), 4095(%r15), %r3
+ mvck 0(%r2,%r1), 0, %r3
+ mvck 0(%r2,%r15), 0, %r3
+ mvck 4095(%r2,%r1), 0, %r3
+ mvck 4095(%r2,%r15), 0, %r3
+ mvck 0(%r2,%r1), 0, %r3
+ mvck 0(%r2,%r15), 0, %r3
+
#CHECK: mvghi 0, 0 # encoding: [0xe5,0x48,0x00,0x00,0x00,0x00]
#CHECK: mvghi 4095, 0 # encoding: [0xe5,0x48,0x0f,0xff,0x00,0x00]
#CHECK: mvghi 0, -32768 # encoding: [0xe5,0x48,0x00,0x00,0x80,0x00]
pfdrl 7, frob@PLT
pfdrl 8, frob@PLT
+#CHECK: pr # encoding: [0x01,0x01]
+ pr
+
#CHECK: risbg %r0, %r0, 0, 0, 0 # encoding: [0xec,0x00,0x00,0x00,0x00,0x55]
#CHECK: risbg %r0, %r0, 0, 0, 63 # encoding: [0xec,0x00,0x00,0x00,0x3f,0x55]
#CHECK: risbg %r0, %r0, 0, 255, 0 # encoding: [0xec,0x00,0x00,0xff,0x00,0x55]
stmy %r0,%r0,524287(%r1)
stmy %r0,%r0,524287(%r15)
+#CHECK: strag 0, 0 # encoding: [0xe5,0x02,0x00,0x00,0x00,0x00]
+#CHECK: strag 0(%r1), 0(%r2) # encoding: [0xe5,0x02,0x10,0x00,0x20,0x00]
+#CHECK: strag 160(%r1), 320(%r15) # encoding: [0xe5,0x02,0x10,0xa0,0xf1,0x40]
+#CHECK: strag 0(%r1), 4095 # encoding: [0xe5,0x02,0x10,0x00,0x0f,0xff]
+#CHECK: strag 0(%r1), 4095(%r2) # encoding: [0xe5,0x02,0x10,0x00,0x2f,0xff]
+#CHECK: strag 0(%r1), 4095(%r15) # encoding: [0xe5,0x02,0x10,0x00,0xff,0xff]
+#CHECK: strag 0(%r1), 0 # encoding: [0xe5,0x02,0x10,0x00,0x00,0x00]
+#CHECK: strag 0(%r15), 0 # encoding: [0xe5,0x02,0xf0,0x00,0x00,0x00]
+#CHECK: strag 4095(%r1), 0 # encoding: [0xe5,0x02,0x1f,0xff,0x00,0x00]
+#CHECK: strag 4095(%r15), 0 # encoding: [0xe5,0x02,0xff,0xff,0x00,0x00]
+
+ strag 0, 0
+ strag 0(%r1), 0(%r2)
+ strag 160(%r1), 320(%r15)
+ strag 0(%r1), 4095
+ strag 0(%r1), 4095(%r2)
+ strag 0(%r1), 4095(%r15)
+ strag 0(%r1), 0
+ strag 0(%r15), 0
+ strag 4095(%r1), 0
+ strag 4095(%r15), 0
+
#CHECK: strl %r0, .[[LAB:L.*]]-4294967296 # encoding: [0xc4,0x0f,A,A,A,A]
#CHECK: fixup A - offset: 2, value: (.[[LAB]]-4294967296)+2, kind: FK_390_PC32DBL
strl %r0, -0x100000000