[MIPS GlobalISel] Select MSA vector generic and builtin add
[llvm-core.git] / test / CodeGen / Mips / inlineasm-constraint-ZC-1.ll
blob59778df3b4230d6b75a083b5fea4c4bd8764b062
1 ; RUN: llc -march=mipsel -mcpu=mips32r6 -relocation-model=pic < %s | FileCheck %s -check-prefixes=ALL,09BIT
2 ; RUN: llc -march=mipsel -mattr=+micromips -relocation-model=pic < %s | FileCheck %s -check-prefixes=ALL,12BIT
3 ; RUN: llc -march=mipsel -relocation-model=pic < %s | FileCheck %s -check-prefixes=ALL,16BIT
5 @data = global [8193 x i32] zeroinitializer
7 define void @ZC(i32 *%p) nounwind {
8 entry:
9   ; ALL-LABEL: ZC:
11   call void asm sideeffect "lw $$1, $0", "*^ZC,~{$1}"(i32* getelementptr inbounds ([8193 x i32], [8193 x i32]* @data, i32 0, i32 0))
13   ; ALL: lw $[[BASEPTR:[0-9]+]], %got(data)(
14   ; ALL: #APP
15   ; ALL: lw $1, 0($[[BASEPTR]])
16   ; ALL: #NO_APP
18   ret void
21 define void @ZC_offset_n4(i32 *%p) nounwind {
22 entry:
23   ; ALL-LABEL: ZC_offset_n4:
25   call void asm sideeffect "lw $$1, $0", "*^ZC,~{$1}"(i32* getelementptr inbounds ([8193 x i32], [8193 x i32]* @data, i32 0, i32 -1))
27   ; ALL: lw $[[BASEPTR:[0-9]+]], %got(data)(
28   ; ALL: #APP
29   ; ALL: lw $1, -4($[[BASEPTR]])
30   ; ALL: #NO_APP
32   ret void
35 define void @ZC_offset_4(i32 *%p) nounwind {
36 entry:
37   ; ALL-LABEL: ZC_offset_4:
39   call void asm sideeffect "lw $$1, $0", "*^ZC,~{$1}"(i32* getelementptr inbounds ([8193 x i32], [8193 x i32]* @data, i32 0, i32 1))
41   ; ALL: lw $[[BASEPTR:[0-9]+]], %got(data)(
42   ; ALL: #APP
43   ; ALL: lw $1, 4($[[BASEPTR]])
44   ; ALL: #NO_APP
46   ret void
49 define void @ZC_offset_252(i32 *%p) nounwind {
50 entry:
51   ; ALL-LABEL: ZC_offset_252:
53   call void asm sideeffect "lw $$1, $0", "*^ZC,~{$1}"(i32* getelementptr inbounds ([8193 x i32], [8193 x i32]* @data, i32 0, i32 63))
55   ; ALL: lw $[[BASEPTR:[0-9]+]], %got(data)(
56   ; ALL: #APP
57   ; ALL: lw $1, 252($[[BASEPTR]])
58   ; ALL: #NO_APP
60   ret void
63 define void @ZC_offset_256(i32 *%p) nounwind {
64 entry:
65   ; ALL-LABEL: ZC_offset_256:
67   call void asm sideeffect "lw $$1, $0", "*^ZC,~{$1}"(i32* getelementptr inbounds ([8193 x i32], [8193 x i32]* @data, i32 0, i32 64))
69   ; ALL: lw $[[BASEPTR:[0-9]+]], %got(data)(
71   ; 09BIT: addiu $[[BASEPTR2:[0-9]+]], $[[BASEPTR]], 256
73   ; ALL: #APP
75   ; 09BIT: lw $1, 0($[[BASEPTR2]])
76   ; 12BIT: lw $1, 256($[[BASEPTR]])
77   ; 16BIT: lw $1, 256($[[BASEPTR]])
79   ; ALL: #NO_APP
81   ret void
84 define void @ZC_offset_2044(i32 *%p) nounwind {
85 entry:
86   ; ALL-LABEL: ZC_offset_2044:
88   call void asm sideeffect "lw $$1, $0", "*^ZC,~{$1}"(i32* getelementptr inbounds ([8193 x i32], [8193 x i32]* @data, i32 0, i32 511))
90   ; ALL: lw $[[BASEPTR:[0-9]+]], %got(data)(
92   ; 09BIT: addiu $[[BASEPTR2:[0-9]+]], $[[BASEPTR]], 2044
94   ; ALL: #APP
96   ; 09BIT: lw $1, 0($[[BASEPTR2]])
97   ; 12BIT: lw $1, 2044($[[BASEPTR]])
98   ; 16BIT: lw $1, 2044($[[BASEPTR]])
100   ; ALL: #NO_APP
102   ret void
105 define void @ZC_offset_2048(i32 *%p) nounwind {
106 entry:
107   ; ALL-LABEL: ZC_offset_2048:
109   call void asm sideeffect "lw $$1, $0", "*^ZC,~{$1}"(i32* getelementptr inbounds ([8193 x i32], [8193 x i32]* @data, i32 0, i32 512))
111   ; ALL: lw $[[BASEPTR:[0-9]+]], %got(data)(
113   ; 09BIT: addiu $[[BASEPTR2:[0-9]+]], $[[BASEPTR]], 2048
114   ; 12BIT: addiu $[[BASEPTR2:[0-9]+]], $[[BASEPTR]], 2048
116   ; ALL: #APP
118   ; 09BIT: lw $1, 0($[[BASEPTR2]])
119   ; 12BIT: lw $1, 0($[[BASEPTR2]])
120   ; 16BIT: lw $1, 2048($[[BASEPTR]])
122   ; ALL: #NO_APP
124   ret void
127 define void @ZC_offset_32764(i32 *%p) nounwind {
128 entry:
129   ; ALL-LABEL: ZC_offset_32764:
131   call void asm sideeffect "lw $$1, $0", "*^ZC,~{$1}"(i32* getelementptr inbounds ([8193 x i32], [8193 x i32]* @data, i32 0, i32 8191))
133   ; ALL-DAG: lw $[[BASEPTR:[0-9]+]], %got(data)(
135   ; 09BIT: addiu $[[BASEPTR2:[0-9]+]], $[[BASEPTR]], 32764
136   ; 12BIT: addiu $[[BASEPTR2:[0-9]+]], $[[BASEPTR]], 32764
138   ; ALL: #APP
140   ; 09BIT: lw $1, 0($[[BASEPTR2]])
141   ; 12BIT: lw $1, 0($[[BASEPTR2]])
142   ; 16BIT: lw $1, 32764($[[BASEPTR]])
144   ; ALL: #NO_APP
146   ret void
149 define void @ZC_offset_32768(i32 *%p) nounwind {
150 entry:
151   ; ALL-LABEL: ZC_offset_32768:
153   call void asm sideeffect "lw $$1, $0", "*^ZC,~{$1}"(i32* getelementptr inbounds ([8193 x i32], [8193 x i32]* @data, i32 0, i32 8192))
155   ; ALL-DAG: lw $[[BASEPTR:[0-9]+]], %got(data)(
156   ; ALL-DAG: ori $[[T0:[0-9]+]], $zero, 32768
158   ; 09BIT: addu $[[BASEPTR2:[0-9]+]], $[[BASEPTR]], $[[T0]]
159   ; 12BIT: addu16 $[[BASEPTR2:[0-9]+]], $[[BASEPTR]], $[[T0]]
160   ; 16BIT: addu $[[BASEPTR2:[0-9]+]], $[[BASEPTR]], $[[T0]]
162   ; ALL: #APP
163   ; ALL: lw $1, 0($[[BASEPTR2]])
164   ; ALL: #NO_APP
166   ret void