mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-26 21:32:10 +00:00
aca2998f14
with a temporary assertion and adjust the various test cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197224 91177308-0d34-0410-b5e6-96231b3b80d8
24 lines
645 B
LLVM
24 lines
645 B
LLVM
; RUN: llc < %s -march=thumb -mcpu=arm1156t2-s -mattr=+thumb2,+v7,+t2xtpk | FileCheck %s
|
|
|
|
define i32 @f1(i32 %a) {
|
|
; CHECK-LABEL: f1:
|
|
; CHECK: rev r0, r0
|
|
%tmp = tail call i32 @llvm.bswap.i32(i32 %a)
|
|
ret i32 %tmp
|
|
}
|
|
|
|
declare i32 @llvm.bswap.i32(i32) nounwind readnone
|
|
|
|
define i32 @f2(i32 %X) {
|
|
; CHECK-LABEL: f2:
|
|
; CHECK: revsh r0, r0
|
|
%tmp1 = lshr i32 %X, 8
|
|
%tmp1.upgrd.1 = trunc i32 %tmp1 to i16
|
|
%tmp3 = trunc i32 %X to i16
|
|
%tmp2 = and i16 %tmp1.upgrd.1, 255
|
|
%tmp4 = shl i16 %tmp3, 8
|
|
%tmp5 = or i16 %tmp2, %tmp4
|
|
%tmp5.upgrd.2 = sext i16 %tmp5 to i32
|
|
ret i32 %tmp5.upgrd.2
|
|
}
|