diff --git a/llvm/lib/Target/NVPTX/NVPTXVector.td b/llvm/lib/Target/NVPTX/NVPTXVector.td deleted file mode 100644 index e69bbba9f193..000000000000 --- a/llvm/lib/Target/NVPTX/NVPTXVector.td +++ /dev/null @@ -1,1479 +0,0 @@ -//===- NVPTXVector.td - NVPTX Vector Specific Instruction defs -*- tblgen-*-==// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -//----------------------------------- -// Vector Specific -//----------------------------------- - -// -// All vector instructions derive from NVPTXVecInst -// - -class NVPTXVecInst pattern, - NVPTXInst sInst=NOP> - : NVPTXInst { - NVPTXInst scalarInst=sInst; -} - -let isAsCheapAsAMove=1, VecInstType=isVecExtract.Value in { -// Extract v2i16 -def V2i16Extract : NVPTXVecInst<(outs Int16Regs:$dst), - (ins V2I16Regs:$src, i8imm:$c), - "mov.u16 \t$dst, $src${c:vecelem};", - [(set Int16Regs:$dst, (extractelt - (v2i16 V2I16Regs:$src), imm:$c))], - IMOV16rr>; - -// Extract v4i16 -def V4i16Extract : NVPTXVecInst<(outs Int16Regs:$dst), - (ins V4I16Regs:$src, i8imm:$c), - "mov.u16 \t$dst, $src${c:vecelem};", - [(set Int16Regs:$dst, (extractelt - (v4i16 V4I16Regs:$src), imm:$c))], - IMOV16rr>; - -// Extract v2i8 -def V2i8Extract : NVPTXVecInst<(outs Int8Regs:$dst), - (ins V2I8Regs:$src, i8imm:$c), - "mov.u16 \t$dst, $src${c:vecelem};", - [(set Int8Regs:$dst, (extractelt - (v2i8 V2I8Regs:$src), imm:$c))], - IMOV8rr>; - -// Extract v4i8 -def V4i8Extract : NVPTXVecInst<(outs Int8Regs:$dst), - (ins V4I8Regs:$src, i8imm:$c), - "mov.u16 \t$dst, $src${c:vecelem};", - [(set Int8Regs:$dst, (extractelt - (v4i8 V4I8Regs:$src), imm:$c))], - IMOV8rr>; - -// Extract v2i32 -def V2i32Extract : NVPTXVecInst<(outs Int32Regs:$dst), - (ins V2I32Regs:$src, i8imm:$c), - "mov.u32 \t$dst, $src${c:vecelem};", - [(set Int32Regs:$dst, (extractelt - (v2i32 V2I32Regs:$src), imm:$c))], - IMOV32rr>; - -// Extract v2f32 -def V2f32Extract : NVPTXVecInst<(outs Float32Regs:$dst), - (ins V2F32Regs:$src, i8imm:$c), - "mov.f32 \t$dst, $src${c:vecelem};", - [(set Float32Regs:$dst, (extractelt - (v2f32 V2F32Regs:$src), imm:$c))], - FMOV32rr>; - -// Extract v2i64 -def V2i64Extract : NVPTXVecInst<(outs Int64Regs:$dst), - (ins V2I64Regs:$src, i8imm:$c), - "mov.u64 \t$dst, $src${c:vecelem};", - [(set Int64Regs:$dst, (extractelt - (v2i64 V2I64Regs:$src), imm:$c))], - IMOV64rr>; - -// Extract v2f64 -def V2f64Extract : NVPTXVecInst<(outs Float64Regs:$dst), - (ins V2F64Regs:$src, i8imm:$c), - "mov.f64 \t$dst, $src${c:vecelem};", - [(set Float64Regs:$dst, (extractelt - (v2f64 V2F64Regs:$src), imm:$c))], - FMOV64rr>; - -// Extract v4i32 -def V4i32Extract : NVPTXVecInst<(outs Int32Regs:$dst), - (ins V4I32Regs:$src, i8imm:$c), - "mov.u32 \t$dst, $src${c:vecelem};", - [(set Int32Regs:$dst, (extractelt - (v4i32 V4I32Regs:$src), imm:$c))], - IMOV32rr>; - -// Extract v4f32 -def V4f32Extract : NVPTXVecInst<(outs Float32Regs:$dst), - (ins V4F32Regs:$src, i8imm:$c), - "mov.f32 \t$dst, $src${c:vecelem};", - [(set Float32Regs:$dst, (extractelt - (v4f32 V4F32Regs:$src), imm:$c))], - FMOV32rr>; -} - -let isAsCheapAsAMove=1, VecInstType=isVecInsert.Value in { -// Insert v2i8 -def V2i8Insert : NVPTXVecInst<(outs V2I8Regs:$dst), - (ins V2I8Regs:$src, Int8Regs:$val, i8imm:$c), - "mov.v2.u16 \t${dst:vecfull}, ${src:vecfull};" - "\n\tmov.u16 \t$dst${c:vecelem}, $val;", - [(set V2I8Regs:$dst, - (insertelt V2I8Regs:$src, Int8Regs:$val, imm:$c))], IMOV8rr>; - -// Insert v4i8 -def V4i8Insert : NVPTXVecInst<(outs V4I8Regs:$dst), - (ins V4I8Regs:$src, Int8Regs:$val, i8imm:$c), - "mov.v4.u16 \t${dst:vecfull}, ${src:vecfull};" - "\n\tmov.u16 \t$dst${c:vecelem}, $val;", - [(set V4I8Regs:$dst, - (insertelt V4I8Regs:$src, Int8Regs:$val, imm:$c))], IMOV8rr>; - -// Insert v2i16 -def V2i16Insert : NVPTXVecInst<(outs V2I16Regs:$dst), - (ins V2I16Regs:$src, Int16Regs:$val, i8imm:$c), - "mov.v2.u16 \t${dst:vecfull}, ${src:vecfull};" - "\n\tmov.u16 \t$dst${c:vecelem}, $val;", - [(set V2I16Regs:$dst, - (insertelt V2I16Regs:$src, Int16Regs:$val, imm:$c))], - IMOV16rr>; - -// Insert v4i16 -def V4i16Insert : NVPTXVecInst<(outs V4I16Regs:$dst), - (ins V4I16Regs:$src, Int16Regs:$val, i8imm:$c), - "mov.v4.u16 \t${dst:vecfull}, ${src:vecfull};" - "\n\tmov.u16 \t$dst${c:vecelem}, $val;", - [(set V4I16Regs:$dst, - (insertelt V4I16Regs:$src, Int16Regs:$val, imm:$c))], - IMOV16rr>; - -// Insert v2i32 -def V2i32Insert : NVPTXVecInst<(outs V2I32Regs:$dst), - (ins V2I32Regs:$src, Int32Regs:$val, i8imm:$c), - "mov.v2.u32 \t${dst:vecfull}, ${src:vecfull};" - "\n\tmov.u32 \t$dst${c:vecelem}, $val;", - [(set V2I32Regs:$dst, - (insertelt V2I32Regs:$src, Int32Regs:$val, imm:$c))], - IMOV32rr>; - -// Insert v2f32 -def V2f32Insert : NVPTXVecInst<(outs V2F32Regs:$dst), - (ins V2F32Regs:$src, Float32Regs:$val, i8imm:$c), - "mov.v2.f32 \t${dst:vecfull}, ${src:vecfull};" - "\n\tmov.f32 \t$dst${c:vecelem}, $val;", - [(set V2F32Regs:$dst, - (insertelt V2F32Regs:$src, Float32Regs:$val, imm:$c))], - FMOV32rr>; - -// Insert v2i64 -def V2i64Insert : NVPTXVecInst<(outs V2I64Regs:$dst), - (ins V2I64Regs:$src, Int64Regs:$val, i8imm:$c), - "mov.v2.u64 \t${dst:vecfull}, ${src:vecfull};" - "\n\tmov.u64 \t$dst${c:vecelem}, $val;", - [(set V2I64Regs:$dst, - (insertelt V2I64Regs:$src, Int64Regs:$val, imm:$c))], - IMOV64rr>; - -// Insert v2f64 -def V2f64Insert : NVPTXVecInst<(outs V2F64Regs:$dst), - (ins V2F64Regs:$src, Float64Regs:$val, i8imm:$c), - "mov.v2.f64 \t${dst:vecfull}, ${src:vecfull};" - "\n\tmov.f64 \t$dst${c:vecelem}, $val;", - [(set V2F64Regs:$dst, - (insertelt V2F64Regs:$src, Float64Regs:$val, imm:$c))], - FMOV64rr>; - -// Insert v4i32 -def V4i32Insert : NVPTXVecInst<(outs V4I32Regs:$dst), - (ins V4I32Regs:$src, Int32Regs:$val, i8imm:$c), - "mov.v4.u32 \t${dst:vecfull}, ${src:vecfull};" - "\n\tmov.u32 \t$dst${c:vecelem}, $val;", - [(set V4I32Regs:$dst, - (insertelt V4I32Regs:$src, Int32Regs:$val, imm:$c))], - IMOV32rr>; - -// Insert v4f32 -def V4f32Insert : NVPTXVecInst<(outs V4F32Regs:$dst), - (ins V4F32Regs:$src, Float32Regs:$val, i8imm:$c), - "mov.v4.f32 \t${dst:vecfull}, ${src:vecfull};" - "\n\tmov.f32 \t$dst${c:vecelem}, $val;", - [(set V4F32Regs:$dst, - (insertelt V4F32Regs:$src, Float32Regs:$val, imm:$c))], - FMOV32rr>; -} - -class BinOpAsmString { - string s = c; -} - -class V4AsmStr : BinOpAsmString< - !strconcat(!strconcat(!strconcat(!strconcat( - !strconcat(!strconcat(!strconcat( - opcode, " \t${dst}_0, ${a}_0, ${b}_0;\n\t"), - opcode), " \t${dst}_1, ${a}_1, ${b}_1;\n\t"), - opcode), " \t${dst}_2, ${a}_2, ${b}_2;\n\t"), - opcode), " \t${dst}_3, ${a}_3, ${b}_3;")>; - -class V2AsmStr : BinOpAsmString< - !strconcat(!strconcat(!strconcat( - opcode, " \t${dst}_0, ${a}_0, ${b}_0;\n\t"), - opcode), " \t${dst}_1, ${a}_1, ${b}_1;")>; - -class V4MADStr : BinOpAsmString< - !strconcat(!strconcat(!strconcat(!strconcat( - !strconcat(!strconcat(!strconcat( - opcode, " \t${dst}_0, ${a}_0, ${b}_0, ${c}_0;\n\t"), - opcode), " \t${dst}_1, ${a}_1, ${b}_1, ${c}_1;\n\t"), - opcode), " \t${dst}_2, ${a}_2, ${b}_2, ${c}_2;\n\t"), - opcode), " \t${dst}_3, ${a}_3, ${b}_3, ${c}_3;")>; - -class V2MADStr : BinOpAsmString< - !strconcat(!strconcat(!strconcat( - opcode, " \t${dst}_0, ${a}_0, ${b}_0, ${c}_0;\n\t"), - opcode), " \t${dst}_1, ${a}_1, ${b}_1, ${c}_1;")>; - -class V4UnaryStr : BinOpAsmString< - !strconcat(!strconcat(!strconcat(!strconcat( - !strconcat(!strconcat(!strconcat( - opcode, " \t${dst}_0, ${a}_0;\n\t"), - opcode), " \t${dst}_1, ${a}_1;\n\t"), - opcode), " \t${dst}_2, ${a}_2;\n\t"), - opcode), " \t${dst}_3, ${a}_3;")>; - -class V2UnaryStr : BinOpAsmString< - !strconcat(!strconcat(!strconcat( - opcode, " \t${dst}_0, ${a}_0;\n\t"), - opcode), " \t${dst}_1, ${a}_1;")>; - -class VecBinaryOp : - NVPTXVecInst<(outs regclass:$dst), (ins regclass:$a, regclass:$b), - asmstr.s, - [(set regclass:$dst, (OpNode regclass:$a, regclass:$b))], - sInst>; - -class VecShiftOp : - NVPTXVecInst<(outs regclass1:$dst), (ins regclass1:$a, regclass2:$b), - asmstr.s, - [(set regclass1:$dst, (OpNode regclass1:$a, regclass2:$b))], - sInst>; - -class VecUnaryOp : - NVPTXVecInst<(outs regclass:$dst), (ins regclass:$a), - asmstr.s, - [(set regclass:$dst, (OpNode regclass:$a))], sInst>; - -multiclass IntBinVOp { - def V2I64 : VecBinaryOp, OpNode, V2I64Regs, - i64op>; - def V4I32 : VecBinaryOp, OpNode, V4I32Regs, - i32op>; - def V2I32 : VecBinaryOp, OpNode, V2I32Regs, - i32op>; - def V4I16 : VecBinaryOp, OpNode, V4I16Regs, - i16op>; - def V2I16 : VecBinaryOp, OpNode, V2I16Regs, - i16op>; - def V4I8 : VecBinaryOp, OpNode, V4I8Regs, - i8op>; - def V2I8 : VecBinaryOp, OpNode, V2I8Regs, - i8op>; -} - -multiclass FloatBinVOp { - def V2F64 : VecBinaryOp, OpNode, - V2F64Regs, f64>; - def V4F32_ftz : VecBinaryOp, OpNode, - V4F32Regs, f32_ftz>, Requires<[doF32FTZ]>; - def V2F32_ftz : VecBinaryOp, OpNode, - V2F32Regs, f32_ftz>, Requires<[doF32FTZ]>; - def V4F32 : VecBinaryOp, OpNode, - V4F32Regs, f32>; - def V2F32 : VecBinaryOp, OpNode, - V2F32Regs, f32>; -} - -multiclass IntUnaryVOp { - def V2I64 : VecUnaryOp, OpNode, - V2I64Regs, i64op>; - def V4I32 : VecUnaryOp, OpNode, - V4I32Regs, i32op>; - def V2I32 : VecUnaryOp, OpNode, - V2I32Regs, i32op>; - def V4I16 : VecUnaryOp, OpNode, - V4I16Regs, i16op>; - def V2I16 : VecUnaryOp, OpNode, - V2I16Regs, i16op>; - def V4I8 : VecUnaryOp, OpNode, - V4I8Regs, i8op>; - def V2I8 : VecUnaryOp, OpNode, - V2I8Regs, i8op>; -} - - -// Integer Arithmetic -let VecInstType=isVecOther.Value in { -defm VAdd : IntBinVOp<"add.s", add, ADDi64rr, ADDi32rr, ADDi16rr, ADDi8rr>; -defm VSub : IntBinVOp<"sub.s", sub, SUBi64rr, SUBi32rr, SUBi16rr, SUBi8rr>; - -def AddCCV4I32 : VecBinaryOp, addc, V4I32Regs, - ADDCCi32rr>; -def AddCCV2I32 : VecBinaryOp, addc, V2I32Regs, - ADDCCi32rr>; -def SubCCV4I32 : VecBinaryOp, subc, V4I32Regs, - SUBCCi32rr>; -def SubCCV2I32 : VecBinaryOp, subc, V2I32Regs, - SUBCCi32rr>; -def AddCCCV4I32 : VecBinaryOp, adde, V4I32Regs, - ADDCCCi32rr>; -def AddCCCV2I32 : VecBinaryOp, adde, V2I32Regs, - ADDCCCi32rr>; -def SubCCCV4I32 : VecBinaryOp, sube, V4I32Regs, - SUBCCCi32rr>; -def SubCCCV2I32 : VecBinaryOp, sube, V2I32Regs, - SUBCCCi32rr>; - -def ShiftLV2I64 : VecShiftOp, shl, V2I64Regs, V2I32Regs, - SHLi64rr>; -def ShiftLV2I32 : VecShiftOp, shl, V2I32Regs, V2I32Regs, - SHLi32rr>; -def ShiftLV4I32 : VecShiftOp, shl, V4I32Regs, V4I32Regs, - SHLi32rr>; -def ShiftLV2I16 : VecShiftOp, shl, V2I16Regs, V2I32Regs, - SHLi16rr>; -def ShiftLV4I16 : VecShiftOp, shl, V4I16Regs, V4I32Regs, - SHLi16rr>; -def ShiftLV2I8 : VecShiftOp, shl, V2I8Regs, V2I32Regs, - SHLi8rr>; -def ShiftLV4I8 : VecShiftOp, shl, V4I8Regs, V4I32Regs, - SHLi8rr>; -} - -// cvt to v*i32, helpers for shift -class CVTtoVeci32 : - NVPTXVecInst<(outs outclass:$d), (ins inclass:$s), asmstr, [], sInst>; - -class VecCVTStrHelper { - string s=!strconcat(op, !strconcat("\t", - !strconcat(dest, !strconcat(", ", !strconcat(src, ";"))))); -} - -class Vec2CVTStr { - string s=!strconcat(VecCVTStrHelper.s, - !strconcat("\n\t", VecCVTStrHelper.s)); -} - -class Vec4CVTStr { - string s=!strconcat(VecCVTStrHelper.s, - !strconcat("\n\t", - !strconcat(VecCVTStrHelper.s, - !strconcat("\n\t", - !strconcat(VecCVTStrHelper.s, - !strconcat("\n\t", VecCVTStrHelper.s)))))); -} - -let VecInstType=isVecOther.Value in { -def CVTv2i8tov2i32 : CVTtoVeci32.s, Zint_extendext8to32>; -def CVTv2i16tov2i32 : CVTtoVeci32.s, Zint_extendext16to32>; -def CVTv4i8tov4i32 : CVTtoVeci32.s, Zint_extendext8to32>; -def CVTv4i16tov4i32 : CVTtoVeci32.s, Zint_extendext16to32>; -def CVTv2i64tov2i32 : CVTtoVeci32.s, TRUNC_64to32>; -} - -def : Pat<(shl V2I16Regs:$src1, V2I16Regs:$src2), - (ShiftLV2I16 V2I16Regs:$src1, (CVTv2i16tov2i32 V2I16Regs:$src2))>; -def : Pat<(shl V2I8Regs:$src1, V2I8Regs:$src2), - (ShiftLV2I8 V2I8Regs:$src1, (CVTv2i8tov2i32 V2I8Regs:$src2))>; -def : Pat<(shl V2I64Regs:$src1, V2I64Regs:$src2), - (ShiftLV2I64 V2I64Regs:$src1, (CVTv2i64tov2i32 V2I64Regs:$src2))>; - -def : Pat<(shl V4I16Regs:$src1, V4I16Regs:$src2), - (ShiftLV4I16 V4I16Regs:$src1, (CVTv4i16tov4i32 V4I16Regs:$src2))>; -def : Pat<(shl V4I8Regs:$src1, V4I8Regs:$src2), - (ShiftLV4I8 V4I8Regs:$src1, (CVTv4i8tov4i32 V4I8Regs:$src2))>; - -let VecInstType=isVecOther.Value in { -def ShiftRAV2I64 : VecShiftOp, sra, V2I64Regs, V2I32Regs, - SRAi64rr>; -def ShiftRAV2I32 : VecShiftOp, sra, V2I32Regs, V2I32Regs, - SRAi32rr>; -def ShiftRAV4I32 : VecShiftOp, sra, V4I32Regs, V4I32Regs, - SRAi32rr>; -def ShiftRAV2I16 : VecShiftOp, sra, V2I16Regs, V2I32Regs, - SRAi16rr>; -def ShiftRAV4I16 : VecShiftOp, sra, V4I16Regs, V4I32Regs, - SRAi16rr>; -def ShiftRAV2I8 : VecShiftOp, sra, V2I8Regs, V2I32Regs, - SRAi8rr>; -def ShiftRAV4I8 : VecShiftOp, sra, V4I8Regs, V4I32Regs, - SRAi8rr>; - -def ShiftRLV2I64 : VecShiftOp, srl, V2I64Regs, V2I32Regs, - SRLi64rr>; -def ShiftRLV2I32 : VecShiftOp, srl, V2I32Regs, V2I32Regs, - SRLi32rr>; -def ShiftRLV4I32 : VecShiftOp, srl, V4I32Regs, V4I32Regs, - SRLi32rr>; -def ShiftRLV2I16 : VecShiftOp, srl, V2I16Regs, V2I32Regs, - SRLi16rr>; -def ShiftRLV4I16 : VecShiftOp, srl, V4I16Regs, V4I32Regs, - SRLi16rr>; -def ShiftRLV2I8 : VecShiftOp, srl, V2I8Regs, V2I32Regs, - SRLi8rr>; -def ShiftRLV4I8 : VecShiftOp, srl, V4I8Regs, V4I32Regs, - SRLi8rr>; - -defm VMult : IntBinVOp<"mul.lo.s", mul, MULTi64rr, MULTi32rr, MULTi16rr, - MULTi8rr>; -defm VMultHS : IntBinVOp<"mul.hi.s", mulhs, MULTHSi64rr, MULTHSi32rr, - MULTHSi16rr, - MULTHSi8rr>; -defm VMultHU : IntBinVOp<"mul.hi.u", mulhu, MULTHUi64rr, MULTHUi32rr, - MULTHUi16rr, - MULTHUi8rr>; -defm VSDiv : IntBinVOp<"div.s", sdiv, SDIVi64rr, SDIVi32rr, SDIVi16rr, - SDIVi8rr>; -defm VUDiv : IntBinVOp<"div.u", udiv, UDIVi64rr, UDIVi32rr, UDIVi16rr, - UDIVi8rr>; -defm VSRem : IntBinVOp<"rem.s", srem, SREMi64rr, SREMi32rr, SREMi16rr, - SREMi8rr>; -defm VURem : IntBinVOp<"rem.u", urem, UREMi64rr, UREMi32rr, UREMi16rr, - UREMi8rr>; -} - -def : Pat<(sra V2I16Regs:$src1, V2I16Regs:$src2), - (ShiftRAV2I16 V2I16Regs:$src1, (CVTv2i16tov2i32 V2I16Regs:$src2))>; -def : Pat<(sra V2I8Regs:$src1, V2I8Regs:$src2), - (ShiftRAV2I8 V2I8Regs:$src1, (CVTv2i8tov2i32 V2I8Regs:$src2))>; -def : Pat<(sra V2I64Regs:$src1, V2I64Regs:$src2), - (ShiftRAV2I64 V2I64Regs:$src1, (CVTv2i64tov2i32 V2I64Regs:$src2))>; - -def : Pat<(sra V4I16Regs:$src1, V4I16Regs:$src2), - (ShiftRAV4I16 V4I16Regs:$src1, (CVTv4i16tov4i32 V4I16Regs:$src2))>; -def : Pat<(sra V4I8Regs:$src1, V4I8Regs:$src2), - (ShiftRAV4I8 V4I8Regs:$src1, (CVTv4i8tov4i32 V4I8Regs:$src2))>; - -def : Pat<(srl V2I16Regs:$src1, V2I16Regs:$src2), - (ShiftRLV2I16 V2I16Regs:$src1, (CVTv2i16tov2i32 V2I16Regs:$src2))>; -def : Pat<(srl V2I8Regs:$src1, V2I8Regs:$src2), - (ShiftRLV2I8 V2I8Regs:$src1, (CVTv2i8tov2i32 V2I8Regs:$src2))>; -def : Pat<(srl V2I64Regs:$src1, V2I64Regs:$src2), - (ShiftRLV2I64 V2I64Regs:$src1, (CVTv2i64tov2i32 V2I64Regs:$src2))>; - -def : Pat<(srl V4I16Regs:$src1, V4I16Regs:$src2), - (ShiftRLV4I16 V4I16Regs:$src1, (CVTv4i16tov4i32 V4I16Regs:$src2))>; -def : Pat<(srl V4I8Regs:$src1, V4I8Regs:$src2), - (ShiftRLV4I8 V4I8Regs:$src1, (CVTv4i8tov4i32 V4I8Regs:$src2))>; - -multiclass VMAD { - def V4 : NVPTXVecInst<(outs regclassv4:$dst), - (ins regclassv4:$a, regclassv4:$b, regclassv4:$c), - V4MADStr.s, - [(set regclassv4:$dst, - (an (mn regclassv4:$a, regclassv4:$b), regclassv4:$c))], - sop>, - Requires<[Pred]>; - def V2 : NVPTXVecInst<(outs regclassv2:$dst), - (ins regclassv2:$a, regclassv2:$b, regclassv2:$c), - V2MADStr.s, - [(set regclassv2:$dst, - (an (mn regclassv2:$a, regclassv2:$b), regclassv2:$c))], - sop>, - Requires<[Pred]>; -} - -multiclass VMADV2Only { - def V2 : NVPTXVecInst<(outs regclass:$dst), - (ins regclass:$a, regclass:$b, regclass:$c), - V2MADStr.s, - [(set regclass:$dst, (add - (mul regclass:$a, regclass:$b), regclass:$c))], sop>, - Requires<[Pred]>; -} -multiclass VFMADV2Only { - def V2 : NVPTXVecInst<(outs regclass:$dst), - (ins regclass:$a, regclass:$b, regclass:$c), - V2MADStr.s, - [(set regclass:$dst, (fadd - (fmul regclass:$a, regclass:$b), regclass:$c))], sop>, - Requires<[Pred]>; -} - -let VecInstType=isVecOther.Value in { -defm I8MAD : VMAD<"mad.lo.s16", V4I8Regs, V2I8Regs, add, mul, MAD8rrr, true>; -defm I16MAD : VMAD<"mad.lo.s16", V4I16Regs, V2I16Regs, add, mul, MAD16rrr, - true>; -defm I32MAD : VMAD<"mad.lo.s32", V4I32Regs, V2I32Regs, add, mul, MAD32rrr, - true>; -defm I64MAD : VMADV2Only<"mad.lo.s64", V2I64Regs, MAD64rrr, true>; - -defm VNeg : IntUnaryVOp<"neg.s", ineg, INEG64, INEG32, INEG16, INEG8>; - -defm VAddf : FloatBinVOp<"add.", fadd, FADDf64rr, FADDf32rr, FADDf32rr_ftz>; -defm VSubf : FloatBinVOp<"sub.", fsub, FSUBf64rr, FSUBf32rr, FSUBf32rr_ftz>; -defm VMulf : FloatBinVOp<"mul.", fmul, FMULf64rr, FMULf32rr, FMULf32rr_ftz>; - -defm F32MAD_ftz : VMAD<"mad.ftz.f32", V4F32Regs, V2F32Regs, fadd, fmul, - FMAD32_ftzrrr, doFMADF32_ftz>; -defm F32FMA_ftz : VMAD<"fma.rn.ftz.f32", V4F32Regs, V2F32Regs, fadd, fmul, - FMA32_ftzrrr, doFMAF32_ftz>; -defm F32MAD : VMAD<"mad.f32", V4F32Regs, V2F32Regs, fadd, fmul, FMAD32rrr, - doFMADF32>; -defm F32FMA : VMAD<"fma.rn.f32", V4F32Regs, V2F32Regs, fadd, fmul, FMA32rrr, - doFMAF32>; -defm F64FMA : VFMADV2Only<"fma.rn.f64", V2F64Regs, FMA64rrr, doFMAF64>; -} - -let VecInstType=isVecOther.Value in { -def V4F32Div_prec_ftz : VecBinaryOp, fdiv, V4F32Regs, - FDIV32rr_prec_ftz>, Requires<[doF32FTZ, reqPTX20]>; -def V2F32Div_prec_ftz : VecBinaryOp, fdiv, V2F32Regs, - FDIV32rr_prec_ftz>, Requires<[doF32FTZ, reqPTX20]>; -def V4F32Div_prec : VecBinaryOp, fdiv, V4F32Regs, - FDIV32rr_prec>, Requires<[reqPTX20]>; -def V2F32Div_prec : VecBinaryOp, fdiv, V2F32Regs, - FDIV32rr_prec>, Requires<[reqPTX20]>; -def V2F32Div_ftz : VecBinaryOp, fdiv, V2F32Regs, - FDIV32rr_ftz>, Requires<[doF32FTZ]>; -def V4F32Div_ftz : VecBinaryOp, fdiv, V4F32Regs, - FDIV32rr_ftz>, Requires<[doF32FTZ]>; -def V2F32Div : VecBinaryOp, fdiv, V2F32Regs, FDIV32rr>; -def V4F32Div : VecBinaryOp, fdiv, V4F32Regs, FDIV32rr>; -def V2F64Div : VecBinaryOp, fdiv, V2F64Regs, FDIV64rr>; -} - -def fnegpat : PatFrag<(ops node:$in), (fneg node:$in)>; - -let VecInstType=isVecOther.Value in { -def VNegv2f32_ftz : VecUnaryOp, fnegpat, V2F32Regs, - FNEGf32_ftz>, Requires<[doF32FTZ]>; -def VNegv4f32_ftz : VecUnaryOp, fnegpat, V4F32Regs, - FNEGf32_ftz>, Requires<[doF32FTZ]>; -def VNegv2f32 : VecUnaryOp, fnegpat, V2F32Regs, FNEGf32>; -def VNegv4f32 : VecUnaryOp, fnegpat, V4F32Regs, FNEGf32>; -def VNegv2f64 : VecUnaryOp, fnegpat, V2F64Regs, FNEGf64>; - -// Logical Arithmetic -defm VAnd : IntBinVOp<"and.b", and, ANDb64rr, ANDb32rr, ANDb16rr, ANDb8rr>; -defm VOr : IntBinVOp<"or.b", or, ORb64rr, ORb32rr, ORb16rr, ORb8rr>; -defm VXor : IntBinVOp<"xor.b", xor, XORb64rr, XORb32rr, XORb16rr, XORb8rr>; - -defm VNot : IntUnaryVOp<"not.b", not, NOT64, NOT32, NOT16, NOT8>; -} - - -multiclass V2FPCONTRACT32_SUB_PAT { - def : Pat<(fsub V2F32Regs:$a, (fmul V2F32Regs:$b, V2F32Regs:$c)), - (Inst (VNegv2f32 V2F32Regs:$b), V2F32Regs:$c, V2F32Regs:$a)>, - Requires<[Pred]>; - - def : Pat<(fsub (fmul V2F32Regs:$a, V2F32Regs:$b), V2F32Regs:$c), - (Inst V2F32Regs:$a, V2F32Regs:$b, (VNegv2f32 V2F32Regs:$c))>, - Requires<[Pred]>; -} - -defm V2FMAF32ext_ftz : V2FPCONTRACT32_SUB_PAT; -defm V2FMADF32ext_ftz : V2FPCONTRACT32_SUB_PAT; -defm V2FMAF32ext : V2FPCONTRACT32_SUB_PAT; -defm V2FMADF32ext : V2FPCONTRACT32_SUB_PAT; - -multiclass V4FPCONTRACT32_SUB_PAT { - def : Pat<(fsub V4F32Regs:$a, (fmul V4F32Regs:$b, V4F32Regs:$c)), - (Inst (VNegv4f32 V4F32Regs:$b), V4F32Regs:$c, V4F32Regs:$a)>, - Requires<[Pred]>; - - def : Pat<(fsub (fmul V4F32Regs:$a, V4F32Regs:$b), V4F32Regs:$c), - (Inst V4F32Regs:$a, V4F32Regs:$b, (VNegv4f32 V4F32Regs:$c))>, - Requires<[Pred]>; -} - -defm V4FMAF32ext_ftz : V4FPCONTRACT32_SUB_PAT; -defm V4FMADF32ext_ftz : V4FPCONTRACT32_SUB_PAT; -defm V4FMAF32ext : V4FPCONTRACT32_SUB_PAT; -defm V4FMADF32ext : V4FPCONTRACT32_SUB_PAT; - -multiclass V2FPCONTRACT64_SUB_PAT { - def : Pat<(fsub V2F64Regs:$a, (fmul V2F64Regs:$b, V2F64Regs:$c)), - (Inst (VNegv2f64 V2F64Regs:$b), V2F64Regs:$c, V2F64Regs:$a)>, - Requires<[Pred]>; - - def : Pat<(fsub (fmul V2F64Regs:$a, V2F64Regs:$b), V2F64Regs:$c), - (Inst V2F64Regs:$a, V2F64Regs:$b, (VNegv2f64 V2F64Regs:$c))>, - Requires<[Pred]>; -} - -defm V2FMAF64ext : V2FPCONTRACT64_SUB_PAT; - -class VecModStr -{ - string t1 = !strconcat("${c", elem); - string t2 = !strconcat(t1, ":vecv"); - string t3 = !strconcat(t2, vecsize); - string t4 = !strconcat(t3, extra); - string t5 = !strconcat(t4, l); - string s = !strconcat(t5, "}"); -} -class ShuffleOneLine -{ - string t1 = VecModStr.s; - string t2 = !strconcat(t1, "mov."); - string t3 = !strconcat(t2, type); - string t4 = !strconcat(t3, " \t${dst}_"); - string t5 = !strconcat(t4, elem); - string t6 = !strconcat(t5, ", $src1"); - string t7 = !strconcat(t6, VecModStr.s); - string t8 = !strconcat(t7, ";\n\t"); - string t9 = !strconcat(t8, VecModStr.s); - string t10 = !strconcat(t9, "mov."); - string t11 = !strconcat(t10, type); - string t12 = !strconcat(t11, " \t${dst}_"); - string t13 = !strconcat(t12, elem); - string t14 = !strconcat(t13, ", $src2"); - string t15 = !strconcat(t14, VecModStr.s); - string s = !strconcat(t15, ";"); -} -class ShuffleAsmStr2 -{ - string t1 = ShuffleOneLine<"2", "0", type>.s; - string t2 = !strconcat(t1, "\n\t"); - string s = !strconcat(t2, ShuffleOneLine<"2", "1", type>.s); -} -class ShuffleAsmStr4 -{ - string t1 = ShuffleOneLine<"4", "0", type>.s; - string t2 = !strconcat(t1, "\n\t"); - string t3 = !strconcat(t2, ShuffleOneLine<"4", "1", type>.s); - string t4 = !strconcat(t3, "\n\t"); - string t5 = !strconcat(t4, ShuffleOneLine<"4", "2", type>.s); - string t6 = !strconcat(t5, "\n\t"); - string s = !strconcat(t6, ShuffleOneLine<"4", "3", type>.s); -} - -let hasSideEffects=0, VecInstType=isVecShuffle.Value in { -def VecShuffle_v4f32 : NVPTXVecInst<(outs V4F32Regs:$dst), - (ins V4F32Regs:$src1, V4F32Regs:$src2, - i8imm:$c0, i8imm:$c1, i8imm:$c2, i8imm:$c3), - !strconcat("//Mov $dst, $src1, $src2, $c0, $c1, $c2, $c3;\n\t", - ShuffleAsmStr4<"f32">.s), - [], FMOV32rr>; - -def VecShuffle_v4i32 : NVPTXVecInst<(outs V4I32Regs:$dst), - (ins V4I32Regs:$src1, V4I32Regs:$src2, - i8imm:$c0, i8imm:$c1, i8imm:$c2, i8imm:$c3), - !strconcat("//Mov $dst, $src1, $src2, $c0, $c1, $c2, $c3;\n\t", - ShuffleAsmStr4<"u32">.s), - [], IMOV32rr>; - -def VecShuffle_v4i16 : NVPTXVecInst<(outs V4I16Regs:$dst), - (ins V4I16Regs:$src1, V4I16Regs:$src2, - i8imm:$c0, i8imm:$c1, i8imm:$c2, i8imm:$c3), - !strconcat("//Mov $dst, $src1, $src2, $c0, $c1, $c2, $c3;\n\t", - ShuffleAsmStr4<"u16">.s), - [], IMOV16rr>; - -def VecShuffle_v4i8 : NVPTXVecInst<(outs V4I8Regs:$dst), - (ins V4I8Regs:$src1, V4I8Regs:$src2, - i8imm:$c0, i8imm:$c1, i8imm:$c2, i8imm:$c3), - !strconcat("//Mov $dst, $src1, $src2, $c0, $c1, $c2, $c3;\n\t", - ShuffleAsmStr4<"u16">.s), - [], IMOV8rr>; - -def VecShuffle_v2f32 : NVPTXVecInst<(outs V2F32Regs:$dst), - (ins V2F32Regs:$src1, V2F32Regs:$src2, - i8imm:$c0, i8imm:$c1), - !strconcat("//Mov $dst, $src1, $src2, $c0, $c1;\n\t", - ShuffleAsmStr2<"f32">.s), - [], FMOV32rr>; - -def VecShuffle_v2i32 : NVPTXVecInst<(outs V2I32Regs:$dst), - (ins V2I32Regs:$src1, V2I32Regs:$src2, - i8imm:$c0, i8imm:$c1), - !strconcat("//Mov $dst, $src1, $src2, $c0, $c1;\n\t", - ShuffleAsmStr2<"u32">.s), - [], IMOV32rr>; - -def VecShuffle_v2i8 : NVPTXVecInst<(outs V2I8Regs:$dst), - (ins V2I8Regs:$src1, V2I8Regs:$src2, - i8imm:$c0, i8imm:$c1), - !strconcat("//Mov $dst, $src1, $src2, $c0, $c1;\n\t", - ShuffleAsmStr2<"u16">.s), - [], IMOV8rr>; - -def VecShuffle_v2i16 : NVPTXVecInst<(outs V2I16Regs:$dst), - (ins V2I16Regs:$src1, V2I16Regs:$src2, - i8imm:$c0, i8imm:$c1), - !strconcat("//Mov $dst, $src1, $src2, $c0, $c1;\n\t", - ShuffleAsmStr2<"u16">.s), - [], IMOV16rr>; - -def VecShuffle_v2f64 : NVPTXVecInst<(outs V2F64Regs:$dst), - (ins V2F64Regs:$src1, V2F64Regs:$src2, - i8imm:$c0, i8imm:$c1), - !strconcat("//Mov $dst, $src1, $src2, $c0, $c1;\n\t", - ShuffleAsmStr2<"f64">.s), - [], FMOV64rr>; - -def VecShuffle_v2i64 : NVPTXVecInst<(outs V2I64Regs:$dst), - (ins V2I64Regs:$src1, V2I64Regs:$src2, - i8imm:$c0, i8imm:$c1), - !strconcat("//Mov $dst, $src1, $src2, $c0, $c1;\n\t", - ShuffleAsmStr2<"u64">.s), - [], IMOV64rr>; -} - -def ShuffleMask0 : SDNodeXForm(N); - return CurDAG->getTargetConstant(SVOp->getMaskElt(0), SDLoc(N), MVT::i32); -}]>; -def ShuffleMask1 : SDNodeXForm(N); - return CurDAG->getTargetConstant(SVOp->getMaskElt(1), SDLoc(N), MVT::i32); -}]>; -def ShuffleMask2 : SDNodeXForm(N); - return CurDAG->getTargetConstant(SVOp->getMaskElt(2), SDLoc(N), MVT::i32); -}]>; -def ShuffleMask3 : SDNodeXForm(N); - return CurDAG->getTargetConstant(SVOp->getMaskElt(3), SDLoc(N), MVT::i32); -}]>; - -// The spurious call is here to silence a compiler warning about N being -// unused. -def vec_shuf : PatFrag<(ops node:$lhs, node:$rhs), - (vector_shuffle node:$lhs, node:$rhs), - [{ N->getGluedNode(); return true; }]>; - -def : Pat<(v2f64 (vec_shuf:$op V2F64Regs:$src1, V2F64Regs:$src2)), - (VecShuffle_v2f64 V2F64Regs:$src1, V2F64Regs:$src2, - (ShuffleMask0 node:$op), (ShuffleMask1 node:$op))>; - -def : Pat<(v4f32 (vec_shuf:$op V4F32Regs:$src1, V4F32Regs:$src2)), - (VecShuffle_v4f32 V4F32Regs:$src1, V4F32Regs:$src2, - (ShuffleMask0 node:$op), (ShuffleMask1 node:$op), - (ShuffleMask2 node:$op), (ShuffleMask3 node:$op))>; - -def : Pat<(v2f32 (vec_shuf:$op V2F32Regs:$src1, V2F32Regs:$src2)), - (VecShuffle_v2f32 V2F32Regs:$src1, V2F32Regs:$src2, - (ShuffleMask0 node:$op), (ShuffleMask1 node:$op))>; - -def : Pat<(v2i64 (vec_shuf:$op V2I64Regs:$src1, V2I64Regs:$src2)), - (VecShuffle_v2i64 V2I64Regs:$src1, V2I64Regs:$src2, - (ShuffleMask0 node:$op), (ShuffleMask1 node:$op))>; - -def : Pat<(v4i32 (vec_shuf:$op V4I32Regs:$src1, V4I32Regs:$src2)), - (VecShuffle_v4i32 V4I32Regs:$src1, V4I32Regs:$src2, - (ShuffleMask0 node:$op), (ShuffleMask1 node:$op), - (ShuffleMask2 node:$op), (ShuffleMask3 node:$op))>; - -def : Pat<(v2i32 (vec_shuf:$op V2I32Regs:$src1, V2I32Regs:$src2)), - (VecShuffle_v2i32 V2I32Regs:$src1, V2I32Regs:$src2, - (ShuffleMask0 node:$op), (ShuffleMask1 node:$op))>; - -def : Pat<(v4i16 (vec_shuf:$op V4I16Regs:$src1, V4I16Regs:$src2)), - (VecShuffle_v4i16 V4I16Regs:$src1, V4I16Regs:$src2, - (ShuffleMask0 node:$op), (ShuffleMask1 node:$op), - (ShuffleMask2 node:$op), (ShuffleMask3 node:$op))>; - -def : Pat<(v2i16 (vec_shuf:$op V2I16Regs:$src1, V2I16Regs:$src2)), - (VecShuffle_v2i16 V2I16Regs:$src1, V2I16Regs:$src2, - (ShuffleMask0 node:$op), (ShuffleMask1 node:$op))>; - -def : Pat<(v4i8 (vec_shuf:$op V4I8Regs:$src1, V4I8Regs:$src2)), - (VecShuffle_v4i8 V4I8Regs:$src1, V4I8Regs:$src2, - (ShuffleMask0 node:$op), (ShuffleMask1 node:$op), - (ShuffleMask2 node:$op), (ShuffleMask3 node:$op))>; - -def : Pat<(v2i8 (vec_shuf:$op V2I8Regs:$src1, V2I8Regs:$src2)), - (VecShuffle_v2i8 V2I8Regs:$src1, V2I8Regs:$src2, - (ShuffleMask0 node:$op), (ShuffleMask1 node:$op))>; - -class Build_Vector2 - : NVPTXVecInst<(outs vclass:$dst), - (ins sclass:$a1, sclass:$a2), - !strconcat(asmstr, "\t${dst:vecfull}, {{$a1, $a2}};"), - [(set vclass:$dst, (build_vector sclass:$a1, sclass:$a2))], - si>; -class Build_Vector4 - : NVPTXVecInst<(outs vclass:$dst), - (ins sclass:$a1, sclass:$a2, sclass:$a3, sclass:$a4), - !strconcat(asmstr, "\t${dst:vecfull}, {{$a1, $a2, $a3, $a4}};"), - [(set vclass:$dst, - (build_vector sclass:$a1, sclass:$a2, - sclass:$a3, sclass:$a4))], si>; - -let isAsCheapAsAMove=1, VecInstType=isVecBuild.Value in { -def Build_Vector2_f32 : Build_Vector2<"mov.v2.f32", V2F32Regs, Float32Regs, - FMOV32rr>; -def Build_Vector2_f64 : Build_Vector2<"mov.v2.f64", V2F64Regs, Float64Regs, - FMOV64rr>; - -def Build_Vector2_i32 : Build_Vector2<"mov.v2.u32", V2I32Regs, Int32Regs, - IMOV32rr>; -def Build_Vector2_i64 : Build_Vector2<"mov.v2.u64", V2I64Regs, Int64Regs, - IMOV64rr>; -def Build_Vector2_i16 : Build_Vector2<"mov.v2.u16", V2I16Regs, Int16Regs, - IMOV16rr>; -def Build_Vector2_i8 : Build_Vector2<"mov.v2.u16", V2I8Regs, Int8Regs, - IMOV8rr>; - -def Build_Vector4_f32 : Build_Vector4<"mov.v4.f32", V4F32Regs, Float32Regs, - FMOV32rr>; - -def Build_Vector4_i32 : Build_Vector4<"mov.v4.u32", V4I32Regs, Int32Regs, - IMOV32rr>; -def Build_Vector4_i16 : Build_Vector4<"mov.v4.u16", V4I16Regs, Int16Regs, - IMOV16rr>; -def Build_Vector4_i8 : Build_Vector4<"mov.v4.u16", V4I8Regs, Int8Regs, - IMOV8rr>; -} - -class Vec_Move - : NVPTXVecInst<(outs vclass:$dst), (ins vclass:$src), - !strconcat(asmstr, "\t${dst:vecfull}, ${src:vecfull};"), - [], sop>; - -let isAsCheapAsAMove=1, hasSideEffects=0, IsSimpleMove=1, - VecInstType=isVecOther.Value in { -def V4f32Mov : Vec_Move<"mov.v4.f32", V4F32Regs, FMOV32rr>; -def V2f32Mov : Vec_Move<"mov.v2.f32", V2F32Regs, FMOV32rr>; - -def V4i32Mov : Vec_Move<"mov.v4.u32", V4I32Regs, IMOV32rr>; -def V2i32Mov : Vec_Move<"mov.v2.u32", V2I32Regs, IMOV32rr>; - -def V4i16Mov : Vec_Move<"mov.v4.u16", V4I16Regs, IMOV16rr>; -def V2i16Mov : Vec_Move<"mov.v2.u16", V2I16Regs, IMOV16rr>; - -def V4i8Mov : Vec_Move<"mov.v4.u16", V4I8Regs, IMOV8rr>; -def V2i8Mov : Vec_Move<"mov.v2.u16", V2I8Regs, IMOV8rr>; - -def V2f64Mov : Vec_Move<"mov.v2.f64", V2F64Regs, FMOV64rr>; -def V2i64Mov : Vec_Move<"mov.v2.u64", V2I64Regs, IMOV64rr>; -} - -// extract subvector patterns -def extract_subvec : SDNode<"ISD::EXTRACT_SUBVECTOR", - SDTypeProfile<1, 2, [SDTCisPtrTy<2>]>>; - -def : Pat<(v2f32 (extract_subvec V4F32Regs:$src, 0)), - (Build_Vector2_f32 (V4f32Extract V4F32Regs:$src, 0), - (V4f32Extract V4F32Regs:$src, 1))>; -def : Pat<(v2f32 (extract_subvec V4F32Regs:$src, 2)), - (Build_Vector2_f32 (V4f32Extract V4F32Regs:$src, 2), - (V4f32Extract V4F32Regs:$src, 3))>; -def : Pat<(v2i32 (extract_subvec V4I32Regs:$src, 0)), - (Build_Vector2_i32 (V4i32Extract V4I32Regs:$src, 0), - (V4i32Extract V4I32Regs:$src, 1))>; -def : Pat<(v2i32 (extract_subvec V4I32Regs:$src, 2)), - (Build_Vector2_i32 (V4i32Extract V4I32Regs:$src, 2), - (V4i32Extract V4I32Regs:$src, 3))>; -def : Pat<(v2i16 (extract_subvec V4I16Regs:$src, 0)), - (Build_Vector2_i16 (V4i16Extract V4I16Regs:$src, 0), - (V4i16Extract V4I16Regs:$src, 1))>; -def : Pat<(v2i16 (extract_subvec V4I16Regs:$src, 2)), - (Build_Vector2_i16 (V4i16Extract V4I16Regs:$src, 2), - (V4i16Extract V4I16Regs:$src, 3))>; -def : Pat<(v2i8 (extract_subvec V4I8Regs:$src, 0)), - (Build_Vector2_i8 (V4i8Extract V4I8Regs:$src, 0), - (V4i8Extract V4I8Regs:$src, 1))>; -def : Pat<(v2i8 (extract_subvec V4I8Regs:$src, 2)), - (Build_Vector2_i8 (V4i8Extract V4I8Regs:$src, 2), - (V4i8Extract V4I8Regs:$src, 3))>; - -// Select instructions -class Select_OneLine { - string t1 = !strconcat("selp.", type); - string t2 = !strconcat(t1, " \t${dst}_"); - string t3 = !strconcat(t2, pos); - string t4 = !strconcat(t3, ", ${src1}_"); - string t5 = !strconcat(t4, pos); - string t6 = !strconcat(t5, ", ${src2}_"); - string t7 = !strconcat(t6, pos); - string s = !strconcat(t7, ", $p;"); -} - -class Select_Str2 { - string t1 = Select_OneLine.s; - string t2 = !strconcat(t1, "\n\t"); - string s = !strconcat(t2, Select_OneLine.s); -} - -class Select_Str4 { - string t1 = Select_OneLine.s; - string t2 = !strconcat(t1, "\n\t"); - string t3 = !strconcat(t2, Select_OneLine.s); - string t4 = !strconcat(t3, "\n\t"); - string t5 = !strconcat(t4, Select_OneLine.s); - string t6 = !strconcat(t5, "\n\t"); - string s = !strconcat(t6, Select_OneLine.s); - -} - -class Vec_Select - : NVPTXVecInst<(outs vclass:$dst), - (ins vclass:$src1, vclass:$src2, Int1Regs:$p), - asmstr, - [(set vclass:$dst, (select Int1Regs:$p, vclass:$src1, - vclass:$src2))], - sop>; - -let VecInstType=isVecOther.Value in { -def V2I64_Select : Vec_Select.s, SELECTi64rr>; -def V4I32_Select : Vec_Select.s, SELECTi32rr>; -def V2I32_Select : Vec_Select.s, SELECTi32rr>; -def V4I16_Select : Vec_Select.s, SELECTi16rr>; -def V2I16_Select : Vec_Select.s, SELECTi16rr>; -def V4I8_Select : Vec_Select.s, SELECTi8rr>; -def V2I8_Select : Vec_Select.s, SELECTi8rr>; - -def V2F64_Select : Vec_Select.s, SELECTf64rr>; -def V4F32_Select : Vec_Select.s, SELECTf32rr>; -def V2F32_Select : Vec_Select.s, SELECTf32rr>; -} - -// Comparison instructions - -// setcc convenience fragments. -def vsetoeq : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETOEQ)>; -def vsetogt : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETOGT)>; -def vsetoge : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETOGE)>; -def vsetolt : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETOLT)>; -def vsetole : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETOLE)>; -def vsetone : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETONE)>; -def vseto : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETO)>; -def vsetuo : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETUO)>; -def vsetueq : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETUEQ)>; -def vsetugt : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETUGT)>; -def vsetuge : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETUGE)>; -def vsetult : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETULT)>; -def vsetule : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETULE)>; -def vsetune : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETUNE)>; -def vseteq : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETEQ)>; -def vsetgt : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETGT)>; -def vsetge : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETGE)>; -def vsetlt : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETLT)>; -def vsetle : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETLE)>; -def vsetne : PatFrag<(ops node:$lhs, node:$rhs), - (setcc node:$lhs, node:$rhs, SETNE)>; - -class Vec_Compare - : NVPTXVecInst<(outs outrclass:$dst), - (ins inrclass:$a, inrclass:$b), - "Unsupported", - [(set outrclass:$dst, (op inrclass:$a, inrclass:$b))], - sop>; - -multiclass Vec_Compare_All -{ - def V2I8 : Vec_Compare; - def V4I8 : Vec_Compare; - def V2I16 : Vec_Compare; - def V4I16 : Vec_Compare; - def V2I32 : Vec_Compare; - def V4I32 : Vec_Compare; - def V2I64 : Vec_Compare; -} - -let VecInstType=isVecOther.Value in { - defm VecSGT : Vec_Compare_All; - defm VecUGT : Vec_Compare_All; - defm VecSLT : Vec_Compare_All; - defm VecULT : Vec_Compare_All; - defm VecSGE : Vec_Compare_All; - defm VecUGE : Vec_Compare_All; - defm VecSLE : Vec_Compare_All; - defm VecULE : Vec_Compare_All; - defm VecSEQ : Vec_Compare_All; - defm VecUEQ : Vec_Compare_All; - defm VecSNE : Vec_Compare_All; - defm VecUNE : Vec_Compare_All; -} - -multiclass FVec_Compare_All -{ - def V2F32 : Vec_Compare; - def V4F32 : Vec_Compare; - def V2F64 : Vec_Compare; -} - -let VecInstType=isVecOther.Value in { - defm FVecGT : FVec_Compare_All; - defm FVecLT : FVec_Compare_All; - defm FVecGE : FVec_Compare_All; - defm FVecLE : FVec_Compare_All; - defm FVecEQ : FVec_Compare_All; - defm FVecNE : FVec_Compare_All; - - defm FVecUGT : FVec_Compare_All; - defm FVecULT : FVec_Compare_All; - defm FVecUGE : FVec_Compare_All; - defm FVecULE : FVec_Compare_All; - defm FVecUEQ : FVec_Compare_All; - defm FVecUNE : FVec_Compare_All; - - defm FVecNUM : FVec_Compare_All; - defm FVecNAN : FVec_Compare_All; -} - -class LoadParamScalar4Inst : - NVPTXInst<(outs regclass:$d1, regclass:$d2, regclass:$d3, regclass:$d4), - (ins i32imm:$a, i32imm:$b), - !strconcat(!strconcat("ld.param", opstr), - "\t{{$d1, $d2, $d3, $d4}}, [retval0+$b];"), []>; - -class LoadParamScalar2Inst : - NVPTXInst<(outs regclass:$d1, regclass:$d2), - (ins i32imm:$a, i32imm:$b), - !strconcat(!strconcat("ld.param", opstr), - "\t{{$d1, $d2}}, [retval0+$b];"), []>; - - -class StoreParamScalar4Inst : - NVPTXInst<(outs), - (ins regclass:$s1, regclass:$s2, regclass:$s3, regclass:$s4, - i32imm:$a, i32imm:$b), - !strconcat(!strconcat("st.param", opstr), - "\t[param$a+$b], {{$s1, $s2, $s3, $s4}};"), []>; - -class StoreParamScalar2Inst : - NVPTXInst<(outs), - (ins regclass:$s1, regclass:$s2, i32imm:$a, i32imm:$b), - !strconcat(!strconcat("st.param", opstr), - "\t[param$a+$b], {{$s1, $s2}};"), []>; - -class StoreRetvalScalar4Inst : - NVPTXInst<(outs), - (ins regclass:$s1, regclass:$s2, regclass:$s3, regclass:$s4, - i32imm:$a), - !strconcat(!strconcat("st.param", opstr), - "\t[func_retval+$a], {{$s1, $s2, $s3, $s4}};"), []>; - -class StoreRetvalScalar2Inst : - NVPTXInst<(outs), - (ins regclass:$s1, regclass:$s2, i32imm:$a), - !strconcat(!strconcat("st.param", opstr), - "\t[func_retval+$a], {{$s1, $s2}};"), []>; - -def LoadParamScalar4I32 : LoadParamScalar4Inst; -def LoadParamScalar4I16 : LoadParamScalar4Inst; -def LoadParamScalar4I8 : LoadParamScalar4Inst; - -def LoadParamScalar2I64 : LoadParamScalar2Inst; -def LoadParamScalar2I32 : LoadParamScalar2Inst; -def LoadParamScalar2I16 : LoadParamScalar2Inst; -def LoadParamScalar2I8 : LoadParamScalar2Inst; - -def LoadParamScalar4F32 : LoadParamScalar4Inst; -def LoadParamScalar2F32 : LoadParamScalar2Inst; -def LoadParamScalar2F64 : LoadParamScalar2Inst; - -def StoreParamScalar4I32 : StoreParamScalar4Inst; -def StoreParamScalar4I16 : StoreParamScalar4Inst; -def StoreParamScalar4I8 : StoreParamScalar4Inst; - -def StoreParamScalar2I64 : StoreParamScalar2Inst; -def StoreParamScalar2I32 : StoreParamScalar2Inst; -def StoreParamScalar2I16 : StoreParamScalar2Inst; -def StoreParamScalar2I8 : StoreParamScalar2Inst; - -def StoreParamScalar4F32 : StoreParamScalar4Inst; -def StoreParamScalar2F32 : StoreParamScalar2Inst; -def StoreParamScalar2F64 : StoreParamScalar2Inst; - -def StoreRetvalScalar4I32 : StoreRetvalScalar4Inst; -def StoreRetvalScalar4I16 : StoreRetvalScalar4Inst; -def StoreRetvalScalar4I8 : StoreRetvalScalar4Inst; - -def StoreRetvalScalar2I64 : StoreRetvalScalar2Inst; -def StoreRetvalScalar2I32 : StoreRetvalScalar2Inst; -def StoreRetvalScalar2I16 : StoreRetvalScalar2Inst; -def StoreRetvalScalar2I8 : StoreRetvalScalar2Inst; - -def StoreRetvalScalar4F32 : StoreRetvalScalar4Inst; -def StoreRetvalScalar2F32 : StoreRetvalScalar2Inst; -def StoreRetvalScalar2F64 : StoreRetvalScalar2Inst; - -class LoadParamVecInst: - NVPTXVecInst<(outs regclass:$dst), (ins i32imm:$a, i32imm:$b), - "loadparam : $dst <- [$a, $b]", - [(set regclass:$dst, (LoadParam (i32 imm:$a), (i32 imm:$b)))], - sop>; - -class StoreParamVecInst - : NVPTXVecInst<(outs), (ins regclass:$val, i32imm:$a, i32imm:$b), - "storeparam : [$a, $b] <- $val", - [(StoreParam (i32 imm:$a), (i32 imm:$b), regclass:$val)], sop>; - -class StoreRetvalVecInst - : NVPTXVecInst<(outs), (ins regclass:$val, i32imm:$a), - "storeretval : retval[$a] <- $val", - [(StoreRetval (i32 imm:$a), regclass:$val)], sop>; - -let VecInstType=isVecLD.Value in { -def LoadParamV4I32 : LoadParamVecInst; -def LoadParamV4I16 : LoadParamVecInst; -def LoadParamV4I8 : LoadParamVecInst; - -def LoadParamV2I64 : LoadParamVecInst; -def LoadParamV2I32 : LoadParamVecInst; -def LoadParamV2I16 : LoadParamVecInst; -def LoadParamV2I8 : LoadParamVecInst; - -def LoadParamV4F32 : LoadParamVecInst; -def LoadParamV2F32 : LoadParamVecInst; -def LoadParamV2F64 : LoadParamVecInst; -} - -let VecInstType=isVecST.Value in { -def StoreParamV4I32 : StoreParamVecInst; -def StoreParamV4I16 : StoreParamVecInst; -def StoreParamV4I8 : StoreParamVecInst; - -def StoreParamV2I64 : StoreParamVecInst; -def StoreParamV2I32 : StoreParamVecInst; -def StoreParamV2I16 : StoreParamVecInst; -def StoreParamV2I8 : StoreParamVecInst; - -def StoreParamV4F32 : StoreParamVecInst; -def StoreParamV2F32 : StoreParamVecInst; -def StoreParamV2F64 : StoreParamVecInst; - -def StoreRetvalV4I32 : StoreRetvalVecInst; -def StoreRetvalV4I16 : StoreRetvalVecInst; -def StoreRetvalV4I8 : StoreRetvalVecInst; - -def StoreRetvalV2I64 : StoreRetvalVecInst; -def StoreRetvalV2I32 : StoreRetvalVecInst; -def StoreRetvalV2I16 : StoreRetvalVecInst; -def StoreRetvalV2I8 : StoreRetvalVecInst; - -def StoreRetvalV4F32 : StoreRetvalVecInst; -def StoreRetvalV2F32 : StoreRetvalVecInst; -def StoreRetvalV2F64 : StoreRetvalVecInst; - -} - - -// Int vector to int scalar bit convert -// v4i8 -> i32 -def : Pat<(i32 (bitconvert V4I8Regs:$s)), - (V4I8toI32 (V4i8Extract V4I8Regs:$s,0), (V4i8Extract V4I8Regs:$s,1), - (V4i8Extract V4I8Regs:$s,2), (V4i8Extract V4I8Regs:$s,3))>; -// v4i16 -> i64 -def : Pat<(i64 (bitconvert V4I16Regs:$s)), - (V4I16toI64 (V4i16Extract V4I16Regs:$s,0), - (V4i16Extract V4I16Regs:$s,1), - (V4i16Extract V4I16Regs:$s,2), - (V4i16Extract V4I16Regs:$s,3))>; -// v2i8 -> i16 -def : Pat<(i16 (bitconvert V2I8Regs:$s)), - (V2I8toI16 (V2i8Extract V2I8Regs:$s,0), (V2i8Extract V2I8Regs:$s,1))>; -// v2i16 -> i32 -def : Pat<(i32 (bitconvert V2I16Regs:$s)), - (V2I16toI32 (V2i16Extract V2I16Regs:$s,0), - (V2i16Extract V2I16Regs:$s,1))>; -// v2i32 -> i64 -def : Pat<(i64 (bitconvert V2I32Regs:$s)), - (V2I32toI64 (V2i32Extract V2I32Regs:$s,0), - (V2i32Extract V2I32Regs:$s,1))>; - -// Int scalar to int vector bit convert -let VecInstType=isVecDest.Value in { -// i32 -> v4i8 -def VecI32toV4I8 : NVPTXVecInst<(outs V4I8Regs:$d), (ins Int32Regs:$s), - "Error!", - [(set V4I8Regs:$d, (bitconvert Int32Regs:$s))], - I32toV4I8>; -// i64 -> v4i16 -def VecI64toV4I16 : NVPTXVecInst<(outs V4I16Regs:$d), (ins Int64Regs:$s), - "Error!", - [(set V4I16Regs:$d, (bitconvert Int64Regs:$s))], - I64toV4I16>; -// i16 -> v2i8 -def VecI16toV2I8 : NVPTXVecInst<(outs V2I8Regs:$d), (ins Int16Regs:$s), - "Error!", - [(set V2I8Regs:$d, (bitconvert Int16Regs:$s))], - I16toV2I8>; -// i32 -> v2i16 -def VecI32toV2I16 : NVPTXVecInst<(outs V2I16Regs:$d), (ins Int32Regs:$s), - "Error!", - [(set V2I16Regs:$d, (bitconvert Int32Regs:$s))], - I32toV2I16>; -// i64 -> v2i32 -def VecI64toV2I32 : NVPTXVecInst<(outs V2I32Regs:$d), (ins Int64Regs:$s), - "Error!", - [(set V2I32Regs:$d, (bitconvert Int64Regs:$s))], - I64toV2I32>; -} - -// Int vector to int vector bit convert -// v4i8 -> v2i16 -def : Pat<(v2i16 (bitconvert V4I8Regs:$s)), - (VecI32toV2I16 - (V4I8toI32 (V4i8Extract V4I8Regs:$s,0), (V4i8Extract V4I8Regs:$s,1), - (V4i8Extract V4I8Regs:$s,2), (V4i8Extract V4I8Regs:$s,3)))>; -// v4i16 -> v2i32 -def : Pat<(v2i32 (bitconvert V4I16Regs:$s)), - (VecI64toV2I32 - (V4I16toI64 (V4i16Extract V4I16Regs:$s,0), (V4i16Extract V4I16Regs:$s,1), - (V4i16Extract V4I16Regs:$s,2), (V4i16Extract V4I16Regs:$s,3)))>; -// v2i16 -> v4i8 -def : Pat<(v4i8 (bitconvert V2I16Regs:$s)), - (VecI32toV4I8 - (V2I16toI32 (V2i16Extract V2I16Regs:$s,0), (V2i16Extract V2I16Regs:$s,1)))>; -// v2i32 -> v4i16 -def : Pat<(v4i16 (bitconvert V2I32Regs:$s)), - (VecI64toV4I16 - (V2I32toI64 (V2i32Extract V2I32Regs:$s,0), (V2i32Extract V2I32Regs:$s,1)))>; -// v2i64 -> v4i32 -def : Pat<(v4i32 (bitconvert V2I64Regs:$s)), - (Build_Vector4_i32 - (V2i32Extract (VecI64toV2I32 (V2i64Extract V2I64Regs:$s, 0)), 0), - (V2i32Extract (VecI64toV2I32 (V2i64Extract V2I64Regs:$s, 0)), 1), - (V2i32Extract (VecI64toV2I32 (V2i64Extract V2I64Regs:$s, 1)), 0), - (V2i32Extract (VecI64toV2I32 (V2i64Extract V2I64Regs:$s, 1)), 1))>; -// v4i32 -> v2i64 -def : Pat<(v2i64 (bitconvert V4I32Regs:$s)), - (Build_Vector2_i64 - (V2I32toI64 (V4i32Extract V4I32Regs:$s,0), (V4i32Extract V4I32Regs:$s,1)), - (V2I32toI64 (V4i32Extract V4I32Regs:$s,2), (V4i32Extract V4I32Regs:$s,3)))>; - -// Fp scalar to fp vector convert -// f64 -> v2f32 -let VecInstType=isVecDest.Value in { -def VecF64toV2F32 : NVPTXVecInst<(outs V2F32Regs:$d), (ins Float64Regs:$s), - "Error!", - [(set V2F32Regs:$d, (bitconvert Float64Regs:$s))], - F64toV2F32>; -} - -// Fp vector to fp scalar convert -// v2f32 -> f64 -def : Pat<(f64 (bitconvert V2F32Regs:$s)), - (V2F32toF64 (V2f32Extract V2F32Regs:$s,0), (V2f32Extract V2F32Regs:$s,1))>; - -// Fp scalar to int vector convert -// f32 -> v4i8 -def : Pat<(v4i8 (bitconvert Float32Regs:$s)), - (VecI32toV4I8 (BITCONVERT_32_F2I Float32Regs:$s))>; -// f32 -> v2i16 -def : Pat<(v2i16 (bitconvert Float32Regs:$s)), - (VecI32toV2I16 (BITCONVERT_32_F2I Float32Regs:$s))>; -// f64 -> v4i16 -def : Pat<(v4i16 (bitconvert Float64Regs:$s)), - (VecI64toV4I16 (BITCONVERT_64_F2I Float64Regs:$s))>; -// f64 -> v2i32 -def : Pat<(v2i32 (bitconvert Float64Regs:$s)), - (VecI64toV2I32 (BITCONVERT_64_F2I Float64Regs:$s))>; - -// Int vector to fp scalar convert -// v4i8 -> f32 -def : Pat<(f32 (bitconvert V4I8Regs:$s)), - (BITCONVERT_32_I2F - (V4I8toI32 (V4i8Extract V4I8Regs:$s,0), (V4i8Extract V4I8Regs:$s,1), - (V4i8Extract V4I8Regs:$s,2), (V4i8Extract V4I8Regs:$s,3)))>; -// v4i16 -> f64 -def : Pat<(f64 (bitconvert V4I16Regs:$s)), - (BITCONVERT_64_I2F - (V4I16toI64 (V4i16Extract V4I16Regs:$s,0), (V4i16Extract V4I16Regs:$s,1), - (V4i16Extract V4I16Regs:$s,2), (V4i16Extract V4I16Regs:$s,3)))>; -// v2i16 -> f32 -def : Pat<(f32 (bitconvert V2I16Regs:$s)), - (BITCONVERT_32_I2F - (V2I16toI32 (V2i16Extract V2I16Regs:$s,0), (V2i16Extract V2I16Regs:$s,1)))>; -// v2i32 -> f64 -def : Pat<(f64 (bitconvert V2I32Regs:$s)), - (BITCONVERT_64_I2F - (V2I32toI64 (V2i32Extract V2I32Regs:$s,0), (V2i32Extract V2I32Regs:$s,1)))>; - -// Int scalar to fp vector convert -// i64 -> v2f32 -def : Pat<(v2f32 (bitconvert Int64Regs:$s)), - (VecF64toV2F32 (BITCONVERT_64_I2F Int64Regs:$s))>; - -// Fp vector to int scalar convert -// v2f32 -> i64 -def : Pat<(i64 (bitconvert V2F32Regs:$s)), - (BITCONVERT_64_F2I - (V2F32toF64 (V2f32Extract V2F32Regs:$s,0), (V2f32Extract V2F32Regs:$s,1)))>; - -// Int vector to fp vector convert -// v2i64 -> v4f32 -def : Pat<(v4f32 (bitconvert V2I64Regs:$s)), - (Build_Vector4_f32 - (BITCONVERT_32_I2F (V2i32Extract (VecI64toV2I32 - (V2i64Extract V2I64Regs:$s, 0)), 0)), - (BITCONVERT_32_I2F (V2i32Extract (VecI64toV2I32 - (V2i64Extract V2I64Regs:$s, 0)), 1)), - (BITCONVERT_32_I2F (V2i32Extract (VecI64toV2I32 - (V2i64Extract V2I64Regs:$s, 1)), 0)), - (BITCONVERT_32_I2F (V2i32Extract (VecI64toV2I32 - (V2i64Extract V2I64Regs:$s, 1)), 1)))>; -// v2i64 -> v2f64 -def : Pat<(v2f64 (bitconvert V2I64Regs:$s)), - (Build_Vector2_f64 - (BITCONVERT_64_I2F (V2i64Extract V2I64Regs:$s,0)), - (BITCONVERT_64_I2F (V2i64Extract V2I64Regs:$s,1)))>; -// v2i32 -> v2f32 -def : Pat<(v2f32 (bitconvert V2I32Regs:$s)), - (Build_Vector2_f32 - (BITCONVERT_32_I2F (V2i32Extract V2I32Regs:$s,0)), - (BITCONVERT_32_I2F (V2i32Extract V2I32Regs:$s,1)))>; -// v4i32 -> v2f64 -def : Pat<(v2f64 (bitconvert V4I32Regs:$s)), - (Build_Vector2_f64 - (BITCONVERT_64_I2F (V2I32toI64 (V4i32Extract V4I32Regs:$s,0), - (V4i32Extract V4I32Regs:$s,1))), - (BITCONVERT_64_I2F (V2I32toI64 (V4i32Extract V4I32Regs:$s,2), - (V4i32Extract V4I32Regs:$s,3))))>; -// v4i32 -> v4f32 -def : Pat<(v4f32 (bitconvert V4I32Regs:$s)), - (Build_Vector4_f32 - (BITCONVERT_32_I2F (V4i32Extract V4I32Regs:$s,0)), - (BITCONVERT_32_I2F (V4i32Extract V4I32Regs:$s,1)), - (BITCONVERT_32_I2F (V4i32Extract V4I32Regs:$s,2)), - (BITCONVERT_32_I2F (V4i32Extract V4I32Regs:$s,3)))>; -// v4i16 -> v2f32 -def : Pat<(v2f32 (bitconvert V4I16Regs:$s)), - (VecF64toV2F32 (BITCONVERT_64_I2F - (V4I16toI64 (V4i16Extract V4I16Regs:$s,0), - (V4i16Extract V4I16Regs:$s,1), - (V4i16Extract V4I16Regs:$s,2), - (V4i16Extract V4I16Regs:$s,3))))>; - -// Fp vector to int vector convert -// v2i64 <- v4f32 -def : Pat<(v2i64 (bitconvert V4F32Regs:$s)), - (Build_Vector2_i64 - (BITCONVERT_64_F2I (V2F32toF64 (V4f32Extract V4F32Regs:$s,0), - (V4f32Extract V4F32Regs:$s,1))), - (BITCONVERT_64_F2I (V2F32toF64 (V4f32Extract V4F32Regs:$s,2), - (V4f32Extract V4F32Regs:$s,3))))>; -// v2i64 <- v2f64 -def : Pat<(v2i64 (bitconvert V2F64Regs:$s)), - (Build_Vector2_i64 - (BITCONVERT_64_F2I (V2f64Extract V2F64Regs:$s,0)), - (BITCONVERT_64_F2I (V2f64Extract V2F64Regs:$s,1)))>; -// v2i32 <- v2f32 -def : Pat<(v2i32 (bitconvert V2F32Regs:$s)), - (Build_Vector2_i32 - (BITCONVERT_32_F2I (V2f32Extract V2F32Regs:$s,0)), - (BITCONVERT_32_F2I (V2f32Extract V2F32Regs:$s,1)))>; -// v4i32 <- v2f64 -def : Pat<(v4i32 (bitconvert V2F64Regs:$s)), - (Build_Vector4_i32 - (BITCONVERT_32_F2I (V2f32Extract (VecF64toV2F32 - (V2f64Extract V2F64Regs:$s, 0)), 0)), - (BITCONVERT_32_F2I (V2f32Extract (VecF64toV2F32 - (V2f64Extract V2F64Regs:$s, 0)), 1)), - (BITCONVERT_32_F2I (V2f32Extract (VecF64toV2F32 - (V2f64Extract V2F64Regs:$s, 1)), 0)), - (BITCONVERT_32_F2I (V2f32Extract (VecF64toV2F32 - (V2f64Extract V2F64Regs:$s, 1)), 1)))>; -// v4i32 <- v4f32 -def : Pat<(v4i32 (bitconvert V4F32Regs:$s)), - (Build_Vector4_i32 - (BITCONVERT_32_F2I (V4f32Extract V4F32Regs:$s,0)), - (BITCONVERT_32_F2I (V4f32Extract V4F32Regs:$s,1)), - (BITCONVERT_32_F2I (V4f32Extract V4F32Regs:$s,2)), - (BITCONVERT_32_F2I (V4f32Extract V4F32Regs:$s,3)))>; -// v4i16 <- v2f32 -def : Pat<(v4i16 (bitconvert V2F32Regs:$s)), - (VecI64toV4I16 (BITCONVERT_64_F2I - (V2F32toF64 (V2f32Extract V2F32Regs:$s,0), - (V2f32Extract V2F32Regs:$s,1))))>;