From 17227db062dd70f36c5d11ede5654f8426def928 Mon Sep 17 00:00:00 2001 From: Bruno Cardoso Lopes Date: Sat, 19 Jun 2010 01:17:05 +0000 Subject: [PATCH] Add AVX packed intrinsics for MIN, MAX git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106370 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86InstrSSE.td | 70 +++++++++++++++++------------------ 1 file changed, 33 insertions(+), 37 deletions(-) diff --git a/lib/Target/X86/X86InstrSSE.td b/lib/Target/X86/X86InstrSSE.td index 88c477196db..387e84dc6de 100644 --- a/lib/Target/X86/X86InstrSSE.td +++ b/lib/Target/X86/X86InstrSSE.td @@ -688,6 +688,25 @@ multiclass sse12_fp_packed opc, string OpcodeStr, SDNode OpNode, (mem_frag addr:$src2)))],d>; } +/// sse12_fp_packed_int - SSE 1 & 2 packed instructions intrinsics class +multiclass sse12_fp_packed_int opc, string OpcodeStr, RegisterClass RC, + string asm, string SSEVer, string FPSizeStr, + X86MemOperand memop, PatFrag mem_frag, + Domain d> { + def rr_Int : PI("int_x86_sse", + !strconcat(SSEVer, !strconcat("_", + !strconcat(OpcodeStr, FPSizeStr)))) + RC:$src1, RC:$src2))], d>; + def rm_Int : PI("int_x86_sse", + !strconcat(SSEVer, !strconcat("_", + !strconcat(OpcodeStr, FPSizeStr)))) + RC:$src1, (mem_frag addr:$src2)))], d>; +} + /// basic_sse12_fp_binop_rm - SSE 1 & 2 binops come in both scalar and /// vector forms. /// @@ -775,11 +794,10 @@ let isCommutable = 0 in { /// /// This provides a total of eight "instructions". /// -let Constraints = "$src1 = $dst" in { multiclass sse12_fp_binop_rm opc, string OpcodeStr, SDNode OpNode, bit Commutable = 0> { - let Constraints = "", isAsmParserOnly = 1 in { + let isAsmParserOnly = 1 in { // Scalar operation, reg+reg. defm V#NAME#SS : sse12_fp_scalar opc, string OpcodeStr, defm V#NAME#SD : sse12_fp_scalar_int, XD, VEX_4V; + + defm V#NAME#PS : sse12_fp_packed_int, VEX_4V; + + defm V#NAME#PD : sse12_fp_packed_int, OpSize, + VEX_4V; } let Constraints = "$src1 = $dst" in { @@ -831,46 +858,15 @@ multiclass sse12_fp_binop_rm opc, string OpcodeStr, defm SD : sse12_fp_scalar_int, XD; - } - // Vector intrinsic operation, reg+reg. - def PSrr_Int : PSI("int_x86_sse_", - !strconcat(OpcodeStr, "_ps")) VR128:$src1, - VR128:$src2))]> { - // int_x86_sse_xxx_ps - let isCommutable = Commutable; - } + "", "_ps", f128mem, memopv4f32, SSEPackedSingle>, TB; - def PDrr_Int : PDI("int_x86_sse2_", - !strconcat(OpcodeStr, "_pd")) VR128:$src1, - VR128:$src2))]> { - // int_x86_sse2_xxx_pd - let isCommutable = Commutable; + "2", "_pd", f128mem, memopv2f64, SSEPackedDouble>, TB, OpSize; } - - // Vector intrinsic operation, reg+mem. - def PSrm_Int : PSI("int_x86_sse_", - !strconcat(OpcodeStr, "_ps")) VR128:$src1, - (memopv4f32 addr:$src2)))]>; - // int_x86_sse_xxx_ps - - def PDrm_Int : PDI("int_x86_sse2_", - !strconcat(OpcodeStr, "_pd")) VR128:$src1, - (memopv2f64 addr:$src2)))]>; - // int_x86_sse2_xxx_pd -} } let isCommutable = 0 in { -- 2.34.1