mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 17:29:19 +00:00
X86: Don't drop half of the mask when converting 2-address shufps into 3-address pshufd.
It's debatable whether this transform is useful at all, but for now make sure we don't generate invalid asm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219084 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a0cb2c75b0
commit
88b3a52eec
@ -2146,7 +2146,7 @@ X86InstrInfo::convertToThreeAddress(MachineFunction::iterator &MFI,
|
||||
unsigned B = MI->getOperand(1).getReg();
|
||||
unsigned C = MI->getOperand(2).getReg();
|
||||
if (B != C) return nullptr;
|
||||
unsigned M = MI->getOperand(3).getImm();
|
||||
int64_t M = MI->getOperand(3).getImm();
|
||||
NewMI = BuildMI(MF, MI->getDebugLoc(), get(X86::PSHUFDri))
|
||||
.addOperand(Dest).addOperand(Src).addImm(M);
|
||||
break;
|
||||
|
11
test/CodeGen/X86/3addr-shufps.ll
Normal file
11
test/CodeGen/X86/3addr-shufps.ll
Normal file
@ -0,0 +1,11 @@
|
||||
; RUN: llc < %s -mtriple=x86_64-apple-darwin13 -mcpu=pentium4 | FileCheck %s
|
||||
|
||||
define <4 x float> @test1(<4 x i32>, <4 x float> %b) {
|
||||
%s = shufflevector <4 x float> %b, <4 x float> undef, <4 x i32> <i32 1, i32 1, i32 2, i32 3>
|
||||
ret <4 x float> %s
|
||||
|
||||
; We convert shufps -> pshufd here to save a move.
|
||||
; CHECK-LABEL: test1:
|
||||
; CHECK: pshufd $-27, %xmm1, %xmm0
|
||||
; CHECK-NEXT: ret
|
||||
}
|
Loading…
Reference in New Issue
Block a user