2010-11-13 00:27:47 +00:00
|
|
|
; RUN: llc < %s -march=arm | FileCheck %s --check-prefix=ARM
|
2010-11-13 02:25:14 +00:00
|
|
|
; RUN: llc < %s -march=arm -mattr=+thumb2 | FileCheck %s --check-prefix=ARMT2
|
|
|
|
; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s --check-prefix=THUMB2
|
2009-11-20 00:54:03 +00:00
|
|
|
|
2010-06-17 15:18:27 +00:00
|
|
|
define i32 @t1(i32 %c) nounwind readnone {
|
2009-11-20 00:54:03 +00:00
|
|
|
entry:
|
|
|
|
; ARM: t1:
|
2011-05-03 22:31:21 +00:00
|
|
|
; ARM: mov [[R1:r[0-9]+]], #101
|
|
|
|
; ARM: orr [[R1b:r[0-9]+]], [[R1]], #1, #24
|
2009-11-20 00:54:03 +00:00
|
|
|
; ARM: movgt r0, #123
|
|
|
|
|
2010-11-13 02:25:14 +00:00
|
|
|
; ARMT2: t1:
|
|
|
|
; ARMT2: movw r0, #357
|
|
|
|
; ARMT2: movgt r0, #123
|
|
|
|
|
|
|
|
; THUMB2: t1:
|
|
|
|
; THUMB2: movw r0, #357
|
|
|
|
; THUMB2: movgt r0, #123
|
2009-11-20 00:54:03 +00:00
|
|
|
|
|
|
|
%0 = icmp sgt i32 %c, 1
|
|
|
|
%1 = select i1 %0, i32 123, i32 357
|
|
|
|
ret i32 %1
|
|
|
|
}
|
|
|
|
|
2010-06-17 15:18:27 +00:00
|
|
|
define i32 @t2(i32 %c) nounwind readnone {
|
2009-11-20 00:54:03 +00:00
|
|
|
entry:
|
|
|
|
; ARM: t2:
|
2010-11-13 02:25:14 +00:00
|
|
|
; ARM: mov r0, #123
|
|
|
|
; ARM: movgt r0, #101
|
2011-04-05 18:41:40 +00:00
|
|
|
; ARM: orrgt r0, r0, #1, #24
|
2009-11-20 00:54:03 +00:00
|
|
|
|
2010-11-13 02:25:14 +00:00
|
|
|
; ARMT2: t2:
|
|
|
|
; ARMT2: mov r0, #123
|
|
|
|
; ARMT2: movwgt r0, #357
|
|
|
|
|
|
|
|
; THUMB2: t2:
|
2011-05-03 22:31:21 +00:00
|
|
|
; THUMB2: mov{{(s|\.w)}} r0, #123
|
2010-11-13 02:25:14 +00:00
|
|
|
; THUMB2: movwgt r0, #357
|
2009-11-20 00:54:03 +00:00
|
|
|
|
|
|
|
%0 = icmp sgt i32 %c, 1
|
|
|
|
%1 = select i1 %0, i32 357, i32 123
|
|
|
|
ret i32 %1
|
|
|
|
}
|
|
|
|
|
2010-06-17 15:18:27 +00:00
|
|
|
define i32 @t3(i32 %a) nounwind readnone {
|
2009-11-20 00:54:03 +00:00
|
|
|
entry:
|
|
|
|
; ARM: t3:
|
|
|
|
; ARM: mov r0, #0
|
|
|
|
; ARM: moveq r0, #1
|
|
|
|
|
2010-11-13 02:25:14 +00:00
|
|
|
; ARMT2: t3:
|
|
|
|
; ARMT2: mov r0, #0
|
|
|
|
; ARMT2: moveq r0, #1
|
|
|
|
|
|
|
|
; THUMB2: t3:
|
2011-05-03 22:31:21 +00:00
|
|
|
; THUMB2: mov{{(s|\.w)}} r0, #0
|
2010-11-13 02:25:14 +00:00
|
|
|
; THUMB2: moveq r0, #1
|
2009-11-20 00:54:03 +00:00
|
|
|
%0 = icmp eq i32 %a, 160
|
|
|
|
%1 = zext i1 %0 to i32
|
|
|
|
ret i32 %1
|
|
|
|
}
|
2010-11-13 00:27:47 +00:00
|
|
|
|
|
|
|
define i32 @t4(i32 %a, i32 %b, i32 %x) nounwind {
|
|
|
|
entry:
|
|
|
|
; ARM: t4:
|
|
|
|
; ARM: ldr
|
|
|
|
; ARM: movlt
|
|
|
|
|
2010-11-13 02:25:14 +00:00
|
|
|
; ARMT2: t4:
|
2011-05-03 22:31:21 +00:00
|
|
|
; ARMT2: movwlt [[R0:r[0-9]+]], #65365
|
|
|
|
; ARMT2: movtlt [[R0]], #65365
|
2010-11-13 02:25:14 +00:00
|
|
|
|
|
|
|
; THUMB2: t4:
|
2011-05-03 22:31:21 +00:00
|
|
|
; THUMB2: mvnlt.w [[R0:r[0-9]+]], #11141290
|
2010-11-13 00:27:47 +00:00
|
|
|
%0 = icmp slt i32 %a, %b
|
|
|
|
%1 = select i1 %0, i32 4283826005, i32 %x
|
|
|
|
ret i32 %1
|
|
|
|
}
|