mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-24 21:05:23 +00:00
[Hexagon] Use S2_lsr_i_r instead of S2_extractu to obtain upper halfword
llvm-svn: 257815
This commit is contained in:
parent
47170eaf07
commit
bccfe64a1e
@ -1966,11 +1966,10 @@ bool BitSimplification::genExtractHalf(MachineInstr *MI,
|
||||
NewR = MRI.createVirtualRegister(&Hexagon::IntRegsRegClass);
|
||||
BuildMI(B, At, DL, HII.get(Hexagon::A2_zxth), NewR)
|
||||
.addReg(L.Reg, 0, L.Sub);
|
||||
} else if (!L.Low && Opc != Hexagon::S2_extractu) {
|
||||
} else if (!L.Low && Opc != Hexagon::S2_lsr_i_r) {
|
||||
NewR = MRI.createVirtualRegister(&Hexagon::IntRegsRegClass);
|
||||
BuildMI(B, MI, DL, HII.get(Hexagon::S2_extractu), NewR)
|
||||
BuildMI(B, MI, DL, HII.get(Hexagon::S2_lsr_i_r), NewR)
|
||||
.addReg(L.Reg, 0, L.Sub)
|
||||
.addImm(16)
|
||||
.addImm(16);
|
||||
}
|
||||
if (NewR == 0)
|
||||
|
13
test/CodeGen/Hexagon/bit-extractu-half.ll
Normal file
13
test/CodeGen/Hexagon/bit-extractu-half.ll
Normal file
@ -0,0 +1,13 @@
|
||||
; RUN: llc -march=hexagon < %s | FileCheck %s
|
||||
; Pick lsr (in bit-simplification) for extracting high halfword.
|
||||
; CHECK: lsr{{.*}}#16
|
||||
|
||||
define i32 @foo(i32 %x) #0 {
|
||||
%a = call i32 @llvm.hexagon.S2.extractu(i32 %x, i32 16, i32 16)
|
||||
ret i32 %a
|
||||
}
|
||||
|
||||
declare i32 @llvm.hexagon.S2.extractu(i32, i32, i32) #0
|
||||
|
||||
attributes #0 = { nounwind readnone }
|
||||
|
Loading…
x
Reference in New Issue
Block a user