Home | History | Annotate | Download | only in Thumb2
      1 ; RUN: llc < %s -march=thumb -mattr=+thumb2 -join-physregs | FileCheck %s
      2 
      3 ; These tests implicitly depend on 'movs r0, #0' being rematerialized below the
      4 ; test as 'mov.w r0, #0'. So far, that requires physreg joining.
      5 
      6 define i1 @f1(i32 %a, i32 %b) {
      7     %nb = sub i32 0, %b
      8     %tmp = icmp ne i32 %a, %nb
      9     ret i1 %tmp
     10 }
     11 ; CHECK: f1:
     12 ; CHECK: 	cmn.w	r0, r1
     13 
     14 define i1 @f2(i32 %a, i32 %b) {
     15     %nb = sub i32 0, %b
     16     %tmp = icmp ne i32 %nb, %a
     17     ret i1 %tmp
     18 }
     19 ; CHECK: f2:
     20 ; CHECK: 	cmn.w	r0, r1
     21 
     22 define i1 @f3(i32 %a, i32 %b) {
     23     %nb = sub i32 0, %b
     24     %tmp = icmp eq i32 %a, %nb
     25     ret i1 %tmp
     26 }
     27 ; CHECK: f3:
     28 ; CHECK: 	cmn.w	r0, r1
     29 
     30 define i1 @f4(i32 %a, i32 %b) {
     31     %nb = sub i32 0, %b
     32     %tmp = icmp eq i32 %nb, %a
     33     ret i1 %tmp
     34 }
     35 ; CHECK: f4:
     36 ; CHECK: 	cmn.w	r0, r1
     37 
     38 define i1 @f5(i32 %a, i32 %b) {
     39     %tmp = shl i32 %b, 5
     40     %nb = sub i32 0, %tmp
     41     %tmp1 = icmp eq i32 %nb, %a
     42     ret i1 %tmp1
     43 }
     44 ; CHECK: f5:
     45 ; CHECK: 	cmn.w	r0, r1, lsl #5
     46 
     47 define i1 @f6(i32 %a, i32 %b) {
     48     %tmp = lshr i32 %b, 6
     49     %nb = sub i32 0, %tmp
     50     %tmp1 = icmp ne i32 %nb, %a
     51     ret i1 %tmp1
     52 }
     53 ; CHECK: f6:
     54 ; CHECK: 	cmn.w	r0, r1, lsr #6
     55 
     56 define i1 @f7(i32 %a, i32 %b) {
     57     %tmp = ashr i32 %b, 7
     58     %nb = sub i32 0, %tmp
     59     %tmp1 = icmp eq i32 %a, %nb
     60     ret i1 %tmp1
     61 }
     62 ; CHECK: f7:
     63 ; CHECK: 	cmn.w	r0, r1, asr #7
     64 
     65 define i1 @f8(i32 %a, i32 %b) {
     66     %l8 = shl i32 %a, 24
     67     %r8 = lshr i32 %a, 8
     68     %tmp = or i32 %l8, %r8
     69     %nb = sub i32 0, %tmp
     70     %tmp1 = icmp ne i32 %a, %nb
     71     ret i1 %tmp1
     72 }
     73 ; CHECK: f8:
     74 ; CHECK: 	cmn.w	r0, r0, ror #8
     75 
     76