summaryrefslogtreecommitdiff
path: root/test/CodeGen/ARM/subtarget-no-movt.ll
blob: fb0d5adc3f48bf388f1581273e846aedf457c26b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - | FileCheck -check-prefix=NO-OPTION %s
; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - -mattr=-no-movt | FileCheck -check-prefix=USE-MOVT %s
; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - -mattr=+no-movt | FileCheck -check-prefix=NO-USE-MOVT %s
; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - -O0 | FileCheck -check-prefix=NO-OPTION-O0 %s
; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - -O0 -mattr=-no-movt | FileCheck -check-prefix=USE-MOVT-O0 %s
; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - -O0 -mattr=+no-movt | FileCheck -check-prefix=NO-USE-MOVT-O0 %s

target triple = "thumb-apple-darwin"

; NO-OPTION-LABEL: {{_?}}foo0
; NO-OPTION: ldr [[R0:r[0-9]+]], [[L0:.*]]
; NO-OPTION: [[L0]]:
; NO-OPTION: .long 2296237089

; NO-OPTION-O0-LABEL: {{_?}}foo0
; NO-OPTION-O0: ldr [[R0:r[0-9]+]], [[L0:.*]]
; NO-OPTION-O0: [[L0]]:
; NO-OPTION-O0: .long 2296237089

; USE-MOVT-LABEL: {{_?}}foo0
; USE-MOVT: movw [[R0:r[0-9]+]], #52257
; USE-MOVT: movt [[R0]], #35037

; USE-MOVT-O0-LABEL: {{_?}}foo0
; USE-MOVT-O0: movw [[R0:r[0-9]+]], #52257
; USE-MOVT-O0: movt [[R0]], #35037

; NO-USE-MOVT-LABEL: {{_?}}foo0
; NO-USE-MOVT: ldr [[R0:r[0-9]+]], [[L0:.*]]
; NO-USE-MOVT: [[L0]]:
; NO-USE-MOVT: .long 2296237089

; NO-USE-MOVT-O0-LABEL: {{_?}}foo0
; NO-USE-MOVT-O0: ldr [[R0:r[0-9]+]], [[L0:.*]]
; NO-USE-MOVT-O0: [[L0]]:
; NO-USE-MOVT-O0: .long 2296237089

define i32 @foo0(i32 %a) #0 {
  %1 = xor i32 -1998730207, %a
  ret i32 %1
}

; NO-OPTION-LABEL: {{_?}}foo1
; NO-OPTION: movw [[R0:r[0-9]+]], #52257
; NO-OPTION: movt [[R0]], #35037

; NO-OPTION-O0-LABEL: {{_?}}foo1
; NO-OPTION-O0: movw [[R0:r[0-9]+]], #52257
; NO-OPTION-O0: movt [[R0]], #35037

; USE-MOVT-LABEL: {{_?}}foo1
; USE-MOVT: movw [[R0:r[0-9]+]], #52257
; USE-MOVT: movt [[R0]], #35037

; USE-MOVT-O0-LABEL: {{_?}}foo1
; USE-MOVT-O0: movw [[R0:r[0-9]+]], #52257
; USE-MOVT-O0: movt [[R0]], #35037

; NO-USE-MOVT-LABEL: {{_?}}foo1
; NO-USE-MOVT: ldr [[R0:r[0-9]+]], [[L0:.*]]
; NO-USE-MOVT: [[L0]]:
; NO-USE-MOVT: .long 2296237089

; NO-USE-MOVT-O0-LABEL: {{_?}}foo1
; NO-USE-MOVT-O0: ldr [[R0:r[0-9]+]], [[L0:.*]]
; NO-USE-MOVT-O0: [[L0]]:
; NO-USE-MOVT-O0: .long 2296237089

define i32 @foo1(i32 %a) {
  %1 = xor i32 -1998730207, %a
  ret i32 %1
}

; NO-OPTION-LABEL: {{_?}}foo2
; NO-OPTION:   mov.w	[[R0:r[0-9]+]], #-536813568

; USE-MOVT-LABEL: {{_?}}foo2
; USE-MOVT:    mov.w	[[R0:r[0-9]+]], #-536813568

; NO-USE-MOVT-LABEL: {{_?}}foo2
; NO-USE-MOVT: mov.w	[[R0:r[0-9]+]], #-536813568

; NO-OPTION-O0-LABEL: {{_?}}foo2
; NO-OPTION-O0: movw	[[R0:r[0-9]+]], #57344
; NO-OPTION-O0: movt	[[R0]], #57344

; USE-MOVT-O0-LABEL: {{_?}}foo2
; USE-MOVT-O0:  movw	[[R0:r[0-9]+]], #57344
; USE-MOVTT-O0: movt	[[R0]], #57344

; NO-USE-MOVT-O0-LABEL: {{_?}}foo2
; NO-USE-MOVT-O0: ldr [[R0:r[0-9]+]], [[L0:.*]]
; NO-USE-MOVT-O0: [[L0]]:
; NO-USE-MOVT-O0: .long 3758153728     @ 0xe000e000
define i32 @foo2() {
  %1 = load i32, i32* inttoptr (i32 -536813568 to i32*) ; load from 0xe000e000
  ret i32 %1
}
attributes #0 = { "target-features"="+no-movt" }