Home | History | Annotate | Download | only in ARM
      1 ; RUN: llc < %s -march=arm -mattr=+v4t | FileCheck %s
      2 
      3 ;; Integer absolute value, should produce something as good as: ARM:
      4 ;;   add r3, r0, r0, asr #31
      5 ;;   eor r0, r3, r0, asr #31
      6 ;;   bx lr
      7 
      8 define i32 @test(i32 %a) {
      9         %tmp1neg = sub i32 0, %a
     10         %b = icmp sgt i32 %a, -1
     11         %abs = select i1 %b, i32 %a, i32 %tmp1neg
     12         ret i32 %abs
     13 ; CHECK:   add r1, r0, r0, asr #31
     14 ; CHECK:   eor r0, r1, r0, asr #31
     15 ; CHECK:  bx lr
     16 }
     17