From b86a3abcc7856d08277dec7c8b66321bfaf47f09 Mon Sep 17 00:00:00 2001 From: Bruno Cardoso Lopes Date: Sat, 19 Jun 2010 04:09:22 +0000 Subject: [PATCH] Refactoring of regular logical packed instructions to prepare for AVX ones. llvm-svn: 106375 --- llvm/lib/Target/X86/X86InstrSSE.td | 75 +++++++++++++++--------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/llvm/lib/Target/X86/X86InstrSSE.td b/llvm/lib/Target/X86/X86InstrSSE.td index e0a550bc5ddd..dca8cd42f57f 100644 --- a/llvm/lib/Target/X86/X86InstrSSE.td +++ b/llvm/lib/Target/X86/X86InstrSSE.td @@ -414,6 +414,17 @@ multiclass sse12_fp_packed opc, string OpcodeStr, SDNode OpNode, (mem_frag addr:$src2)))],d>; } +/// sse12_fp_packed_logical_rm - SSE 1 & 2 packed instructions class +multiclass sse12_fp_packed_logical_rm opc, RegisterClass RC, Domain d, + string OpcodeStr, X86MemOperand x86memop, + list pat_rr, list pat_rm> { + let isCommutable = 1 in + def rr : PI; + def rm : PI; +} + /// 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, @@ -1040,49 +1051,40 @@ defm RSQRT : sse1_fp_unop_rm<0x52, "rsqrt", X86frsqrt, defm RCP : sse1_fp_unop_rm<0x53, "rcp", X86frcp, int_x86_sse_rcp_ss, int_x86_sse_rcp_ps>; -/// sse12_fp_pack_logical - SSE 1 & 2 packed FP logical ops +/// sse12_fp_packed_logical - SSE 1 & 2 packed FP logical ops /// -multiclass sse12_fp_pack_logical opc, string OpcodeStr, +multiclass sse12_fp_packed_logical opc, string OpcodeStr, SDNode OpNode, int HasPat = 0, - bit Commutable = 1, list> Pattern = []> { - def PSrr : PSI - { let isCommutable = Commutable; } + let Constraints = "$src1 = $dst" in { + defm PS : sse12_fp_packed_logical_rm, TB; - def PDrr : PDI - { let isCommutable = Commutable; } - - def PSrm : PSI; - - def PDrm : PDI; + defm PD : sse12_fp_packed_logical_rm, + TB, OpSize; + } } // Logical -let Constraints = "$src1 = $dst" in { - defm AND : sse12_fp_pack_logical<0x54, "and", and>; - defm OR : sse12_fp_pack_logical<0x56, "or", or>; - defm XOR : sse12_fp_pack_logical<0x57, "xor", xor>; - defm ANDN : sse12_fp_pack_logical<0x55, "andn", undef /* dummy */, 1, 0, [ +defm AND : sse12_fp_packed_logical<0x54, "and", and>; +defm OR : sse12_fp_packed_logical<0x56, "or", or>; +defm XOR : sse12_fp_packed_logical<0x57, "xor", xor>; +let isCommutable = 0 in + defm ANDN : sse12_fp_packed_logical<0x55, "andn", undef /* dummy */, 1, [ // single r+r [(set VR128:$dst, (v2i64 (and (xor VR128:$src1, (bc_v2i64 (v4i32 immAllOnesV))), @@ -1097,7 +1099,6 @@ let Constraints = "$src1 = $dst" in { // double r+m [(set VR128:$dst, (and (vnot (bc_v2i64 (v2f64 VR128:$src1))), (memopv2i64 addr:$src2)))]]>; -} let Constraints = "$src1 = $dst" in { def CMPPSrri : PSIi8<0xC2, MRMSrcReg,