2017-03-09 23:14:32 +08:00
|
|
|
; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2,+v7 %s -o - | FileCheck %s
|
2009-06-27 06:37:07 +08:00
|
|
|
|
|
|
|
define i32 @f1(i32 %a) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: f1:
|
2009-08-11 07:56:04 +08:00
|
|
|
; CHECK: rev r0, r0
|
2009-06-27 06:37:07 +08:00
|
|
|
%tmp = tail call i32 @llvm.bswap.i32(i32 %a)
|
|
|
|
ret i32 %tmp
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i32 @llvm.bswap.i32(i32) nounwind readnone
|
2009-08-18 13:43:23 +08:00
|
|
|
|
|
|
|
define i32 @f2(i32 %X) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: f2:
|
2009-08-18 13:43:23 +08:00
|
|
|
; 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
|
|
|
|
}
|