1 ; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - | \
2 ; RUN: FileCheck -check-prefixes=CHECK,NO-OPTION,NO-OPTION-COMMON %s
3 ; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - -mattr=-no-movt | \
4 ; RUN: FileCheck -check-prefixes=CHECK,USE-MOVT,USE-MOVT-COMMON %s
5 ; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - -mattr=+no-movt | \
6 ; RUN: FileCheck -check-prefixes=CHECK,NO-USE-MOVT,NO-USE-MOVT-COMMON %s
7 ; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - -O0 | \
8 ; RUN: FileCheck -check-prefixes=CHECK,NO-OPTION-O0,NO-OPTION-COMMON %s
9 ; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - -O0 -mattr=-no-movt | \
10 ; RUN: FileCheck -check-prefixes=CHECK,USE-MOVT-O0,USE-MOVT-COMMON %s
11 ; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - -O0 -mattr=+no-movt | \
12 ; RUN: FileCheck -check-prefixes=CHECK,NO-USE-MOVT-O0,NO-USE-MOVT-COMMON %s
14 target triple = "thumb-apple-darwin"
16 ; NO-OPTION-COMMON-LABEL: {{_?}}foo0
17 ; NO-OPTION-COMMON: ldr [[R0:r[0-9]+]], [[L0:.*]]
18 ; NO-OPTION-COMMON: [[L0]]:
19 ; NO-OPTION-COMMON: .long 2296237089
21 ; USE-MOVT-COMMON-LABEL: {{_?}}foo0
22 ; USE-MOVT-COMMON: movw [[R0:r[0-9]+]], #52257
23 ; USE-MOVT-COMMON: movt [[R0]], #35037
25 ; NO-USE-MOVT-COMMON-LABEL: {{_?}}foo0
26 ; NO-USE-MOVT-COMMON: ldr [[R0:r[0-9]+]], [[L0:.*]]
27 ; NO-USE-MOVT-COMMON: [[L0]]:
28 ; NO-USE-MOVT-COMMON: .long 2296237089
30 define i32 @foo0(i32 %a) #0 {
31 %1 = xor i32 -1998730207, %a
35 ; NO-OPTION-COMMON-LABEL: {{_?}}foo1
36 ; NO-OPTION-COMMON: movw [[R0:r[0-9]+]], #52257
37 ; NO-OPTION-COMMON: movt [[R0]], #35037
39 ; USE-MOVT-COMMON-LABEL: {{_?}}foo1
40 ; USE-MOVT-COMMON: movw [[R0:r[0-9]+]], #52257
41 ; USE-MOVT-COMMON: movt [[R0]], #35037
43 ; NO-USE-MOVT-COMMON-LABEL: {{_?}}foo1
44 ; NO-USE-MOVT-COMMON: ldr [[R0:r[0-9]+]], [[L0:.*]]
45 ; NO-USE-MOVT-COMMON: [[L0]]:
46 ; NO-USE-MOVT-COMMON: .long 2296237089
48 define i32 @foo1(i32 %a) {
49 %1 = xor i32 -1998730207, %a
53 ; NO-OPTION-COMMON-LABEL: {{_?}}foo2
54 ; NO-OPTION: mov.w [[R0:r[0-9]+]], #-536813568
55 ; NO-OPTION-O0: movw [[R0:r[0-9]+]], #57344
56 ; NO-OPTION-O0: movt [[R0]], #57344
58 ; USE-MOVT-COMMON-LABEL: {{_?}}foo2
59 ; USE-MOVT: mov.w [[R0:r[0-9]+]], #-536813568
60 ; USE-MOVT-O0: movw [[R0:r[0-9]+]], #57344
61 ; USE-MOVT-O0: movt [[R0]], #57344
63 ; NO-USE-MOVT-COMMON-LABEL: {{_?}}foo2
64 ; NO-USE-MOVT: mov.w [[R0:r[0-9]+]], #-536813568
65 ; NO-USE-MOVT-O0: ldr [[R0:r[0-9]+]], [[L0:.*]]
66 ; NO-USE-MOVT-O0: [[L0]]:
67 ; NO-USE-MOVT-O0: .long 3758153728 @ 0xe000e000
70 %1 = load i32, ptr inttoptr (i32 -536813568 to ptr) ; load from 0xe000e000
73 attributes #0 = { "target-features"="+no-movt" }
75 define hidden i32 @no_litpool() minsize optsize {
76 ; CHECK-LABEL: no_litpool:
77 ; CHECK: mov.w r{{.}}, #65536
78 ; CHECK: mov.w r{{.}}, #-134217728
79 ; CHECK: mvn r{{.}}, #-134217728
81 %call0 = tail call i32 @eat_const(i32 65536)
82 %call1 = tail call i32 @eat_const(i32 -134217728)
83 %call2 = tail call i32 @eat_const(i32 134217727)
87 define hidden i32 @litpool() minsize optsize {
88 ; CHECK-LABEL: litpool:
89 ; CHECK: ldr r0, {{.*}}LCPI{{.*}}
90 ; CHECK-NEXT: b.w {{.*}}eat_const
92 %call1 = tail call i32 @eat_const(i32 8388601)
96 declare dso_local i32 @eat_const(i32)