diff --git a/llvm/lib/Target/PowerPC/PPCInstrP10.td b/llvm/lib/Target/PowerPC/PPCInstrP10.td --- a/llvm/lib/Target/PowerPC/PPCInstrP10.td +++ b/llvm/lib/Target/PowerPC/PPCInstrP10.td @@ -1752,21 +1752,21 @@ v2i64:$VB))]>; def XVTLSBB : XX2_BF3_XO5_XB6_XO9<60, 2, 475, (outs crrc:$BF), (ins vsrc:$XB), "xvtlsbb $BF, $XB", IIC_VecGeneral, []>; - def BRH : XForm_11<31, 219, (outs gprc:$RA), (ins gprc:$RS), - "brh $RA, $RS", IIC_IntRotate, - [(set i32:$RA, (srl (bswap i32:$RS), (i32 16)))]>; - def BRW : XForm_11<31, 155, (outs gprc:$RA), (ins gprc:$RS), - "brw $RA, $RS", IIC_IntRotate, - [(set i32:$RA, (bswap i32:$RS))]>; + def BRH : XForm_11<31, 219, (outs gprc:$RA), (ins gprc:$RST), + "brh $RA, $RST", IIC_IntRotate, + [(set i32:$RA, (srl (bswap i32:$RST), (i32 16)))]>; + def BRW : XForm_11<31, 155, (outs gprc:$RA), (ins gprc:$RST), + "brw $RA, $RST", IIC_IntRotate, + [(set i32:$RA, (bswap i32:$RST))]>; let isCodeGenOnly = 1 in { - def BRH8 : XForm_11<31, 219, (outs g8rc:$RA), (ins g8rc:$RS), - "brh $RA, $RS", IIC_IntRotate, []>; - def BRW8 : XForm_11<31, 155, (outs g8rc:$RA), (ins g8rc:$RS), - "brw $RA, $RS", IIC_IntRotate, []>; + def BRH8 : XForm_11<31, 219, (outs g8rc:$RA), (ins g8rc:$RST), + "brh $RA, $RST", IIC_IntRotate, []>; + def BRW8 : XForm_11<31, 155, (outs g8rc:$RA), (ins g8rc:$RST), + "brw $RA, $RST", IIC_IntRotate, []>; } - def BRD : XForm_11<31, 187, (outs g8rc:$RA), (ins g8rc:$RS), - "brd $RA, $RS", IIC_IntRotate, - [(set i64:$RA, (bswap i64:$RS))]>; + def BRD : XForm_11<31, 187, (outs g8rc:$RA), (ins g8rc:$RST), + "brd $RA, $RST", IIC_IntRotate, + [(set i64:$RA, (bswap i64:$RST))]>; // The XFormMemOp flag for the following 8 instructions is set on // the instruction format. diff --git a/llvm/lib/Target/VE/VE.td b/llvm/lib/Target/VE/VE.td --- a/llvm/lib/Target/VE/VE.td +++ b/llvm/lib/Target/VE/VE.td @@ -30,9 +30,7 @@ include "VECallingConv.td" include "VEInstrInfo.td" -def VEInstrInfo : InstrInfo { - let useDeprecatedPositionallyEncodedOperands = 1; -} +def VEInstrInfo : InstrInfo {} def VEAsmParser : AsmParser { // Use both VE register name matcher to accept "S0~S63" register names diff --git a/llvm/lib/Target/VE/VEInstrFormats.td b/llvm/lib/Target/VE/VEInstrFormats.td --- a/llvm/lib/Target/VE/VEInstrFormats.td +++ b/llvm/lib/Target/VE/VEInstrFormats.td @@ -117,7 +117,7 @@ bits<1> cx = 0; bits<1> cx2 = 0; bits<2> bpf = 0; - bits<4> cf; + bits<4> cond; bits<1> cy = 1; bits<7> sy; bits<1> cz = 1; @@ -127,7 +127,7 @@ let Inst{55} = cx; let Inst{54} = cx2; let Inst{53-52} = bpf; - let Inst{51-48} = cf; + let Inst{51-48} = cond; let Inst{47} = cy; let Inst{46-40} = sy; let Inst{39} = cz; diff --git a/llvm/lib/Target/VE/VEInstrInfo.td b/llvm/lib/Target/VE/VEInstrInfo.td --- a/llvm/lib/Target/VE/VEInstrInfo.td +++ b/llvm/lib/Target/VE/VEInstrInfo.td @@ -760,14 +760,14 @@ def r : RR { bits<4> rd; - let sz{5-4} = 0; + let sz{6-4} = 0; let sz{3-0} = rd; } let cy = 0 in def i : RR { bits<4> rd; - let sz{5-4} = 0; + let sz{6-4} = 0; let sz{3-0} = rd; } } @@ -790,33 +790,33 @@ // e.g. PFCH let sx = 0, hasSideEffects = 0 in multiclass PFCHmopc> { - def rri : RM; let cy = 0 in - def rii : RM; let cz = 0 in - def zri : RM; let cy = 0, cz = 0 in - def zii : RM; } // Multiclass for CAS instructions. // e.g. TS1AML, TS1AMW, TS2AM, and etc. -let Constraints = "$dest = $sd", DisableEncoding = "$sd", +let Constraints = "$sx = $sd", DisableEncoding = "$sd", mayStore=1, mayLoad = 1, hasSideEffects = 0 in multiclass RRCAStgmopc, RegisterClass RC, ValueType Ty, Operand immOp, Operand MEM, ComplexPattern ADDR, SDPatternOperator OpNode = null_frag> { - def r : RRM; + def r : RRM; let cy = 0 in - def i : RRM; + def i : RRM; } multiclass RRCASmopc, RegisterClass RC, ValueType Ty, Operand immOp, SDPatternOperator OpNode = null_frag> { @@ -831,13 +831,13 @@ multiclass BCbpfm opc, dag cond, Operand ADDR> { let bpf = 0 /* NONE */ in - def "" : CF; let bpf = 2 /* NOT TAKEN */ in - def _nt : CF; let bpf = 3 /* TAKEN */ in - def _t : CF; } multiclass BCtgm opc, dag cond> { @@ -847,14 +847,14 @@ multiclass BCm opc, RegisterClass RC, Operand immOp> { let DecoderMethod = "DecodeBranchCondition" in - defm r : BCtgm; + defm r : BCtgm; let DecoderMethod = "DecodeBranchCondition", cy = 0 in - defm i : BCtgm; + defm i : BCtgm; let DecoderMethod = "DecodeBranchConditionAlways", cy = 0, sy = 0, - cf = 15 /* AT */, isBarrier = 1 in + cond = 15 /* AT */, isBarrier = 1 in defm a : BCtgm; let DecoderMethod = "DecodeBranchConditionAlways", cy = 0, sy = 0, - cf = 0 /* AF */ in + cond = 0 /* AF */ in defm na : BCtgm; } @@ -874,19 +874,19 @@ } multiclass BCRm opc, RegisterClass RC, Operand immOp, Operand zeroOp> { - defm rr : BCRbpfm; + defm rr : BCRbpfm; let cy = 0 in - defm ir : BCRbpfm; let cz = 0 in - defm rz : BCRbpfm; let cy = 0, cz = 0 in - defm iz : BCRbpfm; - let cy = 0, sy = 0, cz = 0, sz = 0, cf = 15 /* AT */, isBarrier = 1 in + let cy = 0, sy = 0, cz = 0, sz = 0, cond = 15 /* AT */, isBarrier = 1 in defm a : BCRbpfm; - let cy = 0, sy = 0, cz = 0, sz = 0, cf = 0 /* AF */ in + let cy = 0, sy = 0, cz = 0, sz = 0, cond = 0 /* AF */ in defm na : BCRbpfm; } @@ -947,20 +947,20 @@ // Multiclass for LHM instruction. let mayLoad = 1, hasSideEffects = 0 in multiclass LHMm opc, RegisterClass RC> { - def ri : RRMHM; + def ri : RRMHM; let cz = 0 in - def zi : RRMHM; + def zi : RRMHM; } // Multiclass for SHM instruction. let mayStore = 1, hasSideEffects = 0 in multiclass SHMm opc, RegisterClass RC> { - def ri : RRMHM; let cz = 0 in - def zi : RRMHM; } @@ -978,17 +978,17 @@ // Multiclass for generic RM instructions multiclass RMmopc, RegisterClass RC, bit MoveImm = 0> { - def rri : RM; + def rri : RM; let cy = 0 in - def rii : RM; + def rii : RM; let cz = 0 in - def zri : RM; + def zri : RM; let cy = 0, cz = 0 in - def zii : RM { + def zii : RM { // VE uses LEAzii and LEASLzii as a move immediate instruction, so declare // it here. An instruction declared as MoveImm will be optimized in // FoldImmediate later. @@ -1014,21 +1014,21 @@ let mayLoad = 1, hasSideEffects = 0 in multiclass LOADm opc, RegisterClass RC, ValueType Ty, SDPatternOperator OpNode = null_frag> { - def rri : RM; + def rri : RM; let cy = 0 in - def rii : RM; + def rii : RM; let cz = 0 in - def zri : RM; + def zri : RM; let cy = 0, cz = 0 in - def zii : RM; + def zii : RM; } // Section 8.2.2 - LDS @@ -1072,19 +1072,19 @@ let mayStore = 1 in multiclass STOREm opc, RegisterClass RC, ValueType Ty, SDPatternOperator OpNode = null_frag> { - def rri : RM; let cy = 0 in - def rii : RM; let cz = 0 in - def zri : RM; let cy = 0, cz = 0 in - def zii : RM; } @@ -1463,7 +1463,7 @@ def : Pat<(brind tblockaddress:$imm), (BCFLazi_t 0, $imm)>; // Return instruction is a special case of jump. -let Uses = [SX10], bpf = 3 /* TAKEN */, cf = 15 /* AT */, cy = 0, sy = 0, +let Uses = [SX10], bpf = 3 /* TAKEN */, cond = 15 /* AT */, cy = 0, sy = 0, sz = 10 /* SX10 */, imm32 = 0, isReturn = 1, isTerminator = 1, isBarrier = 1, isCodeGenOnly = 1, hasSideEffects = 0 in def RET : CF<0x19, (outs), (ins), "b.l.t (, %s10)", [(retflag)]>; @@ -1478,13 +1478,13 @@ // Section 8.8.4 - BCR (Branch on Condition Relative) let cx = 0, cx2 = 0 in -defm BRCFL : BCRm<"br${cf}.l", "br.l", "braf.l", 0x18, I64, simm7, zero>; +defm BRCFL : BCRm<"br${cond}.l", "br.l", "braf.l", 0x18, I64, simm7, zero>; let cx = 1, cx2 = 0 in -defm BRCFW : BCRm<"br${cf}.w", "br.w", "braf.w", 0x18, I32, simm7, zero>; +defm BRCFW : BCRm<"br${cond}.w", "br.w", "braf.w", 0x18, I32, simm7, zero>; let cx = 0, cx2 = 1 in -defm BRCFD : BCRm<"br${cf}.d", "br.d", "braf.d", 0x18, I64, simm7fp, zerofp>; +defm BRCFD : BCRm<"br${cond}.d", "br.d", "braf.d", 0x18, I64, simm7fp, zerofp>; let cx = 1, cx2 = 1 in -defm BRCFS : BCRm<"br${cf}.s", "br.s", "braf.s", 0x18, F32, simm7fp, zerofp>; +defm BRCFS : BCRm<"br${cond}.s", "br.s", "braf.s", 0x18, F32, simm7fp, zerofp>; // Section 8.8.5 - BSIC (Branch and Save IC) let isCall = 1, hasSideEffects = 0, DecoderMethod = "DecodeCall" in