unsigned getMemRIXEncoding(const MCInst &MI, unsigned OpNo,
SmallVectorImpl<MCFixup> &Fixups,
const MCSubtargetInfo &STI) const;
+ unsigned getSPE8DisEncoding(const MCInst &MI, unsigned OpNo,
+ SmallVectorImpl<MCFixup> &Fixups,
+ const MCSubtargetInfo &STI) const;
+ unsigned getSPE4DisEncoding(const MCInst &MI, unsigned OpNo,
+ SmallVectorImpl<MCFixup> &Fixups,
+ const MCSubtargetInfo &STI) const;
+ unsigned getSPE2DisEncoding(const MCInst &MI, unsigned OpNo,
+ SmallVectorImpl<MCFixup> &Fixups,
+ const MCSubtargetInfo &STI) const;
unsigned getTLSRegEncoding(const MCInst &MI, unsigned OpNo,
SmallVectorImpl<MCFixup> &Fixups,
const MCSubtargetInfo &STI) const;
}
+unsigned PPCMCCodeEmitter::getSPE8DisEncoding(const MCInst &MI, unsigned OpNo,
+ SmallVectorImpl<MCFixup> &Fixups,
+ const MCSubtargetInfo &STI)
+ const {
+ // Encode (imm, reg) as a spe8dis, which has the low 5-bits of (imm / 8)
+ // as the displacement and the next 5 bits as the register #.
+ assert(MI.getOperand(OpNo+1).isReg());
+ uint32_t RegBits = getMachineOpValue(MI, MI.getOperand(OpNo+1), Fixups, STI) << 5;
+
+ const MCOperand &MO = MI.getOperand(OpNo);
+ assert(MO.isImm());
+ uint32_t Imm = getMachineOpValue(MI, MO, Fixups, STI) >> 3;
+ return reverseBits(Imm | RegBits) >> 22;
+}
+
+
+unsigned PPCMCCodeEmitter::getSPE4DisEncoding(const MCInst &MI, unsigned OpNo,
+ SmallVectorImpl<MCFixup> &Fixups,
+ const MCSubtargetInfo &STI)
+ const {
+ // Encode (imm, reg) as a spe4dis, which has the low 5-bits of (imm / 4)
+ // as the displacement and the next 5 bits as the register #.
+ assert(MI.getOperand(OpNo+1).isReg());
+ uint32_t RegBits = getMachineOpValue(MI, MI.getOperand(OpNo+1), Fixups, STI) << 5;
+
+ const MCOperand &MO = MI.getOperand(OpNo);
+ assert(MO.isImm());
+ uint32_t Imm = getMachineOpValue(MI, MO, Fixups, STI) >> 2;
+ return reverseBits(Imm | RegBits) >> 22;
+}
+
+
+unsigned PPCMCCodeEmitter::getSPE2DisEncoding(const MCInst &MI, unsigned OpNo,
+ SmallVectorImpl<MCFixup> &Fixups,
+ const MCSubtargetInfo &STI)
+ const {
+ // Encode (imm, reg) as a spe2dis, which has the low 5-bits of (imm / 2)
+ // as the displacement and the next 5 bits as the register #.
+ assert(MI.getOperand(OpNo+1).isReg());
+ uint32_t RegBits = getMachineOpValue(MI, MI.getOperand(OpNo+1), Fixups, STI) << 5;
+
+ const MCOperand &MO = MI.getOperand(OpNo);
+ assert(MO.isImm());
+ uint32_t Imm = getMachineOpValue(MI, MO, Fixups, STI) >> 1;
+ return reverseBits(Imm | RegBits) >> 22;
+}
+
+
unsigned PPCMCCodeEmitter::getTLSRegEncoding(const MCInst &MI, unsigned OpNo,
SmallVectorImpl<MCFixup> &Fixups,
const MCSubtargetInfo &STI) const {
let Inst{21-31} = xo;
}
+class EVXForm_D<bits<11> xo, dag OOL, dag IOL, string asmstr,
+ InstrItinClass itin> : I<4, OOL, IOL, asmstr, itin> {
+ bits<5> RT;
+ bits<21> D;
+
+ let Pattern = [];
+
+ let Inst{6-10} = RT;
+ let Inst{20} = D{0};
+ let Inst{19} = D{1};
+ let Inst{18} = D{2};
+ let Inst{17} = D{3};
+ let Inst{16} = D{4};
+ let Inst{15} = D{5};
+ let Inst{14} = D{6};
+ let Inst{13} = D{7};
+ let Inst{12} = D{8};
+ let Inst{11} = D{9};
+ let Inst{11-20} = D{0-9};
+ let Inst{21-31} = xo;
+}
+
let Predicates = [HasSPE], isAsmParserOnly = 1 in {
+def EVLDD : EVXForm_D<769, (outs gprc:$RT), (ins spe8dis:$dst),
+ "evldd $RT, $dst", IIC_VecFP>;
+def EVLDW : EVXForm_D<771, (outs gprc:$RT), (ins spe8dis:$dst),
+ "evldw $RT, $dst", IIC_VecFP>;
+def EVLDH : EVXForm_D<773, (outs gprc:$RT), (ins spe8dis:$dst),
+ "evldh $RT, $dst", IIC_VecFP>;
+def EVLHHESPLAT : EVXForm_D<777, (outs gprc:$RT), (ins spe2dis:$dst),
+ "evlhhesplat $RT, $dst", IIC_VecFP>;
+def EVLHHOUSPLAT : EVXForm_D<781, (outs gprc:$RT), (ins spe2dis:$dst),
+ "evlhhousplat $RT, $dst", IIC_VecFP>;
+def EVLHHOSSPLAT : EVXForm_D<783, (outs gprc:$RT), (ins spe2dis:$dst),
+ "evlhhossplat $RT, $dst", IIC_VecFP>;
+def EVLWHE : EVXForm_D<785, (outs gprc:$RT), (ins spe4dis:$dst),
+ "evlwhe $RT, $dst", IIC_VecFP>;
+def EVLWHOU : EVXForm_D<789, (outs gprc:$RT), (ins spe4dis:$dst),
+ "evlwhou $RT, $dst", IIC_VecFP>;
+def EVLWHOS : EVXForm_D<791, (outs gprc:$RT), (ins spe4dis:$dst),
+ "evlwhos $RT, $dst", IIC_VecFP>;
+def EVLWWSPLAT : EVXForm_D<793, (outs gprc:$RT), (ins spe4dis:$dst),
+ "evlwwsplat $RT, $dst", IIC_VecFP>;
+def EVLWHSPLAT : EVXForm_D<797, (outs gprc:$RT), (ins spe4dis:$dst),
+ "evlwhsplat $RT, $dst", IIC_VecFP>;
+
+def EVSTDD : EVXForm_D<801, (outs), (ins gprc:$RT, spe8dis:$dst),
+ "evstdd $RT, $dst", IIC_VecFP>;
+def EVSTDH : EVXForm_D<805, (outs), (ins gprc:$RT, spe8dis:$dst),
+ "evstdh $RT, $dst", IIC_VecFP>;
+def EVSTDW : EVXForm_D<803, (outs), (ins gprc:$RT, spe8dis:$dst),
+ "evstdw $RT, $dst", IIC_VecFP>;
+def EVSTWHE : EVXForm_D<817, (outs), (ins gprc:$RT, spe4dis:$dst),
+ "evstwhe $RT, $dst", IIC_VecFP>;
+def EVSTWHO : EVXForm_D<821, (outs), (ins gprc:$RT, spe4dis:$dst),
+ "evstwho $RT, $dst", IIC_VecFP>;
+def EVSTWWE : EVXForm_D<825, (outs), (ins gprc:$RT, spe4dis:$dst),
+ "evstwwe $RT, $dst", IIC_VecFP>;
+def EVSTWWO : EVXForm_D<829, (outs), (ins gprc:$RT, spe4dis:$dst),
+ "evstwwo $RT, $dst", IIC_VecFP>;
+
def EVMRA : EVXForm_1<1220, (outs gprc:$RT), (ins gprc:$RA),
"evmra $RT, $RA", IIC_VecFP> {
let RB = 0;
# CHECK-BE: evxor 14, 22, 19 # encoding: [0x11,0xd6,0x9a,0x16]
# CHECK-LE: evxor 14, 22, 19 # encoding: [0x16,0x9a,0xd6,0x11]
evxor %r14, %r22, %r19
+
+# CHECK-BE: evldd 14, 0(27) # encoding: [0x11,0xdb,0x03,0x01]
+# CHECK-LE: evldd 14, 0(27) # encoding: [0x01,0x03,0xdb,0x11]
+ evldd %r14, 0(%r27)
+# CHECK-BE: evldd 14, 248(27) # encoding: [0x11,0xdb,0xfb,0x01]
+# CHECK-LE: evldd 14, 248(27) # encoding: [0x01,0xfb,0xdb,0x11]
+ evldd %r14, 248(%r27)
+# CHECK-BE: evldd 14, 248(9) # encoding: [0x11,0xc9,0xfb,0x01]
+# CHECK-LE: evldd 14, 248(9) # encoding: [0x01,0xfb,0xc9,0x11]
+ evldd %r14, 248(%r9)
+# CHECK-BE: evldw 14, 0(27) # encoding: [0x11,0xdb,0x03,0x03]
+# CHECK-LE: evldw 14, 0(27) # encoding: [0x03,0x03,0xdb,0x11]
+ evldw %r14, 0(%r27)
+# CHECK-BE: evldw 14, 248(27) # encoding: [0x11,0xdb,0xfb,0x03]
+# CHECK-LE: evldw 14, 248(27) # encoding: [0x03,0xfb,0xdb,0x11]
+ evldw %r14, 248(%r27)
+# CHECK-BE: evldw 14, 248(9) # encoding: [0x11,0xc9,0xfb,0x03]
+# CHECK-LE: evldw 14, 248(9) # encoding: [0x03,0xfb,0xc9,0x11]
+ evldw %r14, 248(%r9)
+# CHECK-BE: evldh 14, 0(27) # encoding: [0x11,0xdb,0x03,0x05]
+# CHECK-LE: evldh 14, 0(27) # encoding: [0x05,0x03,0xdb,0x11]
+ evldh %r14, 0(%r27)
+# CHECK-BE: evldh 14, 248(27) # encoding: [0x11,0xdb,0xfb,0x05]
+# CHECK-LE: evldh 14, 248(27) # encoding: [0x05,0xfb,0xdb,0x11]
+ evldh %r14, 248(%r27)
+# CHECK-BE: evldh 14, 248(9) # encoding: [0x11,0xc9,0xfb,0x05]
+# CHECK-LE: evldh 14, 248(9) # encoding: [0x05,0xfb,0xc9,0x11]
+ evldh %r14, 248(%r9)
+# CHECK-BE: evlhhesplat 14, 0(27) # encoding: [0x11,0xdb,0x03,0x09]
+# CHECK-LE: evlhhesplat 14, 0(27) # encoding: [0x09,0x03,0xdb,0x11]
+ evlhhesplat %r14, 0(%r27)
+# CHECK-BE: evlhhousplat 14, 0(27) # encoding: [0x11,0xdb,0x03,0x0d]
+# CHECK-LE: evlhhousplat 14, 0(27) # encoding: [0x0d,0x03,0xdb,0x11]
+ evlhhousplat %r14, 0(%r27)
+# CHECK-BE: evlhhousplat 14, 62(27) # encoding: [0x11,0xdb,0xfb,0x0d]
+# CHECK-LE: evlhhousplat 14, 62(27) # encoding: [0x0d,0xfb,0xdb,0x11]
+ evlhhousplat %r14, 62(%r27)
+# CHECK-BE: evlhhousplat 14, 62(9) # encoding: [0x11,0xc9,0xfb,0x0d]
+# CHECK-LE: evlhhousplat 14, 62(9) # encoding: [0x0d,0xfb,0xc9,0x11]
+ evlhhousplat %r14, 62(%r9)
+# CHECK-BE: evlhhossplat 14, 0(27) # encoding: [0x11,0xdb,0x03,0x0f]
+# CHECK-LE: evlhhossplat 14, 0(27) # encoding: [0x0f,0x03,0xdb,0x11]
+ evlhhossplat %r14, 0(%r27)
+# CHECK-BE: evlhhossplat 14, 62(27) # encoding: [0x11,0xdb,0xfb,0x0f]
+# CHECK-LE: evlhhossplat 14, 62(27) # encoding: [0x0f,0xfb,0xdb,0x11]
+ evlhhossplat %r14, 62(%r27)
+# CHECK-BE: evlhhossplat 14, 62(9) # encoding: [0x11,0xc9,0xfb,0x0f]
+# CHECK-LE: evlhhossplat 14, 62(9) # encoding: [0x0f,0xfb,0xc9,0x11]
+ evlhhossplat %r14, 62(%r9)
+# CHECK-BE: evlwhe 14, 0(27) # encoding: [0x11,0xdb,0x03,0x11]
+# CHECK-LE: evlwhe 14, 0(27) # encoding: [0x11,0x03,0xdb,0x11]
+ evlwhe %r14, 0(%r27)
+# CHECK-BE: evlwhe 14, 124(27) # encoding: [0x11,0xdb,0xfb,0x11]
+# CHECK-LE: evlwhe 14, 124(27) # encoding: [0x11,0xfb,0xdb,0x11]
+ evlwhe %r14, 124(%r27)
+# CHECK-BE: evlwhe 14, 124(9) # encoding: [0x11,0xc9,0xfb,0x11]
+# CHECK-LE: evlwhe 14, 124(9) # encoding: [0x11,0xfb,0xc9,0x11]
+ evlwhe %r14, 124(%r9)
+# CHECK-BE: evlwhou 14, 0(27) # encoding: [0x11,0xdb,0x03,0x15]
+# CHECK-LE: evlwhou 14, 0(27) # encoding: [0x15,0x03,0xdb,0x11]
+ evlwhou %r14, 0(%r27)
+# CHECK-BE: evlwhou 14, 124(27) # encoding: [0x11,0xdb,0xfb,0x15]
+# CHECK-LE: evlwhou 14, 124(27) # encoding: [0x15,0xfb,0xdb,0x11]
+ evlwhou %r14, 124(%r27)
+# CHECK-BE: evlwhou 14, 124(9) # encoding: [0x11,0xc9,0xfb,0x15]
+# CHECK-LE: evlwhou 14, 124(9) # encoding: [0x15,0xfb,0xc9,0x11]
+ evlwhou %r14, 124(%r9)
+# CHECK-BE: evlwhos 14, 0(27) # encoding: [0x11,0xdb,0x03,0x17]
+# CHECK-LE: evlwhos 14, 0(27) # encoding: [0x17,0x03,0xdb,0x11]
+ evlwhos %r14, 0(%r27)
+# CHECK-BE: evlwhos 14, 124(27) # encoding: [0x11,0xdb,0xfb,0x17]
+# CHECK-LE: evlwhos 14, 124(27) # encoding: [0x17,0xfb,0xdb,0x11]
+ evlwhos %r14, 124(%r27)
+# CHECK-BE: evlwhos 14, 124(9) # encoding: [0x11,0xc9,0xfb,0x17]
+# CHECK-LE: evlwhos 14, 124(9) # encoding: [0x17,0xfb,0xc9,0x11]
+ evlwhos %r14, 124(%r9)
+# CHECK-BE: evlwwsplat 14, 0(27) # encoding: [0x11,0xdb,0x03,0x19]
+# CHECK-LE: evlwwsplat 14, 0(27) # encoding: [0x19,0x03,0xdb,0x11]
+ evlwwsplat %r14, 0(%r27)
+# CHECK-BE: evlwwsplat 14, 124(27) # encoding: [0x11,0xdb,0xfb,0x19]
+# CHECK-LE: evlwwsplat 14, 124(27) # encoding: [0x19,0xfb,0xdb,0x11]
+ evlwwsplat %r14, 124(%r27)
+# CHECK-BE: evlwwsplat 14, 124(9) # encoding: [0x11,0xc9,0xfb,0x19]
+# CHECK-LE: evlwwsplat 14, 124(9) # encoding: [0x19,0xfb,0xc9,0x11]
+ evlwwsplat %r14, 124(%r9)
+# CHECK-BE: evlwhsplat 14, 0(27) # encoding: [0x11,0xdb,0x03,0x1d]
+# CHECK-LE: evlwhsplat 14, 0(27) # encoding: [0x1d,0x03,0xdb,0x11]
+ evlwhsplat %r14, 0(%r27)
+# CHECK-BE: evlwhsplat 14, 124(27) # encoding: [0x11,0xdb,0xfb,0x1d]
+# CHECK-LE: evlwhsplat 14, 124(27) # encoding: [0x1d,0xfb,0xdb,0x11]
+ evlwhsplat %r14, 124(%r27)
+# CHECK-BE: evlwhsplat 14, 124(9) # encoding: [0x11,0xc9,0xfb,0x1d]
+# CHECK-LE: evlwhsplat 14, 124(9) # encoding: [0x1d,0xfb,0xc9,0x11]
+ evlwhsplat %r14, 124(%r9)
+# CHECK-BE: evstdd 14, 0(27) # encoding: [0x11,0xdb,0x03,0x21]
+# CHECK-LE: evstdd 14, 0(27) # encoding: [0x21,0x03,0xdb,0x11]
+ evstdd %r14, 0(%r27)
+# CHECK-BE: evstdd 14, 248(27) # encoding: [0x11,0xdb,0xfb,0x21]
+# CHECK-LE: evstdd 14, 248(27) # encoding: [0x21,0xfb,0xdb,0x11]
+ evstdd %r14, 248(%r27)
+# CHECK-BE: evstdd 14, 248(9) # encoding: [0x11,0xc9,0xfb,0x21]
+# CHECK-LE: evstdd 14, 248(9) # encoding: [0x21,0xfb,0xc9,0x11]
+ evstdd %r14, 248(%r9)
+# CHECK-BE: evstdh 14, 0(27) # encoding: [0x11,0xdb,0x03,0x25]
+# CHECK-LE: evstdh 14, 0(27) # encoding: [0x25,0x03,0xdb,0x11]
+ evstdh %r14, 0(%r27)
+# CHECK-BE: evstdh 14, 248(27) # encoding: [0x11,0xdb,0xfb,0x25]
+# CHECK-LE: evstdh 14, 248(27) # encoding: [0x25,0xfb,0xdb,0x11]
+ evstdh %r14, 248(%r27)
+# CHECK-BE: evstdh 14, 248(9) # encoding: [0x11,0xc9,0xfb,0x25]
+# CHECK-LE: evstdh 14, 248(9) # encoding: [0x25,0xfb,0xc9,0x11]
+ evstdh %r14, 248(%r9)
+# CHECK-BE: evstdw 14, 0(27) # encoding: [0x11,0xdb,0x03,0x23]
+# CHECK-LE: evstdw 14, 0(27) # encoding: [0x23,0x03,0xdb,0x11]
+ evstdw %r14, 0(%r27)
+# CHECK-BE: evstdw 14, 248(27) # encoding: [0x11,0xdb,0xfb,0x23]
+# CHECK-LE: evstdw 14, 248(27) # encoding: [0x23,0xfb,0xdb,0x11]
+ evstdw %r14, 248(%r27)
+# CHECK-BE: evstdw 14, 248(9) # encoding: [0x11,0xc9,0xfb,0x23]
+# CHECK-LE: evstdw 14, 248(9) # encoding: [0x23,0xfb,0xc9,0x11]
+ evstdw %r14, 248(%r9)
+# CHECK-BE: evstwhe 14, 0(27) # encoding: [0x11,0xdb,0x03,0x31]
+# CHECK-LE: evstwhe 14, 0(27) # encoding: [0x31,0x03,0xdb,0x11]
+ evstwhe %r14, 0(%r27)
+# CHECK-BE: evstwhe 14, 124(27) # encoding: [0x11,0xdb,0xfb,0x31]
+# CHECK-LE: evstwhe 14, 124(27) # encoding: [0x31,0xfb,0xdb,0x11]
+ evstwhe %r14, 124(%r27)
+# CHECK-BE: evstwhe 14, 124(9) # encoding: [0x11,0xc9,0xfb,0x31]
+# CHECK-LE: evstwhe 14, 124(9) # encoding: [0x31,0xfb,0xc9,0x11]
+ evstwhe %r14, 124(%r9)
+# CHECK-BE: evstwho 14, 0(27) # encoding: [0x11,0xdb,0x03,0x35]
+# CHECK-LE: evstwho 14, 0(27) # encoding: [0x35,0x03,0xdb,0x11]
+ evstwho %r14, 0(%r27)
+# CHECK-BE: evstwho 14, 124(27) # encoding: [0x11,0xdb,0xfb,0x35]
+# CHECK-LE: evstwho 14, 124(27) # encoding: [0x35,0xfb,0xdb,0x11]
+ evstwho %r14, 124(%r27)
+# CHECK-BE: evstwho 14, 124(9) # encoding: [0x11,0xc9,0xfb,0x35]
+# CHECK-LE: evstwho 14, 124(9) # encoding: [0x35,0xfb,0xc9,0x11]
+ evstwho %r14, 124(%r9)
+# CHECK-BE: evstwwe 14, 0(27) # encoding: [0x11,0xdb,0x03,0x39]
+# CHECK-LE: evstwwe 14, 0(27) # encoding: [0x39,0x03,0xdb,0x11]
+ evstwwe %r14, 0(%r27)
+# CHECK-BE: evstwwe 14, 124(27) # encoding: [0x11,0xdb,0xfb,0x39]
+# CHECK-LE: evstwwe 14, 124(27) # encoding: [0x39,0xfb,0xdb,0x11]
+ evstwwe %r14, 124(%r27)
+# CHECK-BE: evstwwe 14, 124(9) # encoding: [0x11,0xc9,0xfb,0x39]
+# CHECK-LE: evstwwe 14, 124(9) # encoding: [0x39,0xfb,0xc9,0x11]
+ evstwwe %r14, 124(%r9)
+# CHECK-BE: evstwwo 14, 0(27) # encoding: [0x11,0xdb,0x03,0x3d]
+# CHECK-LE: evstwwo 14, 0(27) # encoding: [0x3d,0x03,0xdb,0x11]
+ evstwwo %r14, 0(%r27)
+# CHECK-BE: evstwwo 14, 124(27) # encoding: [0x11,0xdb,0xfb,0x3d]
+# CHECK-LE: evstwwo 14, 124(27) # encoding: [0x3d,0xfb,0xdb,0x11]
+ evstwwo %r14, 124(%r27)
+# CHECK-BE: evstwwo 14, 124(9) # encoding: [0x11,0xc9,0xfb,0x3d]
+# CHECK-LE: evstwwo 14, 124(9) # encoding: [0x3d,0xfb,0xc9,0x11]
+ evstwwo %r14, 124(%r9)