diff --git a/llvm/lib/Target/X86/X86InstrSSE.td b/llvm/lib/Target/X86/X86InstrSSE.td index 0c7e7fc5315b..4f20dbe0bf27 100644 --- a/llvm/lib/Target/X86/X86InstrSSE.td +++ b/llvm/lib/Target/X86/X86InstrSSE.td @@ -657,6 +657,24 @@ multiclass sse12_fp_scalar opc, string OpcodeStr, SDNode OpNode, OpcodeStr, [(set RC:$dst, (OpNode RC:$src1, (load addr:$src2)))]>; } +/// sse12_fp_scalar_int - SSE 1 & 2 scalar instructions intrinsics class +multiclass sse12_fp_scalar_int opc, string OpcodeStr, RegisterClass RC, + string asm, string SSEVer, string FPSizeStr, + Operand memop, ComplexPattern mem_cpat> { + def rr_Int : SI("int_x86_sse", + !strconcat(SSEVer, !strconcat("_", + !strconcat(OpcodeStr, FPSizeStr)))) + RC:$src1, RC:$src2))]>; + def rm_Int : SI("int_x86_sse", + !strconcat(SSEVer, !strconcat("_", + !strconcat(OpcodeStr, FPSizeStr)))) + RC:$src1, mem_cpat:$src2))]>; +} + /// sse12_fp_packed - SSE 1 & 2 packed instructions class multiclass sse12_fp_packed opc, string OpcodeStr, SDNode OpNode, RegisterClass RC, ValueType vt, @@ -703,6 +721,14 @@ multiclass basic_sse12_fp_binop_rm opc, string OpcodeStr, "pd\t{$src2, $src1, $dst|$dst, $src1, $src2}"), OpNode, VR128, v2f64, f128mem, memopv2f64, SSEPackedDouble>, OpSize, VEX_4V; + + defm V#NAME#SS : sse12_fp_scalar_int, XS, VEX_4V; + + defm V#NAME#SD : sse12_fp_scalar_int, XD, VEX_4V; } let Constraints = "$src1 = $dst" in { @@ -721,81 +747,15 @@ multiclass basic_sse12_fp_binop_rm opc, string OpcodeStr, defm PD : sse12_fp_packed, TB, OpSize; - } - // Intrinsic operation, reg+reg. - def V#NAME#SSrr_Int : VSSI("int_x86_sse_", - !strconcat(OpcodeStr, "_ss")) VR128:$src1, - VR128:$src2))]> { - // int_x86_sse_xxx_ss - let Constraints = ""; - } + "", "_ss", ssmem, sse_load_f32>, XS; - def V#NAME#SDrr_Int : VSDI("int_x86_sse2_", - !strconcat(OpcodeStr, "_sd")) VR128:$src1, - VR128:$src2))]> { - // int_x86_sse2_xxx_sd - let Constraints = ""; + "2", "_sd", sdmem, sse_load_f64>, XD; } - - def SSrr_Int : SSI("int_x86_sse_", - !strconcat(OpcodeStr, "_ss")) VR128:$src1, - VR128:$src2))]>; - // int_x86_sse_xxx_ss - - def SDrr_Int : SDI("int_x86_sse2_", - !strconcat(OpcodeStr, "_sd")) VR128:$src1, - VR128:$src2))]>; - // int_x86_sse2_xxx_sd - - // Intrinsic operation, reg+mem. - def V#NAME#SSrm_Int : VSSI("int_x86_sse_", - !strconcat(OpcodeStr, "_ss")) VR128:$src1, - sse_load_f32:$src2))]> { - // int_x86_sse_xxx_ss - let Constraints = ""; - } - - def V#NAME#SDrm_Int : VSDI("int_x86_sse2_", - !strconcat(OpcodeStr, "_sd")) VR128:$src1, - sse_load_f64:$src2))]> { - // int_x86_sse2_xxx_sd - let Constraints = ""; - } - - def SSrm_Int : SSI("int_x86_sse_", - !strconcat(OpcodeStr, "_ss")) VR128:$src1, - sse_load_f32:$src2))]>; - // int_x86_sse_xxx_ss - - def SDrm_Int : SDI("int_x86_sse2_", - !strconcat(OpcodeStr, "_sd")) VR128:$src1, - sse_load_f64:$src2))]>; - // int_x86_sse2_xxx_sd } }