mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
ARM: Add a pack pattern for matching arithmetic shift right
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185714 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ffd3bb8f0d
commit
fe3b2995aa
@ -4016,6 +4016,9 @@ def PKHTB : APKHI<0b01101000, 1, (outs GPRnopc:$Rd),
|
||||
def : ARMV6Pat<(or (and GPRnopc:$src1, 0xFFFF0000),
|
||||
(srl GPRnopc:$src2, imm16:$sh)),
|
||||
(PKHTB GPRnopc:$src1, GPRnopc:$src2, imm16:$sh)>;
|
||||
def : ARMV6Pat<(or (and GPRnopc:$src1, 0xFFFF0000),
|
||||
(sra GPRnopc:$src2, imm16_31:$sh)),
|
||||
(PKHTB GPRnopc:$src1, GPRnopc:$src2, imm16_31:$sh)>;
|
||||
def : ARMV6Pat<(or (and GPRnopc:$src1, 0xFFFF0000),
|
||||
(and (srl GPRnopc:$src2, imm1_15:$sh), 0xFFFF)),
|
||||
(PKHTB GPRnopc:$src1, GPRnopc:$src2, imm1_15:$sh)>;
|
||||
|
@ -99,3 +99,13 @@ entry:
|
||||
%tmp3 = or i32 %tmp, %tmp2
|
||||
ret i32 %tmp3
|
||||
}
|
||||
|
||||
; CHECK: test10:
|
||||
; CHECK: pkhtb r0, r0, r1, asr #17
|
||||
define i32 @test10(i32 %src1, i32 %src2) {
|
||||
entry:
|
||||
%tmp = and i32 %src1, -65536
|
||||
%tmp2 = ashr i32 %src2, 17
|
||||
%tmp3 = or i32 %tmp, %tmp2
|
||||
ret i32 %tmp3
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user