Home | History | Annotate | Download | only in Thumb2
      1 ; RUN: llc < %s -march=thumb -mcpu=cortex-a8 | FileCheck %s --check-prefix=A8
      2 ; RUN: llc < %s -march=thumb -mcpu=cortex-m3 | FileCheck %s --check-prefix=M3
      3 ; rdar://11318438
      4 
      5 define zeroext i8 @test1(i32 %A.u)  {
      6 ; A8: test1
      7 ; A8: uxtb r0, r0
      8     %B.u = trunc i32 %A.u to i8
      9     ret i8 %B.u
     10 }
     11 
     12 define zeroext i32 @test2(i32 %A.u, i32 %B.u)  {
     13 ; A8: test2
     14 ; A8: uxtab  r0, r0, r1
     15 
     16 ; M3: test2
     17 ; M3: uxtb  r1, r1
     18 ; M3-NOT: uxtab
     19 ; M3: add   r0, r1
     20     %C.u = trunc i32 %B.u to i8
     21     %D.u = zext i8 %C.u to i32
     22     %E.u = add i32 %A.u, %D.u
     23     ret i32 %E.u
     24 }
     25 
     26 define zeroext i32 @test3(i32 %A.u)  {
     27 ; A8: test3
     28 ; A8: uxth.w r0, r0, ror #8
     29     %B.u = lshr i32 %A.u, 8
     30     %C.u = shl i32 %A.u, 24
     31     %D.u = or i32 %B.u, %C.u
     32     %E.u = trunc i32 %D.u to i16
     33     %F.u = zext i16 %E.u to i32
     34     ret i32 %F.u
     35 }
     36