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 @@ -634,9 +634,7 @@ // Special RR multiclass for 128 bits shift left instruction. // e.g. SLD let Constraints = "$hi = $sx", DisableEncoding = "$hi", hasSideEffects = 0 in -multiclass RRILDmopc, - RegisterClass RC, ValueType Ty, - SDPatternOperator OpNode = null_frag> { +multiclass RRILDmopc, RegisterClass RC> { def rrr : RR; let cz = 0 in @@ -653,9 +651,7 @@ // Special RR multiclass for 128 bits shift right instruction. // e.g. SRD let Constraints = "$low = $sx", DisableEncoding = "$low", hasSideEffects = 0 in -multiclass RRIRDmopc, - RegisterClass RC, ValueType Ty, - SDPatternOperator OpNode = null_frag> { +multiclass RRIRDmopc, RegisterClass RC> { def rrr : RR; let cz = 0 in @@ -685,7 +681,7 @@ // Special RR multiclass for MRG instruction. // e.g. MRG let Constraints = "$sx = $sd", DisableEncoding = "$sd", hasSideEffects = 0 in -multiclass RRMRGmopc, RegisterClass RC, ValueType Ty> { +multiclass RRMRGmopc, RegisterClass RC> { def rr : RR; let cy = 0 in @@ -719,7 +715,7 @@ // e.g. CMOVL, CMOVW, CMOVD, and etc. let Constraints = "$sx = $sd", DisableEncoding = "$sd", hasSideEffects = 0, cfw = ? in -multiclass RRCMOVmopc, RegisterClass RC, ValueType Ty> { +multiclass RRCMOVmopc, RegisterClass RC> { def rr : RR; let cy = 0 in @@ -740,8 +736,8 @@ // e.g. CVTWDSX, CVTWDZX, CVTWSSX, and etc. // sz{3-0} = rounding mode let cz = 0, hasSideEffects = 0 in -multiclass CVTRDm opc, RegisterClass RCo, ValueType Tyo, - RegisterClass RCi, ValueType Tyi> { +multiclass CVTRDm opc, RegisterClass RCo, + RegisterClass RCi> { def r : RR { bits<4> rd; @@ -1265,7 +1261,7 @@ defm NND : RRNCm<"nnd", 0x54, I64, i64, and_not>; // Section 8.5.6 - MRG (Merge) -defm MRG : RRMRGm<"mrg", 0x56, I64, i64>; +defm MRG : RRMRGm<"mrg", 0x56, I64>; // Section 8.5.7 - LDZ (Leading Zero Count) def ctlz_pat : PatFrags<(ops node:$src), @@ -1297,10 +1293,10 @@ (EXTRACT_SUBREG (BSWPmi (MIMM $src), 1), sub_i32)>; // Section 8.5.11 - CMOV (Conditional Move) -let cw = 0, cw2 = 0 in defm CMOVL : RRCMOVm<"cmov.l.${cfw}", 0x3B, I64, i64>; -let cw = 1, cw2 = 0 in defm CMOVW : RRCMOVm<"cmov.w.${cfw}", 0x3B, I32, i32>; -let cw = 0, cw2 = 1 in defm CMOVD : RRCMOVm<"cmov.d.${cfw}", 0x3B, I64, f64>; -let cw = 1, cw2 = 1 in defm CMOVS : RRCMOVm<"cmov.s.${cfw}", 0x3B, F32, f32>; +let cw = 0, cw2 = 0 in defm CMOVL : RRCMOVm<"cmov.l.${cfw}", 0x3B, I64>; +let cw = 1, cw2 = 0 in defm CMOVW : RRCMOVm<"cmov.w.${cfw}", 0x3B, I32>; +let cw = 0, cw2 = 1 in defm CMOVD : RRCMOVm<"cmov.d.${cfw}", 0x3B, I64>; +let cw = 1, cw2 = 1 in defm CMOVS : RRCMOVm<"cmov.s.${cfw}", 0x3B, F32>; def : MnemonicAlias<"cmov.l", "cmov.l.at">; def : MnemonicAlias<"cmov.w", "cmov.w.at">; def : MnemonicAlias<"cmov.d", "cmov.d.at">; @@ -1315,14 +1311,14 @@ defm SLL : RRIm<"sll", 0x65, I64, i64, shl>; // Section 8.6.2 - SLD (Shift Left Double) -defm SLD : RRILDm<"sld", 0x64, I64, i64>; +defm SLD : RRILDm<"sld", 0x64, I64>; // Section 8.6.3 - SRL (Shift Right Logical) let isReMaterializable = 1, isAsCheapAsAMove = 1 in defm SRL : RRIm<"srl", 0x75, I64, i64, srl>; // Section 8.6.4 - SRD (Shift Right Double) -defm SRD : RRIRDm<"srd", 0x74, I64, i64>; +defm SRD : RRIRDm<"srd", 0x74, I64>; let isReMaterializable = 1, isAsCheapAsAMove = 1 in { @@ -1405,16 +1401,16 @@ // Section 8.7.11 - FIX (Convert to Fixed Point) // cx: double/float, cw: sx/zx, sz{0-3} = round let cx = 0, cw = 0 /* sign extend */ in -defm CVTWDSX : CVTRDm<"cvt.w.d.sx", 0x4E, I32, i32, I64, f64>; +defm CVTWDSX : CVTRDm<"cvt.w.d.sx", 0x4E, I32, I64>; let cx = 0, cw = 1 /* zero extend */ in -defm CVTWDZX : CVTRDm<"cvt.w.d.zx", 0x4E, I32, i32, I64, f64>; +defm CVTWDZX : CVTRDm<"cvt.w.d.zx", 0x4E, I32, I64>; let cx = 1, cw = 0 /* sign extend */ in -defm CVTWSSX : CVTRDm<"cvt.w.s.sx", 0x4E, I32, i32, F32, f32>; +defm CVTWSSX : CVTRDm<"cvt.w.s.sx", 0x4E, I32, F32>; let cx = 1, cw = 1 /* zero extend */ in -defm CVTWSZX : CVTRDm<"cvt.w.s.zx", 0x4E, I32, i32, F32, f32>; +defm CVTWSZX : CVTRDm<"cvt.w.s.zx", 0x4E, I32, F32>; // Section 8.7.12 - FIXX (Convert to Fixed Point) -defm CVTLD : CVTRDm<"cvt.l.d", 0x4F, I64, i64, I64, f64>; +defm CVTLD : CVTRDm<"cvt.l.d", 0x4F, I64, I64>; // Section 8.7.13 - FLT (Convert to Floating Point) defm CVTDW : CVTm<"cvt.d.w", 0x5E, I64, f64, I32, i32, sint_to_fp>; @@ -1836,7 +1832,7 @@ def : Pat<(i64 (and (anyext (from ADDRzii:$addr)), VAL)), (i2l (tozii MEMzii:$addr))>; } -multiclass ZXATMLD32m { def : Pat<(i64 (zext (from ADDRrri:$addr))), @@ -1852,8 +1848,7 @@ LD1BZXzii>; defm : ZXATMLDm; -defm : ZXATMLD32m; +defm : ZXATMLD32m; // Atomic stores multiclass ATMSTm; } -defm : TRATMSTm; -defm : TRATMSTm; -defm : TRATMSTm; +defm : TRATMSTm; +defm : TRATMSTm; +defm : TRATMSTm; // Atomic swaps def : Pat<(i32 (ts1am i64:$src, i32:$flag, i32:$new)), diff --git a/llvm/lib/Target/VE/VVPInstrPatternsVec.td b/llvm/lib/Target/VE/VVPInstrPatternsVec.td --- a/llvm/lib/Target/VE/VVPInstrPatternsVec.td +++ b/llvm/lib/Target/VE/VVPInstrPatternsVec.td @@ -20,8 +20,7 @@ multiclass VectorBinaryArith< SDPatternOperator OpNode, ValueType ScalarVT, ValueType DataVT, ValueType MaskVT, - string OpBaseName, - SDPatternOperator ImmOp, SDNodeXForm ImmCast> { + string OpBaseName> { // No mask. def : Pat<(OpNode (any_broadcast ScalarVT:$sx), @@ -56,10 +55,10 @@ ValueType ShortScalarVT, ValueType ShortDataVT, string ShortOpBaseName> { defm : VectorBinaryArith; + LongOpBaseName>; defm : VectorBinaryArith; + ShortOpBaseName>; }