From 1deddbbd5659edc92028c2278018d21375ce3c81 Mon Sep 17 00:00:00 2001 From: Bruno Cardoso Lopes Date: Mon, 15 Aug 2011 23:36:45 +0000 Subject: [PATCH] Reorder declarations of vmovmskp* and also put the necessary AVX predicate and TB encoding fields. This fix the encoding for the attached testcase. This fixes PR10625. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137684 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86InstrSSE.td | 64 +++++++++++++++++++---------------- test/MC/X86/x86-32-avx.s | 8 +++++ 2 files changed, 42 insertions(+), 30 deletions(-) diff --git a/lib/Target/X86/X86InstrSSE.td b/lib/Target/X86/X86InstrSSE.td index 2f8b2a701de..ad13fc90cde 100644 --- a/lib/Target/X86/X86InstrSSE.td +++ b/lib/Target/X86/X86InstrSSE.td @@ -1475,17 +1475,6 @@ multiclass sse12_extr_sign_mask, REX_W; } -// Mask creation -defm VMOVMSKPS : sse12_extr_sign_mask, VEX; -defm VMOVMSKPD : sse12_extr_sign_mask, OpSize, - VEX; -defm VMOVMSKPSY : sse12_extr_sign_mask, VEX; -defm VMOVMSKPDY : sse12_extr_sign_mask, OpSize, - VEX; defm MOVMSKPS : sse12_extr_sign_mask, TB; defm MOVMSKPD : sse12_extr_sign_mask, TB, OpSize; + "movmskpd\t{$src, $dst|$dst, $src}", + [(set GR32:$dst, (X86fgetsign FR64:$src))], SSEPackedDouble>, TB, + OpSize; def MOVMSKPDrr64_alt : PI<0x50, MRMSrcReg, (outs GR64:$dst), (ins FR64:$src), - "movmskpd\t{$src, $dst|$dst, $src}", - [(set GR64:$dst, (X86fgetsign FR64:$src))], SSEPackedDouble>, TB, OpSize; + "movmskpd\t{$src, $dst|$dst, $src}", + [(set GR64:$dst, (X86fgetsign FR64:$src))], SSEPackedDouble>, TB, + OpSize; def MOVMSKPSrr32_alt : PI<0x50, MRMSrcReg, (outs GR32:$dst), (ins FR32:$src), - "movmskps\t{$src, $dst|$dst, $src}", - [(set GR32:$dst, (X86fgetsign FR32:$src))], SSEPackedSingle>, TB; + "movmskps\t{$src, $dst|$dst, $src}", + [(set GR32:$dst, (X86fgetsign FR32:$src))], SSEPackedSingle>, TB; def MOVMSKPSrr64_alt : PI<0x50, MRMSrcReg, (outs GR64:$dst), (ins FR32:$src), - "movmskps\t{$src, $dst|$dst, $src}", - [(set GR64:$dst, (X86fgetsign FR32:$src))], SSEPackedSingle>, TB; + "movmskps\t{$src, $dst|$dst, $src}", + [(set GR64:$dst, (X86fgetsign FR32:$src))], SSEPackedSingle>, TB; -// Assembler Only -def VMOVMSKPSr64r : PI<0x50, MRMSrcReg, (outs GR64:$dst), (ins VR128:$src), - "movmskps\t{$src, $dst|$dst, $src}", [], SSEPackedSingle>, VEX; -def VMOVMSKPDr64r : PI<0x50, MRMSrcReg, (outs GR64:$dst), (ins VR128:$src), - "movmskpd\t{$src, $dst|$dst, $src}", [], SSEPackedDouble>, OpSize, - VEX; -def VMOVMSKPSYr64r : PI<0x50, MRMSrcReg, (outs GR64:$dst), (ins VR256:$src), - "movmskps\t{$src, $dst|$dst, $src}", [], SSEPackedSingle>, VEX; -def VMOVMSKPDYr64r : PI<0x50, MRMSrcReg, (outs GR64:$dst), (ins VR256:$src), - "movmskpd\t{$src, $dst|$dst, $src}", [], SSEPackedDouble>, OpSize, - VEX; +let Predicates = [HasAVX] in { + defm VMOVMSKPS : sse12_extr_sign_mask, TB, VEX; + defm VMOVMSKPD : sse12_extr_sign_mask, TB, OpSize, + VEX; + defm VMOVMSKPSY : sse12_extr_sign_mask, TB, VEX; + defm VMOVMSKPDY : sse12_extr_sign_mask, TB, OpSize, + VEX; + + // Assembler Only + def VMOVMSKPSr64r : PI<0x50, MRMSrcReg, (outs GR64:$dst), (ins VR128:$src), + "movmskps\t{$src, $dst|$dst, $src}", [], SSEPackedSingle>, VEX; + def VMOVMSKPDr64r : PI<0x50, MRMSrcReg, (outs GR64:$dst), (ins VR128:$src), + "movmskpd\t{$src, $dst|$dst, $src}", [], SSEPackedDouble>, OpSize, + VEX; + def VMOVMSKPSYr64r : PI<0x50, MRMSrcReg, (outs GR64:$dst), (ins VR256:$src), + "movmskps\t{$src, $dst|$dst, $src}", [], SSEPackedSingle>, VEX; + def VMOVMSKPDYr64r : PI<0x50, MRMSrcReg, (outs GR64:$dst), (ins VR256:$src), + "movmskpd\t{$src, $dst|$dst, $src}", [], SSEPackedDouble>, OpSize, + VEX; +} //===----------------------------------------------------------------------===// // SSE 1 & 2 - Misc aliasing of packed SSE 1 & 2 instructions diff --git a/test/MC/X86/x86-32-avx.s b/test/MC/X86/x86-32-avx.s index f56d5763adb..e13a8712f7d 100644 --- a/test/MC/X86/x86-32-avx.s +++ b/test/MC/X86/x86-32-avx.s @@ -479,6 +479,14 @@ // CHECK: encoding: [0xc5,0xf9,0x50,0xc2] vmovmskpd %xmm2, %eax +// CHECK: vmovmskps %ymm2, %eax +// CHECK: encoding: [0xc5,0xfc,0x50,0xc2] + vmovmskps %ymm2, %eax + +// CHECK: vmovmskpd %ymm2, %eax +// CHECK: encoding: [0xc5,0xfd,0x50,0xc2] + vmovmskpd %ymm2, %eax + // CHECK: vcmpss $0, %xmm1, %xmm2, %xmm3 // CHECK: encoding: [0xc5,0xea,0xc2,0xd9,0x00] vcmpeqss %xmm1, %xmm2, %xmm3