1 # RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -target-abi=o32 | FileCheck %s --check-prefixes=ALL,O32-N32-NO-PIC
2 # RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -target-abi=o32 -position-independent | FileCheck %s --check-prefixes=ALL,O32-N32-PIC
3 # RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips64 -target-abi=n32 | FileCheck %s --check-prefixes=ALL,O32-N32-NO-PIC
4 # RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips64 -target-abi=n32 -position-independent | FileCheck %s --check-prefixes=ALL,O32-N32-PIC
5 # RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips64 -target-abi=n64 | FileCheck %s --check-prefixes=ALL,N64-NO-PIC
6 # RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips64 -target-abi=n64 -position-independent | FileCheck %s --check-prefixes=ALL,N64-PIC
9 # ALL: addiu $4, $zero, 0 # encoding: [0x00,0x00,0x04,0x24]
12 # ALL: addiu $4, $zero, 0 # encoding: [0x00,0x00,0x04,0x24]
15 # ALL: lui $4, 16271 # encoding: [0x8f,0x3f,0x04,0x3c]
16 # ALL: ori $4, $4, 52534 # encoding: [0x36,0xcd,0x84,0x34]
19 # ALL: lui $4, 16256 # encoding: [0x80,0x3f,0x04,0x3c]
22 # ALL: lui $4, 16256 # encoding: [0x80,0x3f,0x04,0x3c]
25 # ALL: lui $4, 20535 # encoding: [0x37,0x50,0x04,0x3c]
26 # ALL: ori $4, $4, 63239 # encoding: [0x07,0xf7,0x84,0x34]
28 li.s $
4, 12345678910.0
29 # ALL: lui $4, 20535 # encoding: [0x37,0x50,0x04,0x3c]
30 # ALL: ori $4, $4, 63239 # encoding: [0x07,0xf7,0x84,0x34]
33 # ALL: lui $4, 16076 # encoding: [0xcc,0x3e,0x04,0x3c]
34 # ALL: ori $4, $4, 52429 # encoding: [0xcd,0xcc,0x84,0x34]
37 # ALL: lui $4, 16320 # encoding: [0xc0,0x3f,0x04,0x3c]
39 li.s $
4, 12345678910.12345678910
40 # ALL: lui $4, 20535 # encoding: [0x37,0x50,0x04,0x3c]
41 # ALL: ori $4, $4, 63239 # encoding: [0x07,0xf7,0x84,0x34]
43 li.s $
4, 12345678910123456789.12345678910
44 # ALL: lui $4, 24363 # encoding: [0x2b,0x5f,0x04,0x3c]
45 # ALL: ori $4, $4, 21674 # encoding: [0xaa,0x54,0x84,0x34]
48 # ALL: mtc1 $zero, $f4 # encoding: [0x00,0x20,0x80,0x44]
51 # ALL: mtc1 $zero, $f4 # encoding: [0x00,0x20,0x80,0x44]
54 # ALL: .section .rodata,"a",@progbits
55 # ALL: [[LABEL:\$tmp[0-9]+]]:
56 # ALL: .4byte 1066388790
58 # O32-N32-PIC: lw $1, %got([[LABEL]])($gp) # encoding: [A,A,0x81,0x8f]
59 # O32-N32-PIC: # fixup A - offset: 0, value: %got([[LABEL]]), kind: fixup_Mips_GOT
60 # O32-N32-NO-PIC: lui $1, %hi([[LABEL]]) # encoding: [A,A,0x01,0x3c]
61 # O32-N32-NO-PIC: # fixup A - offset: 0, value: %hi([[LABEL]]), kind: fixup_Mips_HI16
62 # N64-PIC: ld $1, %got([[LABEL]])($gp) # encoding: [A,A,0x81,0xdf]
63 # N64-PIC: # fixup A - offset: 0, value: %got([[LABEL]]), kind: fixup_Mips_GOT
64 # N64-NO-PIC: lui $1, %highest([[LABEL]]) # encoding: [A,A,0x01,0x3c]
65 # N64-NO-PIC: # fixup A - offset: 0, value: %highest([[LABEL]]), kind: fixup_Mips_HIGHEST
66 # N64-NO-PIC: daddiu $1, $1, %higher([[LABEL]]) # encoding: [A,A,0x21,0x64]
67 # N64-NO-PIC: # fixup A - offset: 0, value: %higher([[LABEL]]), kind: fixup_Mips_HIGHER
68 # N64-NO-PIC: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
69 # N64-NO-PIC: daddiu $1, $1, %hi([[LABEL]]) # encoding: [A,A,0x21,0x64]
70 # N64-NO-PIC: # fixup A - offset: 0, value: %hi([[LABEL]]), kind: fixup_Mips_HI16
71 # N64-NO-PIC: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
72 # ALL: lwc1 $f4, %lo([[LABEL]])($1) # encoding: [A,A,0x24,0xc4]
73 # ALL: # fixup A - offset: 0, value: %lo([[LABEL]]), kind: fixup_Mips_LO16
76 # ALL: lui $1, 16256 # encoding: [0x80,0x3f,0x01,0x3c]
77 # ALL: mtc1 $1, $f4 # encoding: [0x00,0x20,0x81,0x44]
80 # ALL: lui $1, 16256 # encoding: [0x80,0x3f,0x01,0x3c]
81 # ALL: mtc1 $1, $f4 # encoding: [0x00,0x20,0x81,0x44]
84 # ALL: .section .rodata,"a",@progbits
85 # ALL: [[LABEL:\$tmp[0-9]+]]:
86 # ALL: .4byte 1345844999
88 # O32-N32-PIC: lw $1, %got([[LABEL]])($gp) # encoding: [A,A,0x81,0x8f]
89 # O32-N32-PIC: # fixup A - offset: 0, value: %got([[LABEL]]), kind: fixup_Mips_GOT
90 # O32-N32-NO-PIC: lui $1, %hi([[LABEL]]) # encoding: [A,A,0x01,0x3c]
91 # O32-N32-NO-PIC: # fixup A - offset: 0, value: %hi([[LABEL]]), kind: fixup_Mips_HI16
92 # N64-PIC: ld $1, %got([[LABEL]])($gp) # encoding: [A,A,0x81,0xdf]
93 # N64-PIC: # fixup A - offset: 0, value: %got([[LABEL]]), kind: fixup_Mips_GOT
94 # N64-NO-PIC: lui $1, %highest([[LABEL]]) # encoding: [A,A,0x01,0x3c]
95 # N64-NO-PIC: # fixup A - offset: 0, value: %highest([[LABEL]]), kind: fixup_Mips_HIGHEST
96 # N64-NO-PIC: daddiu $1, $1, %higher([[LABEL]]) # encoding: [A,A,0x21,0x64]
97 # N64-NO-PIC: # fixup A - offset: 0, value: %higher([[LABEL]]), kind: fixup_Mips_HIGHER
98 # N64-NO-PIC: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
99 # N64-NO-PIC: daddiu $1, $1, %hi([[LABEL]]) # encoding: [A,A,0x21,0x64]
100 # N64-NO-PIC: # fixup A - offset: 0, value: %hi([[LABEL]]), kind: fixup_Mips_HI16
101 # N64-NO-PIC: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
102 # ALL: lwc1 $f4, %lo([[LABEL]])($1) # encoding: [A,A,0x24,0xc4]
103 # ALL: # fixup A - offset: 0, value: %lo([[LABEL]]), kind: fixup_Mips_LO16
105 li.s $
f4, 12345678910.0
106 # ALL: .section .rodata,"a",@progbits
107 # ALL: [[LABEL:\$tmp[0-9]+]]:
108 # ALL: .4byte 1345844999
110 # O32-N32-PIC: lw $1, %got([[LABEL]])($gp) # encoding: [A,A,0x81,0x8f]
111 # O32-N32-PIC: # fixup A - offset: 0, value: %got([[LABEL]]), kind: fixup_Mips_GOT
112 # O32-N32-NO-PIC: lui $1, %hi([[LABEL]]) # encoding: [A,A,0x01,0x3c]
113 # O32-N32-NO-PIC: # fixup A - offset: 0, value: %hi([[LABEL]]), kind: fixup_Mips_HI16
114 # N64-PIC: ld $1, %got([[LABEL]])($gp) # encoding: [A,A,0x81,0xdf]
115 # N64-PIC: # fixup A - offset: 0, value: %got([[LABEL]]), kind: fixup_Mips_GOT
116 # N64-NO-PIC: lui $1, %highest([[LABEL]]) # encoding: [A,A,0x01,0x3c]
117 # N64-NO-PIC: # fixup A - offset: 0, value: %highest([[LABEL]]), kind: fixup_Mips_HIGHEST
118 # N64-NO-PIC: daddiu $1, $1, %higher([[LABEL]]) # encoding: [A,A,0x21,0x64]
119 # N64-NO-PIC: # fixup A - offset: 0, value: %higher([[LABEL]]), kind: fixup_Mips_HIGHER
120 # N64-NO-PIC: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
121 # N64-NO-PIC: daddiu $1, $1, %hi([[LABEL]]) # encoding: [A,A,0x21,0x64]
122 # N64-NO-PIC: # fixup A - offset: 0, value: %hi([[LABEL]]), kind: fixup_Mips_HI16
123 # N64-NO-PIC: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
124 # ALL: lwc1 $f4, %lo([[LABEL]])($1) # encoding: [A,A,0x24,0xc4]
125 # ALL: # fixup A - offset: 0, value: %lo([[LABEL]]), kind: fixup_Mips_LO16
129 # ALL: .section .rodata,"a",@progbits
130 # ALL: [[LABEL:\$tmp[0-9]+]]:
131 # ALL: .4byte 1053609165
133 # O32-N32-PIC: lw $1, %got([[LABEL]])($gp) # encoding: [A,A,0x81,0x8f]
134 # O32-N32-PIC: # fixup A - offset: 0, value: %got([[LABEL]]), kind: fixup_Mips_GOT
135 # O32-N32-NO-PIC: lui $1, %hi([[LABEL]]) # encoding: [A,A,0x01,0x3c]
136 # O32-N32-NO-PIC: # fixup A - offset: 0, value: %hi([[LABEL]]), kind: fixup_Mips_HI16
137 # N64-PIC: ld $1, %got([[LABEL]])($gp) # encoding: [A,A,0x81,0xdf]
138 # N64-PIC: # fixup A - offset: 0, value: %got([[LABEL]]), kind: fixup_Mips_GOT
139 # N64-NO-PIC: lui $1, %highest([[LABEL]]) # encoding: [A,A,0x01,0x3c]
140 # N64-NO-PIC: # fixup A - offset: 0, value: %highest([[LABEL]]), kind: fixup_Mips_HIGHEST
141 # N64-NO-PIC: daddiu $1, $1, %higher([[LABEL]]) # encoding: [A,A,0x21,0x64]
142 # N64-NO-PIC: # fixup A - offset: 0, value: %higher([[LABEL]]), kind: fixup_Mips_HIGHER
143 # N64-NO-PIC: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
144 # N64-NO-PIC: daddiu $1, $1, %hi([[LABEL]]) # encoding: [A,A,0x21,0x64]
145 # N64-NO-PIC: # fixup A - offset: 0, value: %hi([[LABEL]]), kind: fixup_Mips_HI16
146 # N64-NO-PIC: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
147 # ALL: lwc1 $f4, %lo([[LABEL]])($1) # encoding: [A,A,0x24,0xc4]
148 # ALL: # fixup A - offset: 0, value: %lo([[LABEL]]), kind: fixup_Mips_LO16
151 # ALL: lui $1, 16320 # encoding: [0xc0,0x3f,0x01,0x3c]
152 # ALL: mtc1 $1, $f4 # encoding: [0x00,0x20,0x81,0x44]
154 li.s $
f4, 12345678910.12345678910
155 # ALL: .section .rodata,"a",@progbits
156 # ALL: [[LABEL:\$tmp[0-9]+]]:
157 # ALL: .4byte 1345844999
159 # O32-N32-PIC: lw $1, %got([[LABEL]])($gp) # encoding: [A,A,0x81,0x8f]
160 # O32-N32-PIC: # fixup A - offset: 0, value: %got([[LABEL]]), kind: fixup_Mips_GOT
161 # O32-N32-NO-PIC: lui $1, %hi([[LABEL]]) # encoding: [A,A,0x01,0x3c]
162 # O32-N32-NO-PIC: # fixup A - offset: 0, value: %hi([[LABEL]]), kind: fixup_Mips_HI16
163 # N64-PIC: ld $1, %got([[LABEL]])($gp) # encoding: [A,A,0x81,0xdf]
164 # N64-PIC: # fixup A - offset: 0, value: %got([[LABEL]]), kind: fixup_Mips_GOT
165 # N64-NO-PIC: lui $1, %highest([[LABEL]]) # encoding: [A,A,0x01,0x3c]
166 # N64-NO-PIC: # fixup A - offset: 0, value: %highest([[LABEL]]), kind: fixup_Mips_HIGHEST
167 # N64-NO-PIC: daddiu $1, $1, %higher([[LABEL]]) # encoding: [A,A,0x21,0x64]
168 # N64-NO-PIC: # fixup A - offset: 0, value: %higher([[LABEL]]), kind: fixup_Mips_HIGHER
169 # N64-NO-PIC: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
170 # N64-NO-PIC: daddiu $1, $1, %hi([[LABEL]]) # encoding: [A,A,0x21,0x64]
171 # N64-NO-PIC: # fixup A - offset: 0, value: %hi([[LABEL]]), kind: fixup_Mips_HI16
172 # N64-NO-PIC: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
173 # ALL: lwc1 $f4, %lo([[LABEL]])($1) # encoding: [A,A,0x24,0xc4]
174 # ALL: # fixup A - offset: 0, value: %lo([[LABEL]]), kind: fixup_Mips_LO16
176 li.s $
f4, 12345678910123456789.12345678910
177 # ALL: .section .rodata,"a",@progbits
178 # ALL: [[LABEL:\$tmp[0-9]+]]:
179 # ALL: .4byte 1596675242
181 # O32-N32-PIC: lw $1, %got([[LABEL]])($gp) # encoding: [A,A,0x81,0x8f]
182 # O32-N32-PIC: # fixup A - offset: 0, value: %got([[LABEL]]), kind: fixup_Mips_GOT
183 # O32-N32-NO-PIC: lui $1, %hi([[LABEL]]) # encoding: [A,A,0x01,0x3c]
184 # O32-N32-NO-PIC: # fixup A - offset: 0, value: %hi([[LABEL]]), kind: fixup_Mips_HI16
185 # N64-PIC: ld $1, %got([[LABEL]])($gp) # encoding: [A,A,0x81,0xdf]
186 # N64-PIC: # fixup A - offset: 0, value: %got([[LABEL]]), kind: fixup_Mips_GOT
187 # N64-NO-PIC: lui $1, %highest([[LABEL]]) # encoding: [A,A,0x01,0x3c]
188 # N64-NO-PIC: # fixup A - offset: 0, value: %highest([[LABEL]]), kind: fixup_Mips_HIGHEST
189 # N64-NO-PIC: daddiu $1, $1, %higher([[LABEL]]) # encoding: [A,A,0x21,0x64]
190 # N64-NO-PIC: # fixup A - offset: 0, value: %higher([[LABEL]]), kind: fixup_Mips_HIGHER
191 # N64-NO-PIC: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
192 # N64-NO-PIC: daddiu $1, $1, %hi([[LABEL]]) # encoding: [A,A,0x21,0x64]
193 # N64-NO-PIC: # fixup A - offset: 0, value: %hi([[LABEL]]), kind: fixup_Mips_HI16
194 # N64-NO-PIC: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
195 # ALL: lwc1 $f4, %lo([[LABEL]])($1) # encoding: [A,A,0x24,0xc4]
196 # ALL: # fixup A - offset: 0, value: %lo([[LABEL]]), kind: fixup_Mips_LO16