[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / Mips / scd-expansion.s
blob54a3baa5d68fe6754afeeaae3cf12a768a7dbdc8
1 # RUN: llvm-mc -filetype=obj -triple mips64 -mcpu=mips64 %s -o - \
2 # RUN: | llvm-objdump -d -r - | FileCheck %s --check-prefix=MIPS64
3 # RUN: llvm-mc -filetype=obj -triple mips64 -mcpu=mips64r6 %s -o - \
4 # RUN: | llvm-objdump -d -r - | FileCheck %s --check-prefix=MIPS64R6
6 scd $2, 128($sp)
7 # MIPS64: f3 a2 00 80 scd $2, 128($sp)
8 # MIPS64R6: 7f a2 40 27 scd $2, 128($sp)
10 scd $2, -128($sp)
11 # MIPS64: f3 a2 ff 80 scd $2, -128($sp)
12 # MIPS64R6: 7f a2 c0 27 scd $2, -128($sp)
14 scd $2, 256($sp)
15 # MIPS64: f3 a2 01 00 scd $2, 256($sp)
17 # MIPS64R6: 67 a1 01 00 daddiu $1, $sp, 256
18 # MIPS64R6-NEXT: 7c 22 00 27 scd $2, 0($1)
20 scd $2, -257($sp)
21 # MIPS64: f3 a2 fe ff scd $2, -257($sp)
23 # MIPS64R6: 67 a1 fe ff daddiu $1, $sp, -257
24 # MIPS64R6-NEXT: 7c 22 00 27 scd $2, 0($1)
26 scd $2, 32767($sp)
27 # MIPS64: f3 a2 7f ff scd $2, 32767($sp)
29 # MIPS64R6: 67 a1 7f ff daddiu $1, $sp, 32767
30 # MIPS64R6-NEXT: 7c 22 00 27 scd $2, 0($1)
32 scd $2, 32768($sp)
33 # MIPS64: 3c 01 00 01 lui $1, 1
34 # MIPS64-NEXT: 00 3d 08 2d daddu $1, $1, $sp
35 # MIPS64-NEXT: f0 22 80 00 scd $2, -32768($1)
37 # MIPS64R6: 34 01 80 00 ori $1, $zero, 32768
38 # MIPS64R6-NEXT: 00 3d 08 2d daddu $1, $1, $sp
39 # MIPS64R6-NEXT: 7c 22 00 27 scd $2, 0($1)
41 scd $2, -32768($sp)
42 # MIPS64: f3 a2 80 00 scd $2, -32768($sp)
44 # MIPS64R6: 67 a1 80 00 daddiu $1, $sp, -32768
45 # MIPS64R6-NEXT: 7c 22 00 27 scd $2, 0($1)
47 scd $2, -32769($sp)
48 # MIPS64: 3c 01 ff ff lui $1, 65535
49 # MIPS64-NEXT: 00 3d 08 2d daddu $1, $1, $sp
50 # MIPS64-NEXT: f0 22 7f ff scd $2, 32767($1)
52 # MIPS64R6: 3c 01 ff ff aui $1, $zero, 65535
53 # MIPS64R6-NEXT: 34 21 7f ff ori $1, $1, 32767
54 # MIPS64R6-NEXT: 00 3d 08 2d daddu $1, $1, $sp
55 # MIPS64R6-NEXT: 7c 22 00 27 scd $2, 0($1)
57 scd $2, 2147483648($sp)
58 # MIPS64: 34 01 80 00 ori $1, $zero, 32768
59 # MIPS64-NEXT: 00 01 0c 38 dsll $1, $1, 16
60 # MIPS64-NEXT: 00 3d 08 2d daddu $1, $1, $sp
61 # MIPS64-NEXT: f0 22 00 00 scd $2, 0($1)
63 # MIPS64R6: 34 01 80 00 ori $1, $zero, 32768
64 # MIPS64R6-NEXT: 00 01 0c 38 dsll $1, $1, 16
65 # MIPS64R6-NEXT: 00 3d 08 2d daddu $1, $1, $sp
66 # MIPS64R6-NEXT: 7c 22 00 27 scd $2, 0($1)
68 scd $2, -2147483648($sp)
69 # MIPS64: 3c 01 80 00 lui $1, 32768
70 # MIPS64-NEXT: 00 3d 08 2d daddu $1, $1, $sp
71 # MIPS64-NEXT: f0 22 00 00 scd $2, 0($1)
73 # MIPS64R6: 3c 01 80 00 aui $1, $zero, 32768
74 # MIPS64R6-NEXT: 00 3d 08 2d daddu $1, $1, $sp
75 # MIPS64R6-NEXT: 7c 22 00 27 scd $2, 0($1)
77 scd $2, 9223372036853775808($sp)
78 # MIPS64: 3c 01 7f ff lui $1, 32767
79 # MIPS64-NEXT: 34 21 ff ff ori $1, $1, 65535
80 # MIPS64-NEXT: 00 01 0c 38 dsll $1, $1, 16
81 # MIPS64-NEXT: 34 21 ff f1 ori $1, $1, 65521
82 # MIPS64-NEXT: 00 01 0c 38 dsll $1, $1, 16
83 # MIPS64-NEXT: 00 3d 08 2d daddu $1, $1, $sp
84 # MIPS64-NEXT: f0 22 bd c0 scd $2, -16960($1)
86 # MIPS64R6: 3c 01 7f ff aui $1, $zero, 32767
87 # MIPS64R6-NEXT: 34 21 ff ff ori $1, $1, 65535
88 # MIPS64R6-NEXT: 00 01 0c 38 dsll $1, $1, 16
89 # MIPS64R6-NEXT: 34 21 ff f0 ori $1, $1, 65520
90 # MIPS64R6-NEXT: 00 01 0c 38 dsll $1, $1, 16
91 # MIPS64R6-NEXT: 34 21 bd c0 ori $1, $1, 48576
92 # MIPS64R6-NEXT: 00 3d 08 2d daddu $1, $1, $sp
93 # MIPS64R6-NEXT: 7c 22 00 27 scd $2, 0($1)
95 scd $12, symbol
96 # MIPS64: 3c 01 00 00 lui $1, 0
97 # MIPS64-NEXT: R_MIPS_HIGHEST/R_MIPS_NONE/R_MIPS_NONE symbol
98 # MIPS64-NEXT: 64 21 00 00 daddiu $1, $1, 0
99 # MIPS64-NEXT: R_MIPS_HIGHER/R_MIPS_NONE/R_MIPS_NONE symbol
100 # MIPS64-NEXT: 00 01 0c 38 dsll $1, $1, 16
101 # MIPS64-NEXT: 64 21 00 00 daddiu $1, $1, 0
102 # MIPS64-NEXT: R_MIPS_HI16/R_MIPS_NONE/R_MIPS_NONE symbol
103 # MIPS64-NEXT: 00 01 0c 38 dsll $1, $1, 16
104 # MIPS64-NEXT: f0 2c 00 00 scd $12, 0($1)
105 # MIPS64-NEXT: R_MIPS_LO16/R_MIPS_NONE/R_MIPS_NONE symbol
107 # MIPS64R6: 3c 01 00 00 aui $1, $zero, 0
108 # MIPS64R6-NEXT: R_MIPS_HIGHEST/R_MIPS_NONE/R_MIPS_NONE symbol
109 # MIPS64R6-NEXT: 64 21 00 00 daddiu $1, $1, 0
110 # MIPS64R6-NEXT: R_MIPS_HIGHER/R_MIPS_NONE/R_MIPS_NONE symbol
111 # MIPS64R6-NEXT: 00 01 0c 38 dsll $1, $1, 16
112 # MIPS64R6-NEXT: 64 21 00 00 daddiu $1, $1, 0
113 # MIPS64R6-NEXT: R_MIPS_HI16/R_MIPS_NONE/R_MIPS_NONE symbol
114 # MIPS64R6-NEXT: 00 01 0c 38 dsll $1, $1, 16
115 # MIPS64R6-NEXT: 64 21 00 00 daddiu $1, $1, 0
116 # MIPS64R6-NEXT: R_MIPS_LO16/R_MIPS_NONE/R_MIPS_NONE symbol
117 # MIPS64R6-NEXT: 7c 2c 00 27 scd $12, 0($1)
119 scd $12, symbol($3)
120 # MIPS64: 3c 01 00 00 lui $1, 0
121 # MIPS64-NEXT: R_MIPS_HIGHEST/R_MIPS_NONE/R_MIPS_NONE symbol
122 # MIPS64-NEXT: 64 21 00 00 daddiu $1, $1, 0
123 # MIPS64-NEXT: R_MIPS_HIGHER/R_MIPS_NONE/R_MIPS_NONE symbol
124 # MIPS64-NEXT: 00 01 0c 38 dsll $1, $1, 16
125 # MIPS64-NEXT: 64 21 00 00 daddiu $1, $1, 0
126 # MIPS64-NEXT: R_MIPS_HI16/R_MIPS_NONE/R_MIPS_NONE symbol
127 # MIPS64-NEXT: 00 01 0c 38 dsll $1, $1, 16
128 # MIPS64-NEXT: 00 23 08 2d daddu $1, $1, $3
129 # MIPS64-NEXT: f0 2c 00 00 scd $12, 0($1)
130 # MIPS64-NEXT: R_MIPS_LO16/R_MIPS_NONE/R_MIPS_NONE symbol
132 # MIPS64R6: 3c 01 00 00 aui $1, $zero, 0
133 # MIPS64R6-NEXT: R_MIPS_HIGHEST/R_MIPS_NONE/R_MIPS_NONE symbol
134 # MIPS64R6-NEXT: 64 21 00 00 daddiu $1, $1, 0
135 # MIPS64R6-NEXT: R_MIPS_HIGHER/R_MIPS_NONE/R_MIPS_NONE symbol
136 # MIPS64R6-NEXT: 00 01 0c 38 dsll $1, $1, 16
137 # MIPS64R6-NEXT: 64 21 00 00 daddiu $1, $1, 0
138 # MIPS64R6-NEXT: R_MIPS_HI16/R_MIPS_NONE/R_MIPS_NONE symbol
139 # MIPS64R6-NEXT: 00 01 0c 38 dsll $1, $1, 16
140 # MIPS64R6-NEXT: 64 21 00 00 daddiu $1, $1, 0
141 # MIPS64R6-NEXT: R_MIPS_LO16/R_MIPS_NONE/R_MIPS_NONE symbol
142 # MIPS64R6-NEXT: 00 23 08 2d daddu $1, $1, $3
143 # MIPS64R6-NEXT: 7c 2c 00 27 scd $12, 0($1)
145 scd $12, symbol+8
146 # MIPS64: 3c 01 00 00 lui $1, 0
147 # MIPS64-NEXT: R_MIPS_HIGHEST/R_MIPS_NONE/R_MIPS_NONE symbol+0x8
148 # MIPS64-NEXT: 64 21 00 00 daddiu $1, $1, 0
149 # MIPS64-NEXT: R_MIPS_HIGHER/R_MIPS_NONE/R_MIPS_NONE symbol+0x8
150 # MIPS64-NEXT: 00 01 0c 38 dsll $1, $1, 16
151 # MIPS64-NEXT: 64 21 00 00 daddiu $1, $1, 0
152 # MIPS64-NEXT: R_MIPS_HI16/R_MIPS_NONE/R_MIPS_NONE symbol+0x8
153 # MIPS64-NEXT: 00 01 0c 38 dsll $1, $1, 16
154 # MIPS64-NEXT: f0 2c 00 00 scd $12, 0($1)
155 # MIPS64-NEXT: R_MIPS_LO16/R_MIPS_NONE/R_MIPS_NONE symbol+0x8
157 # MIPS64R6: 3c 01 00 00 aui $1, $zero, 0
158 # MIPS64R6-NEXT: R_MIPS_HIGHEST/R_MIPS_NONE/R_MIPS_NONE symbol+0x8
159 # MIPS64R6-NEXT: 64 21 00 00 daddiu $1, $1, 0
160 # MIPS64R6-NEXT: R_MIPS_HIGHER/R_MIPS_NONE/R_MIPS_NONE symbol+0x8
161 # MIPS64R6-NEXT: 00 01 0c 38 dsll $1, $1, 16
162 # MIPS64R6-NEXT: 64 21 00 00 daddiu $1, $1, 0
163 # MIPS64R6-NEXT: R_MIPS_HI16/R_MIPS_NONE/R_MIPS_NONE symbol+0x8
164 # MIPS64R6-NEXT: 00 01 0c 38 dsll $1, $1, 16
165 # MIPS64R6-NEXT: 64 21 00 00 daddiu $1, $1, 0
166 # MIPS64R6-NEXT: R_MIPS_LO16/R_MIPS_NONE/R_MIPS_NONE symbol+0x8
167 # MIPS64R6-NEXT: 7c 2c 00 27 scd $12, 0($1)
169 .option pic2
171 scd $12, symbol
172 # MIPS64: df 81 00 00 ld $1, 0($gp)
173 # MIPS64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE symbol
174 # MIPS64-NEXT: f0 2c 00 00 scd $12, 0($1)
176 # MIPS64R6: df 81 00 00 ld $1, 0($gp)
177 # MIPS64R6-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE symbol
178 # MIPS64R6-NEXT: 7c 2c 00 27 scd $12, 0($1)
180 scd $12, symbol+8
181 # MIPS64: df 81 00 00 ld $1, 0($gp)
182 # MIPS64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE symbol
183 # MIPS64-NEXT: f0 2c 00 08 scd $12, 8($1)
185 # MIPS64R6: df 81 00 00 ld $1, 0($gp)
186 # MIPS64R6-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE symbol
187 # MIPS64R6-NEXT: 64 21 00 08 daddiu $1, $1, 8
188 # MIPS64R6-NEXT: 7c 2c 00 27 scd $12, 0($1)