summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorZhan Jun Liau <zhanjunl@ca.ibm.com>2016-08-05 15:14:34 +0000
committerZhan Jun Liau <zhanjunl@ca.ibm.com>2016-08-05 15:14:34 +0000
commit8d3f29759fc9e1450fb9f2b789b4900d59809223 (patch)
tree959aab412efa0059bcc7ad3fc95bf05071a79e9f /llvm/lib
parent000a87d1b0008d2a15243ffee7f367bf56024c1e (diff)
downloadbcm5719-llvm-8d3f29759fc9e1450fb9f2b789b4900d59809223.tar.gz
bcm5719-llvm-8d3f29759fc9e1450fb9f2b789b4900d59809223.zip
[SystemZ] Add missing classes and instructions
Summary: Add instruction formats E, RSI, SSd, SSE, and SSF. Added BRXH, BRXLE, PR, MVCK, STRAG, and ECTG instructions to test out those formats. Reviewers: uweigand Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23179 llvm-svn: 277822
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/SystemZ/SystemZInstrFormats.td82
-rw-r--r--llvm/lib/Target/SystemZ/SystemZInstrInfo.td22
2 files changed, 104 insertions, 0 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZInstrFormats.td b/llvm/lib/Target/SystemZ/SystemZInstrFormats.td
index 973894d5c00..7358b63277a 100644
--- a/llvm/lib/Target/SystemZ/SystemZInstrFormats.td
+++ b/llvm/lib/Target/SystemZ/SystemZInstrFormats.td
@@ -158,6 +158,14 @@ def getThreeOperandOpcode : InstrMapping {
//
//===----------------------------------------------------------------------===//
+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;
@@ -487,6 +495,21 @@ class InstRS<bits<8> op, dag outs, dag ins, string asmstr, list<dag> pattern>
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;
@@ -560,6 +583,51 @@ class InstSS<bits<8> op, dag outs, dag ins, string asmstr, list<dag> pattern>
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;
@@ -966,6 +1034,11 @@ class InstVRX<bits<16> op, dag outs, dag ins, string asmstr, list<dag> pattern>
// 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,
@@ -1060,6 +1133,15 @@ class BranchUnaryRI<string mnemonic, bits<12> opcode, RegisterOperand cls>
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),
diff --git a/llvm/lib/Target/SystemZ/SystemZInstrInfo.td b/llvm/lib/Target/SystemZ/SystemZInstrInfo.td
index c510ca774be..effb559fe1a 100644
--- a/llvm/lib/Target/SystemZ/SystemZInstrInfo.td
+++ b/llvm/lib/Target/SystemZ/SystemZInstrInfo.td
@@ -335,6 +335,9 @@ let Defs = [CC] in {
def BRCTG : BranchUnaryRI<"brctg", 0xA77, GR64>;
}
+def BRXH : BranchBinaryRSI<"brxh", 0x84, GR64>;
+def BRXLE : BranchBinaryRSI<"brxle", 0x85, GR64>;
+
//===----------------------------------------------------------------------===//
// Select instructions
//===----------------------------------------------------------------------===//
@@ -1680,6 +1683,25 @@ let hasSideEffects = 1 in {
"exrl\t$R1, $I2", []>;
}
+let Defs = [CC] in {
+ let hasSideEffects = 1 in
+ def PR : InstE<0x0101, (outs), (ins), "pr", []>;
+
+ let mayLoad = 1, mayStore = 1 in
+ def MVCK : InstSSd<0xD9, (outs),
+ (ins bdxaddr12only:$XBD1, bdaddr12only:$BD2,
+ GR64:$R3),
+ "mvck\t$XBD1, $BD2, $R3", []>;
+}
+
+let mayStore = 1 in
+ def STRAG : InstSSE<0xE502, (outs), (ins bdaddr12only:$BD1, bdaddr12only:$BD2),
+ "strag\t$BD1, $BD2", []>;
+
+let Defs = [R0D, R1D], mayLoad = 1 in
+ def ECTG : InstSSF<0xC81, (outs),
+ (ins bdaddr12only:$BD1, bdaddr12only:$BD2, GR64:$R3),
+ "ectg\t$BD1, $BD2, $R3", []>;
//===----------------------------------------------------------------------===//
// Peepholes.
OpenPOWER on IntegriCloud