Add LLVM support for remaining integer divide and permute instructions from ISA 2.06
[oota-llvm.git] / test / MC / PowerPC / ppc64-encoding.s
1
2 # RUN: llvm-mc -triple powerpc64-unknown-unknown --show-encoding %s | FileCheck -check-prefix=CHECK-BE %s
3 # RUN: llvm-mc -triple powerpc64le-unknown-unknown --show-encoding %s | FileCheck -check-prefix=CHECK-LE %s
4
5 # Branch facility
6
7 # Branch instructions
8
9 # CHECK-BE: b target                        # encoding: [0b010010AA,A,A,0bAAAAAA00]
10 # CHECK-LE: b target                        # encoding: [0bAAAAAA00,A,A,0b010010AA]
11 # CHECK-BE-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_br24
12 # CHECK-LE-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_br24
13             b target
14 # CHECK-BE: ba target                       # encoding: [0b010010AA,A,A,0bAAAAAA10]
15 # CHECK-LE: ba target                       # encoding: [0bAAAAAA10,A,A,0b010010AA]
16 # CHECK-BE-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_br24abs
17 # CHECK-LE-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_br24abs
18             ba target
19 # CHECK-BE: bl target                       # encoding: [0b010010AA,A,A,0bAAAAAA01]
20 # CHECK-LE: bl target                       # encoding: [0bAAAAAA01,A,A,0b010010AA]
21 # CHECK-BE-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_br24
22 # CHECK-LE-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_br24
23             bl target
24 # CHECK-BE: bla target                      # encoding: [0b010010AA,A,A,0bAAAAAA11]
25 # CHECK-LE: bla target                      # encoding: [0bAAAAAA11,A,A,0b010010AA]
26 # CHECK-BE-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_br24abs
27 # CHECK-LE-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_br24abs
28             bla target
29
30 # CHECK-BE: bc 4, 10, target                # encoding: [0x40,0x8a,A,0bAAAAAA00]
31 # CHECK-LE: bc 4, 10, target                # encoding: [0bAAAAAA00,A,0x8a,0x40]
32 # CHECK-BE-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_brcond14
33 # CHECK-LE-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_brcond14
34             bc 4, 10, target
35 # CHECK-BE: bca 4, 10, target               # encoding: [0x40,0x8a,A,0bAAAAAA10]
36 # CHECK-LE: bca 4, 10, target               # encoding: [0bAAAAAA10,A,0x8a,0x40]
37 # CHECK-BE-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_brcond14abs
38 # CHECK-LE-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_brcond14abs
39             bca 4, 10, target
40 # CHECK-BE: bcl 4, 10, target               # encoding: [0x40,0x8a,A,0bAAAAAA01]
41 # CHECK-LE: bcl 4, 10, target               # encoding: [0bAAAAAA01,A,0x8a,0x40]
42 # CHECK-BE-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_brcond14
43 # CHECK-LE-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_brcond14
44             bcl 4, 10, target
45 # CHECK-BE: bcla 4, 10, target              # encoding: [0x40,0x8a,A,0bAAAAAA11]
46 # CHECK-LE: bcla 4, 10, target              # encoding: [0bAAAAAA11,A,0x8a,0x40]
47 # CHECK-BE-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_brcond14abs
48 # CHECK-LE-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_brcond14abs
49             bcla 4, 10, target
50
51 # CHECK-BE: bclr 4, 10, 3                   # encoding: [0x4c,0x8a,0x18,0x20]
52 # CHECK-LE: bclr 4, 10, 3                   # encoding: [0x20,0x18,0x8a,0x4c]
53             bclr 4, 10, 3
54 # CHECK-BE: bclr 4, 10, 0                   # encoding: [0x4c,0x8a,0x00,0x20]
55 # CHECK-LE: bclr 4, 10, 0                   # encoding: [0x20,0x00,0x8a,0x4c]
56             bclr 4, 10
57 # CHECK-BE: bclrl 4, 10, 3                  # encoding: [0x4c,0x8a,0x18,0x21]
58 # CHECK-LE: bclrl 4, 10, 3                  # encoding: [0x21,0x18,0x8a,0x4c]
59             bclrl 4, 10, 3
60 # CHECK-BE: bclrl 4, 10, 0                  # encoding: [0x4c,0x8a,0x00,0x21]
61 # CHECK-LE: bclrl 4, 10, 0                  # encoding: [0x21,0x00,0x8a,0x4c]
62             bclrl 4, 10
63 # CHECK-BE: bcctr 4, 10, 3                  # encoding: [0x4c,0x8a,0x1c,0x20]
64 # CHECK-LE: bcctr 4, 10, 3                  # encoding: [0x20,0x1c,0x8a,0x4c]
65             bcctr 4, 10, 3
66 # CHECK-BE: bcctr 4, 10, 0                  # encoding: [0x4c,0x8a,0x04,0x20]
67 # CHECK-LE: bcctr 4, 10, 0                  # encoding: [0x20,0x04,0x8a,0x4c]
68             bcctr 4, 10
69 # CHECK-BE: bcctrl 4, 10, 3                 # encoding: [0x4c,0x8a,0x1c,0x21]
70 # CHECK-LE: bcctrl 4, 10, 3                 # encoding: [0x21,0x1c,0x8a,0x4c]
71             bcctrl 4, 10, 3
72 # CHECK-BE: bcctrl 4, 10, 0                 # encoding: [0x4c,0x8a,0x04,0x21]
73 # CHECK-LE: bcctrl 4, 10, 0                 # encoding: [0x21,0x04,0x8a,0x4c]
74             bcctrl 4, 10
75
76 # Condition register instructions
77
78 # CHECK-BE: crand 2, 3, 4                   # encoding: [0x4c,0x43,0x22,0x02]
79 # CHECK-LE: crand 2, 3, 4                   # encoding: [0x02,0x22,0x43,0x4c]
80             crand 2, 3, 4
81 # CHECK-BE: crnand 2, 3, 4                  # encoding: [0x4c,0x43,0x21,0xc2]
82 # CHECK-LE: crnand 2, 3, 4                  # encoding: [0xc2,0x21,0x43,0x4c]
83             crnand 2, 3, 4
84 # CHECK-BE: cror 2, 3, 4                    # encoding: [0x4c,0x43,0x23,0x82]
85 # CHECK-LE: cror 2, 3, 4                    # encoding: [0x82,0x23,0x43,0x4c]
86             cror 2, 3, 4
87 # CHECK-BE: crxor 2, 3, 4                   # encoding: [0x4c,0x43,0x21,0x82]
88 # CHECK-LE: crxor 2, 3, 4                   # encoding: [0x82,0x21,0x43,0x4c]
89             crxor 2, 3, 4
90 # CHECK-BE: crnor 2, 3, 4                   # encoding: [0x4c,0x43,0x20,0x42]
91 # CHECK-LE: crnor 2, 3, 4                   # encoding: [0x42,0x20,0x43,0x4c]
92             crnor 2, 3, 4
93 # CHECK-BE: creqv 2, 3, 4                   # encoding: [0x4c,0x43,0x22,0x42]
94 # CHECK-LE: creqv 2, 3, 4                   # encoding: [0x42,0x22,0x43,0x4c]
95             creqv 2, 3, 4
96 # CHECK-BE: crandc 2, 3, 4                  # encoding: [0x4c,0x43,0x21,0x02]
97 # CHECK-LE: crandc 2, 3, 4                  # encoding: [0x02,0x21,0x43,0x4c]
98             crandc 2, 3, 4
99 # CHECK-BE: crorc 2, 3, 4                   # encoding: [0x4c,0x43,0x23,0x42]
100 # CHECK-LE: crorc 2, 3, 4                   # encoding: [0x42,0x23,0x43,0x4c]
101             crorc 2, 3, 4
102 # CHECK-BE: mcrf 2, 3                       # encoding: [0x4d,0x0c,0x00,0x00]
103 # CHECK-LE: mcrf 2, 3                       # encoding: [0x00,0x00,0x0c,0x4d]
104             mcrf 2, 3
105
106 # System call instruction
107
108 # CHECK-BE: sc 1                            # encoding: [0x44,0x00,0x00,0x22]
109 # CHECK-LE: sc 1                            # encoding: [0x22,0x00,0x00,0x44]
110             sc 1
111 # CHECK-BE: sc 0                            # encoding: [0x44,0x00,0x00,0x02]
112 # CHECK-LE: sc 0                            # encoding: [0x02,0x00,0x00,0x44]
113             sc
114
115 # Fixed-point facility
116
117 # Fixed-point load instructions
118
119 # CHECK-BE: lbz 2, 128(4)                   # encoding: [0x88,0x44,0x00,0x80]
120 # CHECK-LE: lbz 2, 128(4)                   # encoding: [0x80,0x00,0x44,0x88]
121             lbz 2, 128(4)
122 # CHECK-BE: lbzx 2, 3, 4                    # encoding: [0x7c,0x43,0x20,0xae]
123 # CHECK-LE: lbzx 2, 3, 4                    # encoding: [0xae,0x20,0x43,0x7c]
124             lbzx 2, 3, 4
125 # CHECK-BE: lbzu 2, 128(4)                  # encoding: [0x8c,0x44,0x00,0x80]
126 # CHECK-LE: lbzu 2, 128(4)                  # encoding: [0x80,0x00,0x44,0x8c]
127             lbzu 2, 128(4)
128 # CHECK-BE: lbzux 2, 3, 4                   # encoding: [0x7c,0x43,0x20,0xee]
129 # CHECK-LE: lbzux 2, 3, 4                   # encoding: [0xee,0x20,0x43,0x7c]
130             lbzux 2, 3, 4
131 # CHECK-BE: lhz 2, 128(4)                   # encoding: [0xa0,0x44,0x00,0x80]
132 # CHECK-LE: lhz 2, 128(4)                   # encoding: [0x80,0x00,0x44,0xa0]
133             lhz 2, 128(4)
134 # CHECK-BE: lhzx 2, 3, 4                    # encoding: [0x7c,0x43,0x22,0x2e]
135 # CHECK-LE: lhzx 2, 3, 4                    # encoding: [0x2e,0x22,0x43,0x7c]
136             lhzx 2, 3, 4
137 # CHECK-BE: lhzu 2, 128(4)                  # encoding: [0xa4,0x44,0x00,0x80]
138 # CHECK-LE: lhzu 2, 128(4)                  # encoding: [0x80,0x00,0x44,0xa4]
139             lhzu 2, 128(4)
140 # CHECK-BE: lhzux 2, 3, 4                   # encoding: [0x7c,0x43,0x22,0x6e]
141 # CHECK-LE: lhzux 2, 3, 4                   # encoding: [0x6e,0x22,0x43,0x7c]
142             lhzux 2, 3, 4
143 # CHECK-BE: lha 2, 128(4)                   # encoding: [0xa8,0x44,0x00,0x80]
144 # CHECK-LE: lha 2, 128(4)                   # encoding: [0x80,0x00,0x44,0xa8]
145             lha 2, 128(4)
146 # CHECK-BE: lhax 2, 3, 4                    # encoding: [0x7c,0x43,0x22,0xae]
147 # CHECK-LE: lhax 2, 3, 4                    # encoding: [0xae,0x22,0x43,0x7c]
148             lhax 2, 3, 4
149 # CHECK-BE: lhau 2, 128(4)                  # encoding: [0xac,0x44,0x00,0x80]
150 # CHECK-LE: lhau 2, 128(4)                  # encoding: [0x80,0x00,0x44,0xac]
151             lhau 2, 128(4)
152 # CHECK-BE: lhaux 2, 3, 4                   # encoding: [0x7c,0x43,0x22,0xee]
153 # CHECK-LE: lhaux 2, 3, 4                   # encoding: [0xee,0x22,0x43,0x7c]
154             lhaux 2, 3, 4
155 # CHECK-BE: lwz 2, 128(4)                   # encoding: [0x80,0x44,0x00,0x80]
156 # CHECK-LE: lwz 2, 128(4)                   # encoding: [0x80,0x00,0x44,0x80]
157             lwz 2, 128(4)
158 # CHECK-BE: lwzx 2, 3, 4                    # encoding: [0x7c,0x43,0x20,0x2e]
159 # CHECK-LE: lwzx 2, 3, 4                    # encoding: [0x2e,0x20,0x43,0x7c]
160             lwzx 2, 3, 4
161 # CHECK-BE: lwzu 2, 128(4)                  # encoding: [0x84,0x44,0x00,0x80]
162 # CHECK-LE: lwzu 2, 128(4)                  # encoding: [0x80,0x00,0x44,0x84]
163             lwzu 2, 128(4)
164 # CHECK-BE: lwzux 2, 3, 4                   # encoding: [0x7c,0x43,0x20,0x6e]
165 # CHECK-LE: lwzux 2, 3, 4                   # encoding: [0x6e,0x20,0x43,0x7c]
166             lwzux 2, 3, 4
167 # CHECK-BE: lwa 2, 128(4)                   # encoding: [0xe8,0x44,0x00,0x82]
168 # CHECK-LE: lwa 2, 128(4)                   # encoding: [0x82,0x00,0x44,0xe8]
169             lwa 2, 128(4)
170 # CHECK-BE: lwax 2, 3, 4                    # encoding: [0x7c,0x43,0x22,0xaa]
171 # CHECK-LE: lwax 2, 3, 4                    # encoding: [0xaa,0x22,0x43,0x7c]
172             lwax 2, 3, 4
173 # CHECK-BE: lwaux 2, 3, 4                   # encoding: [0x7c,0x43,0x22,0xea]
174 # CHECK-LE: lwaux 2, 3, 4                   # encoding: [0xea,0x22,0x43,0x7c]
175             lwaux 2, 3, 4
176 # CHECK-BE: ld 2, 128(4)                    # encoding: [0xe8,0x44,0x00,0x80]
177 # CHECK-LE: ld 2, 128(4)                    # encoding: [0x80,0x00,0x44,0xe8]
178             ld 2, 128(4)
179 # CHECK-BE: ldx 2, 3, 4                     # encoding: [0x7c,0x43,0x20,0x2a]
180 # CHECK-LE: ldx 2, 3, 4                     # encoding: [0x2a,0x20,0x43,0x7c]
181             ldx 2, 3, 4
182 # CHECK-BE: ldu 2, 128(4)                   # encoding: [0xe8,0x44,0x00,0x81]
183 # CHECK-LE: ldu 2, 128(4)                   # encoding: [0x81,0x00,0x44,0xe8]
184             ldu 2, 128(4)
185 # CHECK-BE: ldux 2, 3, 4                    # encoding: [0x7c,0x43,0x20,0x6a]
186 # CHECK-LE: ldux 2, 3, 4                    # encoding: [0x6a,0x20,0x43,0x7c]
187             ldux 2, 3, 4
188
189 # Fixed-point store instructions
190
191 # CHECK-BE: stb 2, 128(4)                   # encoding: [0x98,0x44,0x00,0x80]
192 # CHECK-LE: stb 2, 128(4)                   # encoding: [0x80,0x00,0x44,0x98]
193             stb 2, 128(4)
194 # CHECK-BE: stbx 2, 3, 4                    # encoding: [0x7c,0x43,0x21,0xae]
195 # CHECK-LE: stbx 2, 3, 4                    # encoding: [0xae,0x21,0x43,0x7c]
196             stbx 2, 3, 4
197 # CHECK-BE: stbu 2, 128(4)                  # encoding: [0x9c,0x44,0x00,0x80]
198 # CHECK-LE: stbu 2, 128(4)                  # encoding: [0x80,0x00,0x44,0x9c]
199             stbu 2, 128(4)
200 # CHECK-BE: stbux 2, 3, 4                   # encoding: [0x7c,0x43,0x21,0xee]
201 # CHECK-LE: stbux 2, 3, 4                   # encoding: [0xee,0x21,0x43,0x7c]
202             stbux 2, 3, 4
203 # CHECK-BE: sth 2, 128(4)                   # encoding: [0xb0,0x44,0x00,0x80]
204 # CHECK-LE: sth 2, 128(4)                   # encoding: [0x80,0x00,0x44,0xb0]
205             sth 2, 128(4)
206 # CHECK-BE: sthx 2, 3, 4                    # encoding: [0x7c,0x43,0x23,0x2e]
207 # CHECK-LE: sthx 2, 3, 4                    # encoding: [0x2e,0x23,0x43,0x7c]
208             sthx 2, 3, 4
209 # CHECK-BE: sthu 2, 128(4)                  # encoding: [0xb4,0x44,0x00,0x80]
210 # CHECK-LE: sthu 2, 128(4)                  # encoding: [0x80,0x00,0x44,0xb4]
211             sthu 2, 128(4)
212 # CHECK-BE: sthux 2, 3, 4                   # encoding: [0x7c,0x43,0x23,0x6e]
213 # CHECK-LE: sthux 2, 3, 4                   # encoding: [0x6e,0x23,0x43,0x7c]
214             sthux 2, 3, 4
215 # CHECK-BE: stw 2, 128(4)                   # encoding: [0x90,0x44,0x00,0x80]
216 # CHECK-LE: stw 2, 128(4)                   # encoding: [0x80,0x00,0x44,0x90]
217             stw 2, 128(4)
218 # CHECK-BE: stwx 2, 3, 4                    # encoding: [0x7c,0x43,0x21,0x2e]
219 # CHECK-LE: stwx 2, 3, 4                    # encoding: [0x2e,0x21,0x43,0x7c]
220             stwx 2, 3, 4
221 # CHECK-BE: stwu 2, 128(4)                  # encoding: [0x94,0x44,0x00,0x80]
222 # CHECK-LE: stwu 2, 128(4)                  # encoding: [0x80,0x00,0x44,0x94]
223             stwu 2, 128(4)
224 # CHECK-BE: stwux 2, 3, 4                   # encoding: [0x7c,0x43,0x21,0x6e]
225 # CHECK-LE: stwux 2, 3, 4                   # encoding: [0x6e,0x21,0x43,0x7c]
226             stwux 2, 3, 4
227 # CHECK-BE: std 2, 128(4)                   # encoding: [0xf8,0x44,0x00,0x80]
228 # CHECK-LE: std 2, 128(4)                   # encoding: [0x80,0x00,0x44,0xf8]
229             std 2, 128(4)
230 # CHECK-BE: stdx 2, 3, 4                    # encoding: [0x7c,0x43,0x21,0x2a]
231 # CHECK-LE: stdx 2, 3, 4                    # encoding: [0x2a,0x21,0x43,0x7c]
232             stdx 2, 3, 4
233 # CHECK-BE: stdu 2, 128(4)                  # encoding: [0xf8,0x44,0x00,0x81]
234 # CHECK-LE: stdu 2, 128(4)                  # encoding: [0x81,0x00,0x44,0xf8]
235             stdu 2, 128(4)
236 # CHECK-BE: stdux 2, 3, 4                   # encoding: [0x7c,0x43,0x21,0x6a]
237 # CHECK-LE: stdux 2, 3, 4                   # encoding: [0x6a,0x21,0x43,0x7c]
238             stdux 2, 3, 4
239
240 # Fixed-point load and store with byte reversal instructions
241
242 # CHECK-BE: lhbrx 2, 3, 4                   # encoding: [0x7c,0x43,0x26,0x2c]
243 # CHECK-LE: lhbrx 2, 3, 4                   # encoding: [0x2c,0x26,0x43,0x7c]
244             lhbrx 2, 3, 4
245 # CHECK-BE: sthbrx 2, 3, 4                  # encoding: [0x7c,0x43,0x27,0x2c]
246 # CHECK-LE: sthbrx 2, 3, 4                  # encoding: [0x2c,0x27,0x43,0x7c]
247             sthbrx 2, 3, 4
248 # CHECK-BE: lwbrx 2, 3, 4                   # encoding: [0x7c,0x43,0x24,0x2c]
249 # CHECK-LE: lwbrx 2, 3, 4                   # encoding: [0x2c,0x24,0x43,0x7c]
250             lwbrx 2, 3, 4
251 # CHECK-BE: stwbrx 2, 3, 4                  # encoding: [0x7c,0x43,0x25,0x2c]
252 # CHECK-LE: stwbrx 2, 3, 4                  # encoding: [0x2c,0x25,0x43,0x7c]
253             stwbrx 2, 3, 4
254 # CHECK-BE: ldbrx 2, 3, 4                   # encoding: [0x7c,0x43,0x24,0x28]
255 # CHECK-LE: ldbrx 2, 3, 4                   # encoding: [0x28,0x24,0x43,0x7c]
256             ldbrx 2, 3, 4
257 # CHECK-BE: stdbrx 2, 3, 4                  # encoding: [0x7c,0x43,0x25,0x28]
258 # CHECK-LE: stdbrx 2, 3, 4                  # encoding: [0x28,0x25,0x43,0x7c]
259             stdbrx 2, 3, 4
260
261 # Fixed-point load and store multiple instructions
262
263 # CHECK-BE: lmw 2, 128(1)                   # encoding: [0xb8,0x41,0x00,0x80]
264 # CHECK-LE: lmw 2, 128(1)                   # encoding: [0x80,0x00,0x41,0xb8]
265             lmw 2, 128(1)
266 # CHECK-BE: stmw 2, 128(1)                  # encoding: [0xbc,0x41,0x00,0x80]
267 # CHECK-LE: stmw 2, 128(1)                  # encoding: [0x80,0x00,0x41,0xbc]
268             stmw 2, 128(1)
269
270 # FIXME: Fixed-point move assist instructions
271
272 # Fixed-point arithmetic instructions
273
274 # CHECK-BE: addi 2, 3, 128                  # encoding: [0x38,0x43,0x00,0x80]
275 # CHECK-LE: addi 2, 3, 128                  # encoding: [0x80,0x00,0x43,0x38]
276             addi 2, 3, 128
277 # CHECK-BE: addis 2, 3, 128                 # encoding: [0x3c,0x43,0x00,0x80]
278 # CHECK-LE: addis 2, 3, 128                 # encoding: [0x80,0x00,0x43,0x3c]
279             addis 2, 3, 128
280 # CHECK-BE: add 2, 3, 4                     # encoding: [0x7c,0x43,0x22,0x14]
281 # CHECK-LE: add 2, 3, 4                     # encoding: [0x14,0x22,0x43,0x7c]
282             add 2, 3, 4
283 # CHECK-BE: add. 2, 3, 4                    # encoding: [0x7c,0x43,0x22,0x15]
284 # CHECK-LE: add. 2, 3, 4                    # encoding: [0x15,0x22,0x43,0x7c]
285             add. 2, 3, 4
286 # FIXME:    addo 2, 3, 4
287 # FIXME:    addo. 2, 3, 4
288 # CHECK-BE: subf 2, 3, 4                    # encoding: [0x7c,0x43,0x20,0x50]
289 # CHECK-LE: subf 2, 3, 4                    # encoding: [0x50,0x20,0x43,0x7c]
290             subf 2, 3, 4
291 # CHECK-BE: subf. 2, 3, 4                   # encoding: [0x7c,0x43,0x20,0x51]
292 # CHECK-LE: subf. 2, 3, 4                   # encoding: [0x51,0x20,0x43,0x7c]
293             subf. 2, 3, 4
294 # FIXME:    subfo 2, 3, 4
295 # FIXME:    subfo. 2, 3, 4
296 # CHECK-BE: addic 2, 3, 128                 # encoding: [0x30,0x43,0x00,0x80]
297 # CHECK-LE: addic 2, 3, 128                 # encoding: [0x80,0x00,0x43,0x30]
298             addic 2, 3, 128
299 # CHECK-BE: addic. 2, 3, 128                # encoding: [0x34,0x43,0x00,0x80]
300 # CHECK-LE: addic. 2, 3, 128                # encoding: [0x80,0x00,0x43,0x34]
301             addic. 2, 3, 128
302 # CHECK-BE: subfic 2, 3, 4                  # encoding: [0x20,0x43,0x00,0x04]
303 # CHECK-LE: subfic 2, 3, 4                  # encoding: [0x04,0x00,0x43,0x20]
304             subfic 2, 3, 4
305
306 # CHECK-BE: addc 2, 3, 4                    # encoding: [0x7c,0x43,0x20,0x14]
307 # CHECK-LE: addc 2, 3, 4                    # encoding: [0x14,0x20,0x43,0x7c]
308             addc 2, 3, 4
309 # CHECK-BE: addc. 2, 3, 4                   # encoding: [0x7c,0x43,0x20,0x15]
310 # CHECK-LE: addc. 2, 3, 4                   # encoding: [0x15,0x20,0x43,0x7c]
311             addc. 2, 3, 4
312 # FIXME:    addco 2, 3, 4
313 # FIXME:    addco. 2, 3, 4
314 # CHECK-BE: subfc 2, 3, 4                   # encoding: [0x7c,0x43,0x20,0x10]
315 # CHECK-LE: subfc 2, 3, 4                   # encoding: [0x10,0x20,0x43,0x7c]
316             subfc 2, 3, 4
317 # CHECK-BE: subfc 2, 3, 4                   # encoding: [0x7c,0x43,0x20,0x10]
318 # CHECK-LE: subfc 2, 3, 4                   # encoding: [0x10,0x20,0x43,0x7c]
319             subfc 2, 3, 4
320 # FIXME:    subfco 2, 3, 4
321 # FIXME:    subfco. 2, 3, 4
322
323 # CHECK-BE: adde 2, 3, 4                    # encoding: [0x7c,0x43,0x21,0x14]
324 # CHECK-LE: adde 2, 3, 4                    # encoding: [0x14,0x21,0x43,0x7c]
325             adde 2, 3, 4
326 # CHECK-BE: adde. 2, 3, 4                   # encoding: [0x7c,0x43,0x21,0x15]
327 # CHECK-LE: adde. 2, 3, 4                   # encoding: [0x15,0x21,0x43,0x7c]
328             adde. 2, 3, 4
329 # FIXME:    addeo 2, 3, 4
330 # FIXME:    addeo. 2, 3, 4
331 # CHECK-BE: subfe 2, 3, 4                   # encoding: [0x7c,0x43,0x21,0x10]
332 # CHECK-LE: subfe 2, 3, 4                   # encoding: [0x10,0x21,0x43,0x7c]
333             subfe 2, 3, 4
334 # CHECK-BE: subfe. 2, 3, 4                  # encoding: [0x7c,0x43,0x21,0x11]
335 # CHECK-LE: subfe. 2, 3, 4                  # encoding: [0x11,0x21,0x43,0x7c]
336             subfe. 2, 3, 4
337 # FIXME:    subfeo 2, 3, 4
338 # FIXME:    subfeo. 2, 3, 4
339
340 # CHECK-BE: addme 2, 3                      # encoding: [0x7c,0x43,0x01,0xd4]
341 # CHECK-LE: addme 2, 3                      # encoding: [0xd4,0x01,0x43,0x7c]
342             addme 2, 3
343 # CHECK-BE: addme. 2, 3                     # encoding: [0x7c,0x43,0x01,0xd5]
344 # CHECK-LE: addme. 2, 3                     # encoding: [0xd5,0x01,0x43,0x7c]
345             addme. 2, 3
346 # FIXME:    addmeo 2, 3
347 # FIXME:    addmeo. 2, 3
348 # CHECK-BE: subfme 2, 3                     # encoding: [0x7c,0x43,0x01,0xd0]
349 # CHECK-LE: subfme 2, 3                     # encoding: [0xd0,0x01,0x43,0x7c]
350             subfme 2, 3
351 # CHECK-BE: subfme. 2, 3                    # encoding: [0x7c,0x43,0x01,0xd1]
352 # CHECK-LE: subfme. 2, 3                    # encoding: [0xd1,0x01,0x43,0x7c]
353             subfme. 2, 3
354 # FIXME:    subfmeo 2, 3
355 # FIXME:    subfmeo. 2, 3
356
357 # CHECK-BE: addze 2, 3                      # encoding: [0x7c,0x43,0x01,0x94]
358 # CHECK-LE: addze 2, 3                      # encoding: [0x94,0x01,0x43,0x7c]
359             addze 2, 3
360 # CHECK-BE: addze. 2, 3                     # encoding: [0x7c,0x43,0x01,0x95]
361 # CHECK-LE: addze. 2, 3                     # encoding: [0x95,0x01,0x43,0x7c]
362             addze. 2, 3
363 # FIXME:    addzeo 2, 3
364 # FIXME:    addzeo. 2, 3
365 # CHECK-BE: subfze 2, 3                     # encoding: [0x7c,0x43,0x01,0x90]
366 # CHECK-LE: subfze 2, 3                     # encoding: [0x90,0x01,0x43,0x7c]
367             subfze 2, 3
368 # CHECK-BE: subfze. 2, 3                    # encoding: [0x7c,0x43,0x01,0x91]
369 # CHECK-LE: subfze. 2, 3                    # encoding: [0x91,0x01,0x43,0x7c]
370             subfze. 2, 3
371 # FIXME:    subfzeo 2, 3
372 # FIXME:    subfzeo. 2, 3
373
374 # CHECK-BE: neg 2, 3                        # encoding: [0x7c,0x43,0x00,0xd0]
375 # CHECK-LE: neg 2, 3                        # encoding: [0xd0,0x00,0x43,0x7c]
376             neg 2, 3
377 # CHECK-BE: neg. 2, 3                       # encoding: [0x7c,0x43,0x00,0xd1]
378 # CHECK-LE: neg. 2, 3                       # encoding: [0xd1,0x00,0x43,0x7c]
379             neg. 2, 3
380 # FIXME:    nego 2, 3
381 # FIXME:    nego. 2, 3
382
383 # CHECK-BE: mulli 2, 3, 128                 # encoding: [0x1c,0x43,0x00,0x80]
384 # CHECK-LE: mulli 2, 3, 128                 # encoding: [0x80,0x00,0x43,0x1c]
385             mulli 2, 3, 128
386 # CHECK-BE: mulhw 2, 3, 4                   # encoding: [0x7c,0x43,0x20,0x96]
387 # CHECK-LE: mulhw 2, 3, 4                   # encoding: [0x96,0x20,0x43,0x7c]
388             mulhw 2, 3, 4
389 # CHECK-BE: mulhw. 2, 3, 4                  # encoding: [0x7c,0x43,0x20,0x97]
390 # CHECK-LE: mulhw. 2, 3, 4                  # encoding: [0x97,0x20,0x43,0x7c]
391             mulhw. 2, 3, 4
392 # CHECK-BE: mullw 2, 3, 4                   # encoding: [0x7c,0x43,0x21,0xd6]
393 # CHECK-LE: mullw 2, 3, 4                   # encoding: [0xd6,0x21,0x43,0x7c]
394             mullw 2, 3, 4
395 # CHECK-BE: mullw. 2, 3, 4                  # encoding: [0x7c,0x43,0x21,0xd7]
396 # CHECK-LE: mullw. 2, 3, 4                  # encoding: [0xd7,0x21,0x43,0x7c]
397             mullw. 2, 3, 4
398 # FIXME:    mullwo 2, 3, 4
399 # FIXME:    mullwo. 2, 3, 4
400 # CHECK-BE: mulhwu 2, 3, 4                  # encoding: [0x7c,0x43,0x20,0x16]
401 # CHECK-LE: mulhwu 2, 3, 4                  # encoding: [0x16,0x20,0x43,0x7c]
402             mulhwu 2, 3, 4
403 # CHECK-BE: mulhwu. 2, 3, 4                 # encoding: [0x7c,0x43,0x20,0x17]
404 # CHECK-LE: mulhwu. 2, 3, 4                 # encoding: [0x17,0x20,0x43,0x7c]
405             mulhwu. 2, 3, 4
406
407 # CHECK-BE: divw 2, 3, 4                    # encoding: [0x7c,0x43,0x23,0xd6]
408 # CHECK-LE: divw 2, 3, 4                    # encoding: [0xd6,0x23,0x43,0x7c]
409             divw 2, 3, 4
410 # CHECK-BE: divw. 2, 3, 4                   # encoding: [0x7c,0x43,0x23,0xd7]
411 # CHECK-LE: divw. 2, 3, 4                   # encoding: [0xd7,0x23,0x43,0x7c]
412             divw. 2, 3, 4
413 # FIXME:    divwo 2, 3, 4
414 # FIXME:    divwo. 2, 3, 4
415 # CHECK-BE: divwu 2, 3, 4                   # encoding: [0x7c,0x43,0x23,0x96]
416 # CHECK-LE: divwu 2, 3, 4                   # encoding: [0x96,0x23,0x43,0x7c]
417             divwu 2, 3, 4
418 # CHECK-BE: divwu. 2, 3, 4                  # encoding: [0x7c,0x43,0x23,0x97]
419 # CHECK-LE: divwu. 2, 3, 4                  # encoding: [0x97,0x23,0x43,0x7c]
420             divwu. 2, 3, 4
421 # FIXME:    divwuo 2, 3, 4
422 # FIXME:    divwuo. 2, 3, 4
423 # CHECK-BE: divwe 2, 3, 4                   # encoding: [0x7c,0x43,0x23,0x56]
424 # CHECK-LE: divwe 2, 3, 4                   # encoding: [0x56,0x23,0x43,0x7c]
425             divwe 2, 3, 4
426 # CHECK-BE: divwe. 2, 3, 4                  # encoding: [0x7c,0x43,0x23,0x57]
427 # CHECK-LE: divwe. 2, 3, 4                  # encoding: [0x57,0x23,0x43,0x7c]
428             divwe. 2, 3, 4
429 # FIXME:    divweo 2, 3, 4
430 # FIXME:    divweo. 2, 3, 4
431 # CHECK-BE: divweu 2, 3, 4                  # encoding: [0x7c,0x43,0x23,0x16]
432 # CHECK-LE: divweu 2, 3, 4                  # encoding: [0x16,0x23,0x43,0x7c]
433             divweu 2, 3, 4
434 # CHECK-BE: divweu. 2, 3, 4                 # encoding: [0x7c,0x43,0x23,0x17]
435 # CHECK-LE: divweu. 2, 3, 4                 # encoding: [0x17,0x23,0x43,0x7c]
436             divweu. 2, 3, 4
437 # FIXME:    divweuo 2, 3, 4
438 # FIXME:    divweuo. 2, 3, 4
439
440 # CHECK-BE: mulld 2, 3, 4                   # encoding: [0x7c,0x43,0x21,0xd2]
441 # CHECK-LE: mulld 2, 3, 4                   # encoding: [0xd2,0x21,0x43,0x7c]
442             mulld 2, 3, 4
443 # CHECK-BE: mulld. 2, 3, 4                  # encoding: [0x7c,0x43,0x21,0xd3]
444 # CHECK-LE: mulld. 2, 3, 4                  # encoding: [0xd3,0x21,0x43,0x7c]
445             mulld. 2, 3, 4
446 # FIXME:    mulldo 2, 3, 4
447 # FIXME:    mulldo. 2, 3, 4
448 # CHECK-BE: mulhd 2, 3, 4                   # encoding: [0x7c,0x43,0x20,0x92]
449 # CHECK-LE: mulhd 2, 3, 4                   # encoding: [0x92,0x20,0x43,0x7c]
450             mulhd 2, 3, 4
451 # CHECK-BE: mulhd. 2, 3, 4                  # encoding: [0x7c,0x43,0x20,0x93]
452 # CHECK-LE: mulhd. 2, 3, 4                  # encoding: [0x93,0x20,0x43,0x7c]
453             mulhd. 2, 3, 4
454 # CHECK-BE: mulhdu 2, 3, 4                  # encoding: [0x7c,0x43,0x20,0x12]
455 # CHECK-LE: mulhdu 2, 3, 4                  # encoding: [0x12,0x20,0x43,0x7c]
456             mulhdu 2, 3, 4
457 # CHECK-BE: mulhdu. 2, 3, 4                 # encoding: [0x7c,0x43,0x20,0x13]
458 # CHECK-LE: mulhdu. 2, 3, 4                 # encoding: [0x13,0x20,0x43,0x7c]
459             mulhdu. 2, 3, 4
460
461 # CHECK-BE: divd 2, 3, 4                    # encoding: [0x7c,0x43,0x23,0xd2]
462 # CHECK-LE: divd 2, 3, 4                    # encoding: [0xd2,0x23,0x43,0x7c]
463             divd 2, 3, 4
464 # CHECK-BE: divd. 2, 3, 4                   # encoding: [0x7c,0x43,0x23,0xd3]
465 # CHECK-LE: divd. 2, 3, 4                   # encoding: [0xd3,0x23,0x43,0x7c]
466             divd. 2, 3, 4
467 # FIXME:    divdo 2, 3, 4
468 # FIXME:    divdo. 2, 3, 4
469 # CHECK-BE: divdu 2, 3, 4                   # encoding: [0x7c,0x43,0x23,0x92]
470 # CHECK-LE: divdu 2, 3, 4                   # encoding: [0x92,0x23,0x43,0x7c]
471             divdu 2, 3, 4
472 # CHECK-BE: divdu. 2, 3, 4                  # encoding: [0x7c,0x43,0x23,0x93]
473 # CHECK-LE: divdu. 2, 3, 4                  # encoding: [0x93,0x23,0x43,0x7c]
474             divdu. 2, 3, 4
475 # FIXME:    divduo 2, 3, 4
476 # FIXME:    divduo. 2, 3, 4
477 # CHECK-BE: divde 2, 3, 4                   # encoding: [0x7c,0x43,0x23,0x52]
478 # CHECK-LE: divde 2, 3, 4                   # encoding: [0x52,0x23,0x43,0x7c]
479             divde 2, 3, 4
480 # CHECK-BE: divde. 2, 3, 4                  # encoding: [0x7c,0x43,0x23,0x53]
481 # CHECK-LE: divde. 2, 3, 4                  # encoding: [0x53,0x23,0x43,0x7c]
482             divde. 2, 3, 4
483 # FIXME:    divdeo 2, 3, 4
484 # FIXME:    divdeo. 2, 3, 4
485 # CHECK-BE: divdeu 2, 3, 4                  # encoding: [0x7c,0x43,0x23,0x12]
486 # CHECK-LE: divdeu 2, 3, 4                  # encoding: [0x12,0x23,0x43,0x7c]
487             divdeu 2, 3, 4
488 # CHECK-BE: divdeu. 2, 3, 4                 # encoding: [0x7c,0x43,0x23,0x13]
489 # CHECK-LE: divdeu. 2, 3, 4                 # encoding: [0x13,0x23,0x43,0x7c]
490             divdeu. 2, 3, 4
491 # FIXME:    divdeuo 2, 3, 4
492 # FIXME:    divdeuo. 2, 3, 4
493
494 # Fixed-point compare instructions
495
496 # CHECK-BE: cmpdi 2, 3, 128                 # encoding: [0x2d,0x23,0x00,0x80]
497 # CHECK-LE: cmpdi 2, 3, 128                 # encoding: [0x80,0x00,0x23,0x2d]
498             cmpi 2, 1, 3, 128
499 # CHECK-BE: cmpd 2, 3, 4                    # encoding: [0x7d,0x23,0x20,0x00]
500 # CHECK-LE: cmpd 2, 3, 4                    # encoding: [0x00,0x20,0x23,0x7d]
501             cmp 2, 1, 3, 4
502 # CHECK-BE: cmpldi 2, 3, 128                # encoding: [0x29,0x23,0x00,0x80]
503 # CHECK-LE: cmpldi 2, 3, 128                # encoding: [0x80,0x00,0x23,0x29]
504             cmpli 2, 1, 3, 128
505 # CHECK-BE: cmpld 2, 3, 4                   # encoding: [0x7d,0x23,0x20,0x40]
506 # CHECK-LE: cmpld 2, 3, 4                   # encoding: [0x40,0x20,0x23,0x7d]
507             cmpl 2, 1, 3, 4
508
509 # CHECK-BE: cmpwi 2, 3, 128                 # encoding: [0x2d,0x03,0x00,0x80]
510 # CHECK-LE: cmpwi 2, 3, 128                 # encoding: [0x80,0x00,0x03,0x2d]
511             cmpi 2, 0, 3, 128
512 # CHECK-BE: cmpw 2, 3, 4                    # encoding: [0x7d,0x03,0x20,0x00]
513 # CHECK-LE: cmpw 2, 3, 4                    # encoding: [0x00,0x20,0x03,0x7d]
514             cmp 2, 0, 3, 4
515 # CHECK-BE: cmplwi 2, 3, 128                # encoding: [0x29,0x03,0x00,0x80]
516 # CHECK-LE: cmplwi 2, 3, 128                # encoding: [0x80,0x00,0x03,0x29]
517             cmpli 2, 0, 3, 128
518 # CHECK-BE: cmplw 2, 3, 4                   # encoding: [0x7d,0x03,0x20,0x40]
519 # CHECK-LE: cmplw 2, 3, 4                   # encoding: [0x40,0x20,0x03,0x7d]
520             cmpl 2, 0, 3, 4
521
522 # Fixed-point trap instructions
523
524 # CHECK-BE: twi 2, 3, 4                     # encoding: [0x0c,0x43,0x00,0x04]
525 # CHECK-LE: twi 2, 3, 4                     # encoding: [0x04,0x00,0x43,0x0c]
526             twi 2, 3, 4
527 # CHECK-BE: tw 2, 3, 4                      # encoding: [0x7c,0x43,0x20,0x08]
528 # CHECK-LE: tw 2, 3, 4                      # encoding: [0x08,0x20,0x43,0x7c]
529             tw 2, 3, 4
530 # CHECK-BE: tdi 2, 3, 4                     # encoding: [0x08,0x43,0x00,0x04]
531 # CHECK-LE: tdi 2, 3, 4                     # encoding: [0x04,0x00,0x43,0x08]
532             tdi 2, 3, 4
533 # CHECK-BE: td 2, 3, 4                      # encoding: [0x7c,0x43,0x20,0x88]
534 # CHECK-LE: td 2, 3, 4                      # encoding: [0x88,0x20,0x43,0x7c]
535             td 2, 3, 4
536
537 # Fixed-point select
538
539 # CHECK-BE: isel 2, 3, 4, 5                 # encoding: [0x7c,0x43,0x21,0x5e]
540 # CHECK-LE: isel 2, 3, 4, 5                 # encoding: [0x5e,0x21,0x43,0x7c]
541             isel 2, 3, 4, 5
542
543 # Fixed-point logical instructions
544
545 # CHECK-BE: andi. 2, 3, 128                 # encoding: [0x70,0x62,0x00,0x80]
546 # CHECK-LE: andi. 2, 3, 128                 # encoding: [0x80,0x00,0x62,0x70]
547             andi. 2, 3, 128
548 # CHECK-BE: andis. 2, 3, 128                # encoding: [0x74,0x62,0x00,0x80]
549 # CHECK-LE: andis. 2, 3, 128                # encoding: [0x80,0x00,0x62,0x74]
550             andis. 2, 3, 128
551 # CHECK-BE: ori 2, 3, 128                   # encoding: [0x60,0x62,0x00,0x80]
552 # CHECK-LE: ori 2, 3, 128                   # encoding: [0x80,0x00,0x62,0x60]
553             ori 2, 3, 128
554 # CHECK-BE: oris 2, 3, 128                  # encoding: [0x64,0x62,0x00,0x80]
555 # CHECK-LE: oris 2, 3, 128                  # encoding: [0x80,0x00,0x62,0x64]
556             oris 2, 3, 128
557 # CHECK-BE: xori 2, 3, 128                  # encoding: [0x68,0x62,0x00,0x80]
558 # CHECK-LE: xori 2, 3, 128                  # encoding: [0x80,0x00,0x62,0x68]
559             xori 2, 3, 128
560 # CHECK-BE: xoris 2, 3, 128                 # encoding: [0x6c,0x62,0x00,0x80]
561 # CHECK-LE: xoris 2, 3, 128                 # encoding: [0x80,0x00,0x62,0x6c]
562             xoris 2, 3, 128
563 # CHECK-BE: and 2, 3, 4                     # encoding: [0x7c,0x62,0x20,0x38]
564 # CHECK-LE: and 2, 3, 4                     # encoding: [0x38,0x20,0x62,0x7c]
565             and 2, 3, 4
566 # CHECK-BE: and. 2, 3, 4                    # encoding: [0x7c,0x62,0x20,0x39]
567 # CHECK-LE: and. 2, 3, 4                    # encoding: [0x39,0x20,0x62,0x7c]
568             and. 2, 3, 4
569 # CHECK-BE: xor 2, 3, 4                     # encoding: [0x7c,0x62,0x22,0x78]
570 # CHECK-LE: xor 2, 3, 4                     # encoding: [0x78,0x22,0x62,0x7c]
571             xor 2, 3, 4
572 # CHECK-BE: xor. 2, 3, 4                    # encoding: [0x7c,0x62,0x22,0x79]
573 # CHECK-LE: xor. 2, 3, 4                    # encoding: [0x79,0x22,0x62,0x7c]
574             xor. 2, 3, 4
575 # CHECK-BE: nand 2, 3, 4                    # encoding: [0x7c,0x62,0x23,0xb8]
576 # CHECK-LE: nand 2, 3, 4                    # encoding: [0xb8,0x23,0x62,0x7c]
577             nand 2, 3, 4
578 # CHECK-BE: nand. 2, 3, 4                   # encoding: [0x7c,0x62,0x23,0xb9]
579 # CHECK-LE: nand. 2, 3, 4                   # encoding: [0xb9,0x23,0x62,0x7c]
580             nand. 2, 3, 4
581 # CHECK-BE: or 2, 3, 4                      # encoding: [0x7c,0x62,0x23,0x78]
582 # CHECK-LE: or 2, 3, 4                      # encoding: [0x78,0x23,0x62,0x7c]
583             or 2, 3, 4
584 # CHECK-BE: or. 2, 3, 4                     # encoding: [0x7c,0x62,0x23,0x79]
585 # CHECK-LE: or. 2, 3, 4                     # encoding: [0x79,0x23,0x62,0x7c]
586             or. 2, 3, 4
587 # CHECK-BE: nor 2, 3, 4                     # encoding: [0x7c,0x62,0x20,0xf8]
588 # CHECK-LE: nor 2, 3, 4                     # encoding: [0xf8,0x20,0x62,0x7c]
589             nor 2, 3, 4
590 # CHECK-BE: nor. 2, 3, 4                    # encoding: [0x7c,0x62,0x20,0xf9]
591 # CHECK-LE: nor. 2, 3, 4                    # encoding: [0xf9,0x20,0x62,0x7c]
592             nor. 2, 3, 4
593 # CHECK-BE: eqv 2, 3, 4                     # encoding: [0x7c,0x62,0x22,0x38]
594 # CHECK-LE: eqv 2, 3, 4                     # encoding: [0x38,0x22,0x62,0x7c]
595             eqv 2, 3, 4
596 # CHECK-BE: eqv. 2, 3, 4                    # encoding: [0x7c,0x62,0x22,0x39]
597 # CHECK-LE: eqv. 2, 3, 4                    # encoding: [0x39,0x22,0x62,0x7c]
598             eqv. 2, 3, 4
599 # CHECK-BE: andc 2, 3, 4                    # encoding: [0x7c,0x62,0x20,0x78]
600 # CHECK-LE: andc 2, 3, 4                    # encoding: [0x78,0x20,0x62,0x7c]
601             andc 2, 3, 4
602 # CHECK-BE: andc. 2, 3, 4                   # encoding: [0x7c,0x62,0x20,0x79]
603 # CHECK-LE: andc. 2, 3, 4                   # encoding: [0x79,0x20,0x62,0x7c]
604             andc. 2, 3, 4
605 # CHECK-BE: orc 2, 3, 4                     # encoding: [0x7c,0x62,0x23,0x38]
606 # CHECK-LE: orc 2, 3, 4                     # encoding: [0x38,0x23,0x62,0x7c]
607             orc 2, 3, 4
608 # CHECK-BE: orc. 2, 3, 4                    # encoding: [0x7c,0x62,0x23,0x39]
609 # CHECK-LE: orc. 2, 3, 4                    # encoding: [0x39,0x23,0x62,0x7c]
610             orc. 2, 3, 4
611
612 # CHECK-BE: extsb 2, 3                      # encoding: [0x7c,0x62,0x07,0x74]
613 # CHECK-LE: extsb 2, 3                      # encoding: [0x74,0x07,0x62,0x7c]
614             extsb 2, 3
615 # CHECK-BE: extsb. 2, 3                     # encoding: [0x7c,0x62,0x07,0x75]
616 # CHECK-LE: extsb. 2, 3                     # encoding: [0x75,0x07,0x62,0x7c]
617             extsb. 2, 3
618 # CHECK-BE: extsh 2, 3                      # encoding: [0x7c,0x62,0x07,0x34]
619 # CHECK-LE: extsh 2, 3                      # encoding: [0x34,0x07,0x62,0x7c]
620             extsh 2, 3
621 # CHECK-BE: extsh. 2, 3                     # encoding: [0x7c,0x62,0x07,0x35]
622 # CHECK-LE: extsh. 2, 3                     # encoding: [0x35,0x07,0x62,0x7c]
623             extsh. 2, 3
624
625 # CHECK-BE: cntlzw 2, 3                     # encoding: [0x7c,0x62,0x00,0x34]
626 # CHECK-LE: cntlzw 2, 3                     # encoding: [0x34,0x00,0x62,0x7c]
627             cntlzw 2, 3
628 # CHECK-BE: cntlzw. 2, 3                    # encoding: [0x7c,0x62,0x00,0x35]
629 # CHECK-LE: cntlzw. 2, 3                    # encoding: [0x35,0x00,0x62,0x7c]
630             cntlzw. 2, 3
631 # CHECK-BE: cntlzw 2, 3                     # encoding: [0x7c,0x62,0x00,0x34]
632 # CHECK-LE: cntlzw 2, 3                     # encoding: [0x34,0x00,0x62,0x7c]
633             cntlz  2, 3
634 # CHECK-BE: cntlzw. 2, 3                    # encoding: [0x7c,0x62,0x00,0x35]
635 # CHECK-LE: cntlzw. 2, 3                    # encoding: [0x35,0x00,0x62,0x7c]
636             cntlz.  2, 3
637             cmpb 7, 21, 4
638 # CHECK-BE: cmpb 7, 21, 4                   # encoding: [0x7e,0xa7,0x23,0xf8]
639 # CHECK-LE: cmpb 7, 21, 4                   # encoding: [0xf8,0x23,0xa7,0x7e]
640 # FIXME:    popcntb 2, 3
641 # CHECK-BE: popcntw 2, 3                    # encoding: [0x7c,0x62,0x02,0xf4]
642 # CHECK-LE: popcntw 2, 3                    # encoding: [0xf4,0x02,0x62,0x7c]
643             popcntw 2, 3
644 # FIXME:    prtyd 2, 3
645 # FIXME:    prtyw 2, 3
646
647 # CHECK-BE: extsw 2, 3                      # encoding: [0x7c,0x62,0x07,0xb4]
648 # CHECK-LE: extsw 2, 3                      # encoding: [0xb4,0x07,0x62,0x7c]
649             extsw 2, 3
650 # CHECK-BE: extsw. 2, 3                     # encoding: [0x7c,0x62,0x07,0xb5]
651 # CHECK-LE: extsw. 2, 3                     # encoding: [0xb5,0x07,0x62,0x7c]
652             extsw. 2, 3
653
654 # CHECK-BE: cntlzd 2, 3                     # encoding: [0x7c,0x62,0x00,0x74]
655 # CHECK-LE: cntlzd 2, 3                     # encoding: [0x74,0x00,0x62,0x7c]
656             cntlzd 2, 3
657 # CHECK-BE: cntlzd. 2, 3                    # encoding: [0x7c,0x62,0x00,0x75]
658 # CHECK-LE: cntlzd. 2, 3                    # encoding: [0x75,0x00,0x62,0x7c]
659             cntlzd. 2, 3
660 # CHECK-BE: popcntd 2, 3                    # encoding: [0x7c,0x62,0x03,0xf4]
661 # CHECK-LE: popcntd 2, 3                    # encoding: [0xf4,0x03,0x62,0x7c]
662             popcntd 2, 3
663 # CHECK-BE: bpermd 2, 3, 4                  # encoding: [0x7c,0x62,0x21,0xf8]
664 # CHECK-LE: bpermd 2, 3, 4                  # encoding: [0xf8,0x21,0x62,0x7c]
665             bpermd 2, 3, 4
666
667 # Fixed-point rotate and shift instructions
668
669 # CHECK-BE: rlwinm 2, 3, 4, 5, 6            # encoding: [0x54,0x62,0x21,0x4c]
670 # CHECK-LE: rlwinm 2, 3, 4, 5, 6            # encoding: [0x4c,0x21,0x62,0x54]
671             rlwinm 2, 3, 4, 5, 6
672 # CHECK-BE: rlwinm. 2, 3, 4, 5, 6           # encoding: [0x54,0x62,0x21,0x4d]
673 # CHECK-LE: rlwinm. 2, 3, 4, 5, 6           # encoding: [0x4d,0x21,0x62,0x54]
674             rlwinm. 2, 3, 4, 5, 6
675 # CHECK-BE: rlwnm 2, 3, 4, 5, 6             # encoding: [0x5c,0x62,0x21,0x4c]
676 # CHECK-LE: rlwnm 2, 3, 4, 5, 6             # encoding: [0x4c,0x21,0x62,0x5c]
677             rlwnm 2, 3, 4, 5, 6
678 # CHECK-BE: rlwnm. 2, 3, 4, 5, 6            # encoding: [0x5c,0x62,0x21,0x4d]
679 # CHECK-LE: rlwnm. 2, 3, 4, 5, 6            # encoding: [0x4d,0x21,0x62,0x5c]
680             rlwnm. 2, 3, 4, 5, 6
681 # CHECK-BE: rlwimi 2, 3, 4, 5, 6            # encoding: [0x50,0x62,0x21,0x4c]
682 # CHECK-LE: rlwimi 2, 3, 4, 5, 6            # encoding: [0x4c,0x21,0x62,0x50]
683             rlwimi 2, 3, 4, 5, 6
684 # CHECK-BE: rlwimi. 2, 3, 4, 5, 6           # encoding: [0x50,0x62,0x21,0x4d]
685 # CHECK-LE: rlwimi. 2, 3, 4, 5, 6           # encoding: [0x4d,0x21,0x62,0x50]
686             rlwimi. 2, 3, 4, 5, 6
687 # CHECK-BE: rldicl 2, 3, 4, 5               # encoding: [0x78,0x62,0x21,0x40]
688 # CHECK-LE: rldicl 2, 3, 4, 5               # encoding: [0x40,0x21,0x62,0x78]
689             rldicl 2, 3, 4, 5
690 # CHECK-BE: rldicl. 2, 3, 4, 5              # encoding: [0x78,0x62,0x21,0x41]
691 # CHECK-LE: rldicl. 2, 3, 4, 5              # encoding: [0x41,0x21,0x62,0x78]
692             rldicl. 2, 3, 4, 5
693 # CHECK-BE: rldicr 2, 3, 4, 5               # encoding: [0x78,0x62,0x21,0x44]
694 # CHECK-LE: rldicr 2, 3, 4, 5               # encoding: [0x44,0x21,0x62,0x78]
695             rldicr 2, 3, 4, 5
696 # CHECK-BE: rldicr. 2, 3, 4, 5              # encoding: [0x78,0x62,0x21,0x45]
697 # CHECK-LE: rldicr. 2, 3, 4, 5              # encoding: [0x45,0x21,0x62,0x78]
698             rldicr. 2, 3, 4, 5
699 # CHECK-BE: rldic 2, 3, 4, 5                # encoding: [0x78,0x62,0x21,0x48]
700 # CHECK-LE: rldic 2, 3, 4, 5                # encoding: [0x48,0x21,0x62,0x78]
701             rldic 2, 3, 4, 5
702 # CHECK-BE: rldic. 2, 3, 4, 5               # encoding: [0x78,0x62,0x21,0x49]
703 # CHECK-LE: rldic. 2, 3, 4, 5               # encoding: [0x49,0x21,0x62,0x78]
704             rldic. 2, 3, 4, 5
705 # CHECK-BE: rldcl 2, 3, 4, 5                # encoding: [0x78,0x62,0x21,0x50]
706 # CHECK-LE: rldcl 2, 3, 4, 5                # encoding: [0x50,0x21,0x62,0x78]
707             rldcl 2, 3, 4, 5
708 # CHECK-BE: rldcl. 2, 3, 4, 5               # encoding: [0x78,0x62,0x21,0x51]
709 # CHECK-LE: rldcl. 2, 3, 4, 5               # encoding: [0x51,0x21,0x62,0x78]
710             rldcl. 2, 3, 4, 5
711 # CHECK-BE: rldcr 2, 3, 4, 5                # encoding: [0x78,0x62,0x21,0x52]
712 # CHECK-LE: rldcr 2, 3, 4, 5                # encoding: [0x52,0x21,0x62,0x78]
713             rldcr 2, 3, 4, 5
714 # CHECK-BE: rldcr. 2, 3, 4, 5               # encoding: [0x78,0x62,0x21,0x53]
715 # CHECK-LE: rldcr. 2, 3, 4, 5               # encoding: [0x53,0x21,0x62,0x78]
716             rldcr. 2, 3, 4, 5
717 # CHECK-BE: rldimi 2, 3, 4, 5               # encoding: [0x78,0x62,0x21,0x4c]
718 # CHECK-LE: rldimi 2, 3, 4, 5               # encoding: [0x4c,0x21,0x62,0x78]
719             rldimi 2, 3, 4, 5
720 # CHECK-BE: rldimi. 2, 3, 4, 5              # encoding: [0x78,0x62,0x21,0x4d]
721 # CHECK-LE: rldimi. 2, 3, 4, 5              # encoding: [0x4d,0x21,0x62,0x78]
722             rldimi. 2, 3, 4, 5
723
724 # Aliases that take bit masks...
725
726 # CHECK-BE: rlwinm  0, 0, 30, 31, 31        # encoding: [0x54,0x00,0xf7,0xfe]
727             rlwinm  0, 0, 30, 1
728 # CHECK-BE: rlwinm. 0, 0, 30, 31, 31        # encoding: [0x54,0x00,0xf7,0xff]
729             rlwinm. 0, 0, 30, 1
730 # CHECK-BE: rlwinm  0, 0, 30, 31, 0         # encoding: [0x54,0x00,0xf7,0xc0]
731             rlwinm  0, 0, 30, 2147483649
732 # CHECK-BE: rlwinm. 0, 0, 30, 31, 0         # encoding: [0x54,0x00,0xf7,0xc1]
733             rlwinm. 0, 0, 30, 2147483649
734 # CHECK-BE: rlwimi  0, 0, 30, 31, 31        # encoding: [0x50,0x00,0xf7,0xfe]
735             rlwimi  0, 0, 30, 1
736 # CHECK-BE: rlwimi. 0, 0, 30, 31, 31        # encoding: [0x50,0x00,0xf7,0xff]
737             rlwimi. 0, 0, 30, 1
738 # CHECK-BE: rlwimi  0, 0, 30, 31, 0         # encoding: [0x50,0x00,0xf7,0xc0]
739             rlwimi  0, 0, 30, 2147483649
740 # CHECK-BE: rlwimi. 0, 0, 30, 31, 0         # encoding: [0x50,0x00,0xf7,0xc1]
741             rlwimi. 0, 0, 30, 2147483649
742 # CHECK-BE: rlwnm   0, 0, 30, 31, 31        # encoding: [0x5c,0x00,0xf7,0xfe]
743             rlwnm  0, 0, 30, 1
744 # CHECK-BE: rlwnm.  0, 0, 30, 31, 31        # encoding: [0x5c,0x00,0xf7,0xff]
745             rlwnm. 0, 0, 30, 1
746 # CHECK-BE: rlwnm   0, 0, 30, 31, 0         # encoding: [0x5c,0x00,0xf7,0xc0]
747             rlwnm  0, 0, 30, 2147483649
748 # CHECK-BE: rlwnm.  0, 0, 30, 31, 0         # encoding: [0x5c,0x00,0xf7,0xc1]
749             rlwnm. 0, 0, 30, 2147483649
750
751 # CHECK-BE: slw 2, 3, 4                     # encoding: [0x7c,0x62,0x20,0x30]
752 # CHECK-LE: slw 2, 3, 4                     # encoding: [0x30,0x20,0x62,0x7c]
753             slw 2, 3, 4
754 # CHECK-BE: slw. 2, 3, 4                    # encoding: [0x7c,0x62,0x20,0x31]
755 # CHECK-LE: slw. 2, 3, 4                    # encoding: [0x31,0x20,0x62,0x7c]
756             slw. 2, 3, 4
757 # CHECK-BE: srw 2, 3, 4                     # encoding: [0x7c,0x62,0x24,0x30]
758 # CHECK-LE: srw 2, 3, 4                     # encoding: [0x30,0x24,0x62,0x7c]
759             srw 2, 3, 4
760 # CHECK-BE: srw. 2, 3, 4                    # encoding: [0x7c,0x62,0x24,0x31]
761 # CHECK-LE: srw. 2, 3, 4                    # encoding: [0x31,0x24,0x62,0x7c]
762             srw. 2, 3, 4
763 # CHECK-BE: srawi 2, 3, 4                   # encoding: [0x7c,0x62,0x26,0x70]
764 # CHECK-LE: srawi 2, 3, 4                   # encoding: [0x70,0x26,0x62,0x7c]
765             srawi 2, 3, 4
766 # CHECK-BE: srawi. 2, 3, 4                  # encoding: [0x7c,0x62,0x26,0x71]
767 # CHECK-LE: srawi. 2, 3, 4                  # encoding: [0x71,0x26,0x62,0x7c]
768             srawi. 2, 3, 4
769 # CHECK-BE: sraw 2, 3, 4                    # encoding: [0x7c,0x62,0x26,0x30]
770 # CHECK-LE: sraw 2, 3, 4                    # encoding: [0x30,0x26,0x62,0x7c]
771             sraw 2, 3, 4
772 # CHECK-BE: sraw. 2, 3, 4                   # encoding: [0x7c,0x62,0x26,0x31]
773 # CHECK-LE: sraw. 2, 3, 4                   # encoding: [0x31,0x26,0x62,0x7c]
774             sraw. 2, 3, 4
775 # CHECK-BE: sld 2, 3, 4                     # encoding: [0x7c,0x62,0x20,0x36]
776 # CHECK-LE: sld 2, 3, 4                     # encoding: [0x36,0x20,0x62,0x7c]
777             sld 2, 3, 4
778 # CHECK-BE: sld. 2, 3, 4                    # encoding: [0x7c,0x62,0x20,0x37]
779 # CHECK-LE: sld. 2, 3, 4                    # encoding: [0x37,0x20,0x62,0x7c]
780             sld. 2, 3, 4
781 # CHECK-BE: srd 2, 3, 4                     # encoding: [0x7c,0x62,0x24,0x36]
782 # CHECK-LE: srd 2, 3, 4                     # encoding: [0x36,0x24,0x62,0x7c]
783             srd 2, 3, 4
784 # CHECK-BE: srd. 2, 3, 4                    # encoding: [0x7c,0x62,0x24,0x37]
785 # CHECK-LE: srd. 2, 3, 4                    # encoding: [0x37,0x24,0x62,0x7c]
786             srd. 2, 3, 4
787 # CHECK-BE: sradi 2, 3, 4                   # encoding: [0x7c,0x62,0x26,0x74]
788 # CHECK-LE: sradi 2, 3, 4                   # encoding: [0x74,0x26,0x62,0x7c]
789             sradi 2, 3, 4
790 # CHECK-BE: sradi. 2, 3, 4                  # encoding: [0x7c,0x62,0x26,0x75]
791 # CHECK-LE: sradi. 2, 3, 4                  # encoding: [0x75,0x26,0x62,0x7c]
792             sradi. 2, 3, 4
793 # CHECK-BE: srad 2, 3, 4                    # encoding: [0x7c,0x62,0x26,0x34]
794 # CHECK-LE: srad 2, 3, 4                    # encoding: [0x34,0x26,0x62,0x7c]
795             srad 2, 3, 4
796 # CHECK-BE: srad. 2, 3, 4                   # encoding: [0x7c,0x62,0x26,0x35]
797 # CHECK-LE: srad. 2, 3, 4                   # encoding: [0x35,0x26,0x62,0x7c]
798             srad. 2, 3, 4
799
800 # FIXME: BCD assist instructions
801
802 # Move to/from system register instructions
803
804 # CHECK-BE: mtspr 600, 2                    # encoding: [0x7c,0x58,0x93,0xa6]
805 # CHECK-LE: mtspr 600, 2                    # encoding: [0xa6,0x93,0x58,0x7c]
806             mtspr 600, 2
807 # CHECK-BE: mfspr 2, 600                    # encoding: [0x7c,0x58,0x92,0xa6]
808 # CHECK-LE: mfspr 2, 600                    # encoding: [0xa6,0x92,0x58,0x7c]
809             mfspr 2, 600
810 # CHECK-BE: mtcrf 123, 2                    # encoding: [0x7c,0x47,0xb1,0x20]
811 # CHECK-LE: mtcrf 123, 2                    # encoding: [0x20,0xb1,0x47,0x7c]
812             mtcrf 123, 2
813 # CHECK-BE: mfcr 2                          # encoding: [0x7c,0x40,0x00,0x26]
814 # CHECK-LE: mfcr 2                          # encoding: [0x26,0x00,0x40,0x7c]
815             mfcr 2
816 # CHECK-BE: mtocrf 16, 2                    # encoding: [0x7c,0x51,0x01,0x20]
817 # CHECK-LE: mtocrf 16, 2                    # encoding: [0x20,0x01,0x51,0x7c]
818             mtocrf 16, 2
819 # CHECK-BE: mfocrf 16, 8                    # encoding: [0x7e,0x10,0x80,0x26]
820 # CHECK-LE: mfocrf 16, 8                    # encoding: [0x26,0x80,0x10,0x7e]
821             mfocrf 16, 8
822
823 # Move to/from segment register
824 # CHECK-BE: mtsr    12, 10                    # encoding: [0x7d,0x4c,0x01,0xa4]
825 # CHECK-LE: mtsr    12, 10                    # encoding: [0xa4,0x01,0x4c,0x7d]
826             mtsr    12,%r10
827 # CHECK-BE: mfsr    10, 12                    # encoding: [0x7d,0x4c,0x04,0xa6]
828 # CHECK-LE: mfsr    10, 12                    # encoding: [0xa6,0x04,0x4c,0x7d]
829             mfsr    %r10,12
830
831 # CHECK-BE: mtsrin  10, 12                    # encoding: [0x7d,0x40,0x61,0xe4]
832 # CHECK-LE: mtsrin  10, 12                    # encoding: [0xe4,0x61,0x40,0x7d]
833             mtsrin  %r10,%r12
834 # CHECK-BE: mfsrin  10, 12                    # encoding: [0x7d,0x40,0x65,0x26]
835 # CHECK-LE: mfsrin  10, 12                    # encoding: [0x26,0x65,0x40,0x7d]
836             mfsrin  %r10,%r12