Home | History | Annotate | Download | only in Thumb2
      1 ; RUN: llc < %s -march=thumb -mattr=+thumb2,+v7,+t2xtpk | FileCheck %s
      2 
      3 define i32 @f1(i32 %a) {
      4 ; CHECK-LABEL: f1:
      5 ; CHECK: rev r0, r0
      6     %tmp = tail call i32 @llvm.bswap.i32(i32 %a)
      7     ret i32 %tmp
      8 }
      9 
     10 declare i32 @llvm.bswap.i32(i32) nounwind readnone
     11 
     12 define i32 @f2(i32 %X) {
     13 ; CHECK-LABEL: f2:
     14 ; CHECK: revsh r0, r0
     15         %tmp1 = lshr i32 %X, 8
     16         %tmp1.upgrd.1 = trunc i32 %tmp1 to i16
     17         %tmp3 = trunc i32 %X to i16
     18         %tmp2 = and i16 %tmp1.upgrd.1, 255
     19         %tmp4 = shl i16 %tmp3, 8
     20         %tmp5 = or i16 %tmp2, %tmp4
     21         %tmp5.upgrd.2 = sext i16 %tmp5 to i32
     22         ret i32 %tmp5.upgrd.2
     23 }
     24