1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-21 18:22:53 +01:00

[PowerPC]Add addex instruction definition and MC tests

Add td definitions and asm/disasm tests for the addex instruction introduced in
ISA 3.0.

Reviewed By: nemanjai, amyk, NeHuang

Differential Revision: https://reviews.llvm.org/D106666
This commit is contained in:
Lei Huang 2021-07-23 09:27:16 -05:00
parent 4f1b8e266e
commit bbc51b9f17
6 changed files with 33 additions and 1 deletions

View File

@ -1429,5 +1429,6 @@ def : InstRW<[],
DCBA,
DCBI,
DCCCI,
ICCCI
ICCCI,
ADDEX
)> { let Unsupported = 1; }

View File

@ -2141,6 +2141,24 @@ class Z23Form_8<bits<6> opcode, bits<8> xo, dag OOL, dag IOL, string asmstr,
let Inst{31} = RC;
}
class Z23Form_RTAB5_CY2<bits<6> opcode, bits<8> xo, dag OOL, dag IOL,
string asmstr, InstrItinClass itin, list<dag> pattern>
: I<opcode, OOL, IOL, asmstr, itin> {
bits<5> RT;
bits<5> RA;
bits<5> RB;
bits<2> CY;
let Pattern = pattern;
let Inst{6-10} = RT;
let Inst{11-15} = RA;
let Inst{16-20} = RB;
let Inst{21-22} = CY;
let Inst{23-30} = xo;
let Inst{31} = 0;
}
//===----------------------------------------------------------------------===//
// EmitTimePseudo won't have encoding information for the [MC]CodeEmitter
// stuff

View File

@ -3155,6 +3155,10 @@ def MODSW : XForm_8<31, 779, (outs gprc:$rT), (ins gprc:$rA, gprc:$rB),
def MODUW : XForm_8<31, 267, (outs gprc:$rT), (ins gprc:$rA, gprc:$rB),
"moduw $rT, $rA, $rB", IIC_IntDivW,
[(set i32:$rT, (urem i32:$rA, i32:$rB))]>;
let hasSideEffects = 1 in
def ADDEX : Z23Form_RTAB5_CY2<31, 170, (outs gprc:$rT),
(ins gprc:$rA, gprc:$rB, u2imm:$CY),
"addex $rT, $rA, $rB, $CY", IIC_IntGeneral, []>;
}
let PPC970_Unit = 1, hasSideEffects = 0 in { // FXU Operations.

View File

@ -484,6 +484,9 @@
# CHECK: modsw 2, 3, 4
0x7c 0x43 0x26 0x16
# CHECK: addex 2, 4, 5, 0
0x7C 0x44 0x29 0x54
# CHECK: moduw 2, 3, 4
0x7c 0x43 0x22 0x16

View File

@ -448,6 +448,9 @@
# CHECK: modsw 2, 3, 4
0x16 0x26 0x43 0x7c
# CHECK: addex 2, 4, 5, 0
0x54 0x29 0x44 0x7C
# CHECK: moduw 2, 3, 4
0x16 0x22 0x43 0x7c

View File

@ -416,6 +416,9 @@
# CHECK-BE: addeo. 2, 3, 4 # encoding: [0x7c,0x43,0x25,0x15]
# CHECK-LE: addeo. 2, 3, 4 # encoding: [0x15,0x25,0x43,0x7c]
addeo. 2, 3, 4
# CHECK-BE: addex 2, 4, 5, 0 # encoding: [0x7c,0x44,0x29,0x54]
# CHECK-LE: addex 2, 4, 5, 0 # encoding: [0x54,0x29,0x44,0x7c]
addex 2, 4, 5, 0
# CHECK-BE: subfe 2, 3, 4 # encoding: [0x7c,0x43,0x21,0x10]
# CHECK-LE: subfe 2, 3, 4 # encoding: [0x10,0x21,0x43,0x7c]
subfe 2, 3, 4