1
2# RUN: llvm-mc -triple powerpc64-unknown-unknown --show-encoding %s | FileCheck %s
3
4# Branch facility
5
6# Branch instructions
7
8# CHECK: b target                        # encoding: [0b010010AA,A,A,0bAAAAAA00]
9# CHECK-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_br24
10         b target
11# CHECK: ba target                       # encoding: [0b010010AA,A,A,0bAAAAAA10]
12# CHECK-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_br24abs
13         ba target
14# CHECK: bl target                       # encoding: [0b010010AA,A,A,0bAAAAAA01]
15# CHECK-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_br24
16         bl target
17# CHECK: bla target                      # encoding: [0b010010AA,A,A,0bAAAAAA11]
18# CHECK-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_br24abs
19         bla target
20
21# CHECK: bc 4, 10, target                # encoding: [0x40,0x8a,A,0bAAAAAA00]
22# CHECK-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_brcond14
23         bc 4, 10, target
24# CHECK: bca 4, 10, target               # encoding: [0x40,0x8a,A,0bAAAAAA10]
25# CHECK-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_brcond14abs
26         bca 4, 10, target
27# CHECK: bcl 4, 10, target               # encoding: [0x40,0x8a,A,0bAAAAAA01]
28# CHECK-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_brcond14
29         bcl 4, 10, target
30# CHECK: bcla 4, 10, target              # encoding: [0x40,0x8a,A,0bAAAAAA11]
31# CHECK-NEXT:                            #   fixup A - offset: 0, value: target, kind: fixup_ppc_brcond14abs
32         bcla 4, 10, target
33
34# CHECK: bclr 4, 10, 3                   # encoding: [0x4c,0x8a,0x18,0x20]
35         bclr 4, 10, 3
36# CHECK: bclr 4, 10, 0                   # encoding: [0x4c,0x8a,0x00,0x20]
37         bclr 4, 10
38# CHECK: bclrl 4, 10, 3                  # encoding: [0x4c,0x8a,0x18,0x21]
39         bclrl 4, 10, 3
40# CHECK: bclrl 4, 10, 0                  # encoding: [0x4c,0x8a,0x00,0x21]
41         bclrl 4, 10
42# CHECK: bcctr 4, 10, 3                  # encoding: [0x4c,0x8a,0x1c,0x20]
43         bcctr 4, 10, 3
44# CHECK: bcctr 4, 10, 0                  # encoding: [0x4c,0x8a,0x04,0x20]
45         bcctr 4, 10
46# CHECK: bcctrl 4, 10, 3                 # encoding: [0x4c,0x8a,0x1c,0x21]
47         bcctrl 4, 10, 3
48# CHECK: bcctrl 4, 10, 0                 # encoding: [0x4c,0x8a,0x04,0x21]
49         bcctrl 4, 10
50
51# Condition register instructions
52
53# CHECK: crand 2, 3, 4                   # encoding: [0x4c,0x43,0x22,0x02]
54         crand 2, 3, 4
55# CHECK: crnand 2, 3, 4                  # encoding: [0x4c,0x43,0x21,0xc2]
56         crnand 2, 3, 4
57# CHECK: cror 2, 3, 4                    # encoding: [0x4c,0x43,0x23,0x82]
58         cror 2, 3, 4
59# CHECK: crxor 2, 3, 4                   # encoding: [0x4c,0x43,0x21,0x82]
60         crxor 2, 3, 4
61# CHECK: crnor 2, 3, 4                   # encoding: [0x4c,0x43,0x20,0x42]
62         crnor 2, 3, 4
63# CHECK: creqv 2, 3, 4                   # encoding: [0x4c,0x43,0x22,0x42]
64         creqv 2, 3, 4
65# CHECK: crandc 2, 3, 4                  # encoding: [0x4c,0x43,0x21,0x02]
66         crandc 2, 3, 4
67# CHECK: crorc 2, 3, 4                   # encoding: [0x4c,0x43,0x23,0x42]
68         crorc 2, 3, 4
69# CHECK: mcrf 2, 3                       # encoding: [0x4d,0x0c,0x00,0x00]
70         mcrf 2, 3
71
72# System call instruction
73
74# CHECK: sc 1                            # encoding: [0x44,0x00,0x00,0x22]
75         sc 1
76# CHECK: sc 0                            # encoding: [0x44,0x00,0x00,0x02]
77         sc
78
79# Fixed-point facility
80
81# Fixed-point load instructions
82
83# CHECK: lbz 2, 128(4)                   # encoding: [0x88,0x44,0x00,0x80]
84         lbz 2, 128(4)
85# CHECK: lbzx 2, 3, 4                    # encoding: [0x7c,0x43,0x20,0xae]
86         lbzx 2, 3, 4
87# CHECK: lbzu 2, 128(4)                  # encoding: [0x8c,0x44,0x00,0x80]
88         lbzu 2, 128(4)
89# CHECK: lbzux 2, 3, 4                   # encoding: [0x7c,0x43,0x20,0xee]
90         lbzux 2, 3, 4
91# CHECK: lhz 2, 128(4)                   # encoding: [0xa0,0x44,0x00,0x80]
92         lhz 2, 128(4)
93# CHECK: lhzx 2, 3, 4                    # encoding: [0x7c,0x43,0x22,0x2e]
94         lhzx 2, 3, 4
95# CHECK: lhzu 2, 128(4)                  # encoding: [0xa4,0x44,0x00,0x80]
96         lhzu 2, 128(4)
97# CHECK: lhzux 2, 3, 4                   # encoding: [0x7c,0x43,0x22,0x6e]
98         lhzux 2, 3, 4
99# CHECK: lha 2, 128(4)                   # encoding: [0xa8,0x44,0x00,0x80]
100         lha 2, 128(4)
101# CHECK: lhax 2, 3, 4                    # encoding: [0x7c,0x43,0x22,0xae]
102         lhax 2, 3, 4
103# CHECK: lhau 2, 128(4)                  # encoding: [0xac,0x44,0x00,0x80]
104         lhau 2, 128(4)
105# CHECK: lhaux 2, 3, 4                   # encoding: [0x7c,0x43,0x22,0xee]
106         lhaux 2, 3, 4
107# CHECK: lwz 2, 128(4)                   # encoding: [0x80,0x44,0x00,0x80]
108         lwz 2, 128(4)
109# CHECK: lwzx 2, 3, 4                    # encoding: [0x7c,0x43,0x20,0x2e]
110         lwzx 2, 3, 4
111# CHECK: lwzu 2, 128(4)                  # encoding: [0x84,0x44,0x00,0x80]
112         lwzu 2, 128(4)
113# CHECK: lwzux 2, 3, 4                   # encoding: [0x7c,0x43,0x20,0x6e]
114         lwzux 2, 3, 4
115# CHECK: lwa 2, 128(4)                   # encoding: [0xe8,0x44,0x00,0x82]
116         lwa 2, 128(4)
117# CHECK: lwax 2, 3, 4                    # encoding: [0x7c,0x43,0x22,0xaa]
118         lwax 2, 3, 4
119# CHECK: lwaux 2, 3, 4                   # encoding: [0x7c,0x43,0x22,0xea]
120         lwaux 2, 3, 4
121# CHECK: ld 2, 128(4)                    # encoding: [0xe8,0x44,0x00,0x80]
122         ld 2, 128(4)
123# CHECK: ldx 2, 3, 4                     # encoding: [0x7c,0x43,0x20,0x2a]
124         ldx 2, 3, 4
125# CHECK: ldu 2, 128(4)                   # encoding: [0xe8,0x44,0x00,0x81]
126         ldu 2, 128(4)
127# CHECK: ldux 2, 3, 4                    # encoding: [0x7c,0x43,0x20,0x6a]
128         ldux 2, 3, 4
129
130# Fixed-point store instructions
131
132# CHECK: stb 2, 128(4)                   # encoding: [0x98,0x44,0x00,0x80]
133         stb 2, 128(4)
134# CHECK: stbx 2, 3, 4                    # encoding: [0x7c,0x43,0x21,0xae]
135         stbx 2, 3, 4
136# CHECK: stbu 2, 128(4)                  # encoding: [0x9c,0x44,0x00,0x80]
137         stbu 2, 128(4)
138# CHECK: stbux 2, 3, 4                   # encoding: [0x7c,0x43,0x21,0xee]
139         stbux 2, 3, 4
140# CHECK: sth 2, 128(4)                   # encoding: [0xb0,0x44,0x00,0x80]
141         sth 2, 128(4)
142# CHECK: sthx 2, 3, 4                    # encoding: [0x7c,0x43,0x23,0x2e]
143         sthx 2, 3, 4
144# CHECK: sthu 2, 128(4)                  # encoding: [0xb4,0x44,0x00,0x80]
145         sthu 2, 128(4)
146# CHECK: sthux 2, 3, 4                   # encoding: [0x7c,0x43,0x23,0x6e]
147         sthux 2, 3, 4
148# CHECK: stw 2, 128(4)                   # encoding: [0x90,0x44,0x00,0x80]
149         stw 2, 128(4)
150# CHECK: stwx 2, 3, 4                    # encoding: [0x7c,0x43,0x21,0x2e]
151         stwx 2, 3, 4
152# CHECK: stwu 2, 128(4)                  # encoding: [0x94,0x44,0x00,0x80]
153         stwu 2, 128(4)
154# CHECK: stwux 2, 3, 4                   # encoding: [0x7c,0x43,0x21,0x6e]
155         stwux 2, 3, 4
156# CHECK: std 2, 128(4)                   # encoding: [0xf8,0x44,0x00,0x80]
157         std 2, 128(4)
158# CHECK: stdx 2, 3, 4                    # encoding: [0x7c,0x43,0x21,0x2a]
159         stdx 2, 3, 4
160# CHECK: stdu 2, 128(4)                  # encoding: [0xf8,0x44,0x00,0x81]
161         stdu 2, 128(4)
162# CHECK: stdux 2, 3, 4                   # encoding: [0x7c,0x43,0x21,0x6a]
163         stdux 2, 3, 4
164
165# Fixed-point load and store with byte reversal instructions
166
167# CHECK: lhbrx 2, 3, 4                   # encoding: [0x7c,0x43,0x26,0x2c]
168         lhbrx 2, 3, 4
169# CHECK: sthbrx 2, 3, 4                  # encoding: [0x7c,0x43,0x27,0x2c]
170         sthbrx 2, 3, 4
171# CHECK: lwbrx 2, 3, 4                   # encoding: [0x7c,0x43,0x24,0x2c]
172         lwbrx 2, 3, 4
173# CHECK: stwbrx 2, 3, 4                  # encoding: [0x7c,0x43,0x25,0x2c]
174         stwbrx 2, 3, 4
175# CHECK: ldbrx 2, 3, 4                   # encoding: [0x7c,0x43,0x24,0x28]
176         ldbrx 2, 3, 4
177# CHECK: stdbrx 2, 3, 4                  # encoding: [0x7c,0x43,0x25,0x28]
178         stdbrx 2, 3, 4
179
180# Fixed-point load and store multiple instructions
181
182# CHECK: lmw 2, 128(1)                   # encoding: [0xb8,0x41,0x00,0x80]
183         lmw 2, 128(1)
184# CHECK: stmw 2, 128(1)                  # encoding: [0xbc,0x41,0x00,0x80]
185         stmw 2, 128(1)
186
187# FIXME: Fixed-point move assist instructions
188
189# Fixed-point arithmetic instructions
190
191# CHECK: addi 2, 3, 128                  # encoding: [0x38,0x43,0x00,0x80]
192         addi 2, 3, 128
193# CHECK: addis 2, 3, 128                 # encoding: [0x3c,0x43,0x00,0x80]
194         addis 2, 3, 128
195# CHECK: add 2, 3, 4                     # encoding: [0x7c,0x43,0x22,0x14]
196         add 2, 3, 4
197# CHECK: add. 2, 3, 4                    # encoding: [0x7c,0x43,0x22,0x15]
198         add. 2, 3, 4
199# FIXME: addo 2, 3, 4
200# FIXME: addo. 2, 3, 4
201# CHECK: subf 2, 3, 4                    # encoding: [0x7c,0x43,0x20,0x50]
202         subf 2, 3, 4
203# CHECK: subf. 2, 3, 4                   # encoding: [0x7c,0x43,0x20,0x51]
204         subf. 2, 3, 4
205# FIXME: subfo 2, 3, 4
206# FIXME: subfo. 2, 3, 4
207# CHECK: addic 2, 3, 128                 # encoding: [0x30,0x43,0x00,0x80]
208         addic 2, 3, 128
209# CHECK: addic. 2, 3, 128                # encoding: [0x34,0x43,0x00,0x80]
210         addic. 2, 3, 128
211# CHECK: subfic 2, 3, 4                  # encoding: [0x20,0x43,0x00,0x04]
212         subfic 2, 3, 4
213
214# CHECK: addc 2, 3, 4                    # encoding: [0x7c,0x43,0x20,0x14]
215         addc 2, 3, 4
216# CHECK: addc. 2, 3, 4                   # encoding: [0x7c,0x43,0x20,0x15]
217         addc. 2, 3, 4
218# FIXME: addco 2, 3, 4
219# FIXME: addco. 2, 3, 4
220# CHECK: subfc 2, 3, 4                   # encoding: [0x7c,0x43,0x20,0x10]
221         subfc 2, 3, 4
222# CHECK: subfc 2, 3, 4                   # encoding: [0x7c,0x43,0x20,0x10]
223         subfc 2, 3, 4
224# FIXME: subfco 2, 3, 4
225# FIXME: subfco. 2, 3, 4
226
227# CHECK: adde 2, 3, 4                    # encoding: [0x7c,0x43,0x21,0x14]
228         adde 2, 3, 4
229# CHECK: adde. 2, 3, 4                   # encoding: [0x7c,0x43,0x21,0x15]
230         adde. 2, 3, 4
231# FIXME: addeo 2, 3, 4
232# FIXME: addeo. 2, 3, 4
233# CHECK: subfe 2, 3, 4                   # encoding: [0x7c,0x43,0x21,0x10]
234         subfe 2, 3, 4
235# CHECK: subfe. 2, 3, 4                  # encoding: [0x7c,0x43,0x21,0x11]
236         subfe. 2, 3, 4
237# FIXME: subfeo 2, 3, 4
238# FIXME: subfeo. 2, 3, 4
239
240# CHECK: addme 2, 3                      # encoding: [0x7c,0x43,0x01,0xd4]
241         addme 2, 3
242# CHECK: addme. 2, 3                     # encoding: [0x7c,0x43,0x01,0xd5]
243         addme. 2, 3
244# FIXME: addmeo 2, 3
245# FIXME: addmeo. 2, 3
246# CHECK: subfme 2, 3                     # encoding: [0x7c,0x43,0x01,0xd0]
247         subfme 2, 3
248# CHECK: subfme. 2, 3                    # encoding: [0x7c,0x43,0x01,0xd1]
249         subfme. 2, 3
250# FIXME: subfmeo 2, 3
251# FIXME: subfmeo. 2, 3
252
253# CHECK: addze 2, 3                      # encoding: [0x7c,0x43,0x01,0x94]
254         addze 2, 3
255# CHECK: addze. 2, 3                     # encoding: [0x7c,0x43,0x01,0x95]
256         addze. 2, 3
257# FIXME: addzeo 2, 3
258# FIXME: addzeo. 2, 3
259# CHECK: subfze 2, 3                     # encoding: [0x7c,0x43,0x01,0x90]
260         subfze 2, 3
261# CHECK: subfze. 2, 3                    # encoding: [0x7c,0x43,0x01,0x91]
262         subfze. 2, 3
263# FIXME: subfzeo 2, 3
264# FIXME: subfzeo. 2, 3
265
266# CHECK: neg 2, 3                        # encoding: [0x7c,0x43,0x00,0xd0]
267         neg 2, 3
268# CHECK: neg. 2, 3                       # encoding: [0x7c,0x43,0x00,0xd1]
269         neg. 2, 3
270# FIXME: nego 2, 3
271# FIXME: nego. 2, 3
272
273# CHECK: mulli 2, 3, 128                 # encoding: [0x1c,0x43,0x00,0x80]
274         mulli 2, 3, 128
275# CHECK: mulhw 2, 3, 4                   # encoding: [0x7c,0x43,0x20,0x96]
276         mulhw 2, 3, 4
277# CHECK: mulhw. 2, 3, 4                  # encoding: [0x7c,0x43,0x20,0x97]
278         mulhw. 2, 3, 4
279# CHECK: mullw 2, 3, 4                   # encoding: [0x7c,0x43,0x21,0xd6]
280         mullw 2, 3, 4
281# CHECK: mullw. 2, 3, 4                  # encoding: [0x7c,0x43,0x21,0xd7]
282         mullw. 2, 3, 4
283# FIXME: mullwo 2, 3, 4
284# FIXME: mullwo. 2, 3, 4
285# CHECK: mulhwu 2, 3, 4                  # encoding: [0x7c,0x43,0x20,0x16]
286         mulhwu 2, 3, 4
287# CHECK: mulhwu. 2, 3, 4                 # encoding: [0x7c,0x43,0x20,0x17]
288         mulhwu. 2, 3, 4
289
290# CHECK: divw 2, 3, 4                    # encoding: [0x7c,0x43,0x23,0xd6]
291         divw 2, 3, 4
292# CHECK: divw. 2, 3, 4                   # encoding: [0x7c,0x43,0x23,0xd7]
293         divw. 2, 3, 4
294# FIXME: divwo 2, 3, 4
295# FIXME: divwo. 2, 3, 4
296# CHECK: divwu 2, 3, 4                   # encoding: [0x7c,0x43,0x23,0x96]
297         divwu 2, 3, 4
298# CHECK: divwu. 2, 3, 4                  # encoding: [0x7c,0x43,0x23,0x97]
299         divwu. 2, 3, 4
300# FIXME: divwuo 2, 3, 4
301# FIXME: divwuo. 2, 3, 4
302# FIXME: divwe 2, 3, 4
303# FIXME: divwe. 2, 3, 4
304# FIXME: divweo 2, 3, 4
305# FIXME: divweo. 2, 3, 4
306# FIXME: divweu 2, 3, 4
307# FIXME: divweu. 2, 3, 4
308# FIXME: divweuo 2, 3, 4
309# FIXME: divweuo. 2, 3, 4
310
311# CHECK: mulld 2, 3, 4                   # encoding: [0x7c,0x43,0x21,0xd2]
312         mulld 2, 3, 4
313# CHECK: mulld. 2, 3, 4                  # encoding: [0x7c,0x43,0x21,0xd3]
314         mulld. 2, 3, 4
315# FIXME: mulldo 2, 3, 4
316# FIXME: mulldo. 2, 3, 4
317# CHECK: mulhd 2, 3, 4                   # encoding: [0x7c,0x43,0x20,0x92]
318         mulhd 2, 3, 4
319# CHECK: mulhd. 2, 3, 4                  # encoding: [0x7c,0x43,0x20,0x93]
320         mulhd. 2, 3, 4
321# CHECK: mulhdu 2, 3, 4                  # encoding: [0x7c,0x43,0x20,0x12]
322         mulhdu 2, 3, 4
323# CHECK: mulhdu. 2, 3, 4                 # encoding: [0x7c,0x43,0x20,0x13]
324         mulhdu. 2, 3, 4
325
326# CHECK: divd 2, 3, 4                    # encoding: [0x7c,0x43,0x23,0xd2]
327         divd 2, 3, 4
328# CHECK: divd. 2, 3, 4                   # encoding: [0x7c,0x43,0x23,0xd3]
329         divd. 2, 3, 4
330# FIXME: divdo 2, 3, 4
331# FIXME: divdo. 2, 3, 4
332# CHECK: divdu 2, 3, 4                   # encoding: [0x7c,0x43,0x23,0x92]
333         divdu 2, 3, 4
334# CHECK: divdu. 2, 3, 4                  # encoding: [0x7c,0x43,0x23,0x93]
335         divdu. 2, 3, 4
336# FIXME: divduo 2, 3, 4
337# FIXME: divduo. 2, 3, 4
338# FIXME: divde 2, 3, 4
339# FIXME: divde. 2, 3, 4
340# FIXME: divdeo 2, 3, 4
341# FIXME: divdeo. 2, 3, 4
342# FIXME: divdeu 2, 3, 4
343# FIXME: divdeu. 2, 3, 4
344# FIXME: divdeuo 2, 3, 4
345# FIXME: divdeuo. 2, 3, 4
346
347# Fixed-point compare instructions
348
349# CHECK: cmpdi 2, 3, 128                 # encoding: [0x2d,0x23,0x00,0x80]
350         cmpi 2, 1, 3, 128
351# CHECK: cmpd 2, 3, 4                    # encoding: [0x7d,0x23,0x20,0x00]
352         cmp 2, 1, 3, 4
353# CHECK: cmpldi 2, 3, 128                # encoding: [0x29,0x23,0x00,0x80]
354         cmpli 2, 1, 3, 128
355# CHECK: cmpld 2, 3, 4                   # encoding: [0x7d,0x23,0x20,0x40]
356         cmpl 2, 1, 3, 4
357
358# CHECK: cmpwi 2, 3, 128                 # encoding: [0x2d,0x03,0x00,0x80]
359         cmpi 2, 0, 3, 128
360# CHECK: cmpw 2, 3, 4                    # encoding: [0x7d,0x03,0x20,0x00]
361         cmp 2, 0, 3, 4
362# CHECK: cmplwi 2, 3, 128                # encoding: [0x29,0x03,0x00,0x80]
363         cmpli 2, 0, 3, 128
364# CHECK: cmplw 2, 3, 4                   # encoding: [0x7d,0x03,0x20,0x40]
365         cmpl 2, 0, 3, 4
366
367# Fixed-point trap instructions
368
369# CHECK: twi 2, 3, 4                     # encoding: [0x0c,0x43,0x00,0x04]
370         twi 2, 3, 4
371# CHECK: tw 2, 3, 4                      # encoding: [0x7c,0x43,0x20,0x08]
372         tw 2, 3, 4
373# CHECK: tdi 2, 3, 4                     # encoding: [0x08,0x43,0x00,0x04]
374         tdi 2, 3, 4
375# CHECK: td 2, 3, 4                      # encoding: [0x7c,0x43,0x20,0x88]
376         td 2, 3, 4
377
378# Fixed-point select
379
380# CHECK: isel 2, 3, 4, 5                 # encoding: [0x7c,0x43,0x21,0x5e]
381         isel 2, 3, 4, 5
382
383# Fixed-point logical instructions
384
385# CHECK: andi. 2, 3, 128                 # encoding: [0x70,0x62,0x00,0x80]
386         andi. 2, 3, 128
387# CHECK: andis. 2, 3, 128                # encoding: [0x74,0x62,0x00,0x80]
388         andis. 2, 3, 128
389# CHECK: ori 2, 3, 128                   # encoding: [0x60,0x62,0x00,0x80]
390         ori 2, 3, 128
391# CHECK: oris 2, 3, 128                  # encoding: [0x64,0x62,0x00,0x80]
392         oris 2, 3, 128
393# CHECK: xori 2, 3, 128                  # encoding: [0x68,0x62,0x00,0x80]
394         xori 2, 3, 128
395# CHECK: xoris 2, 3, 128                 # encoding: [0x6c,0x62,0x00,0x80]
396         xoris 2, 3, 128
397# CHECK: and 2, 3, 4                     # encoding: [0x7c,0x62,0x20,0x38]
398         and 2, 3, 4
399# CHECK: and. 2, 3, 4                    # encoding: [0x7c,0x62,0x20,0x39]
400         and. 2, 3, 4
401# CHECK: xor 2, 3, 4                     # encoding: [0x7c,0x62,0x22,0x78]
402         xor 2, 3, 4
403# CHECK: xor. 2, 3, 4                    # encoding: [0x7c,0x62,0x22,0x79]
404         xor. 2, 3, 4
405# CHECK: nand 2, 3, 4                    # encoding: [0x7c,0x62,0x23,0xb8]
406         nand 2, 3, 4
407# CHECK: nand. 2, 3, 4                   # encoding: [0x7c,0x62,0x23,0xb9]
408         nand. 2, 3, 4
409# CHECK: or 2, 3, 4                      # encoding: [0x7c,0x62,0x23,0x78]
410         or 2, 3, 4
411# CHECK: or. 2, 3, 4                     # encoding: [0x7c,0x62,0x23,0x79]
412         or. 2, 3, 4
413# CHECK: nor 2, 3, 4                     # encoding: [0x7c,0x62,0x20,0xf8]
414         nor 2, 3, 4
415# CHECK: nor. 2, 3, 4                    # encoding: [0x7c,0x62,0x20,0xf9]
416         nor. 2, 3, 4
417# CHECK: eqv 2, 3, 4                     # encoding: [0x7c,0x62,0x22,0x38]
418         eqv 2, 3, 4
419# CHECK: eqv. 2, 3, 4                    # encoding: [0x7c,0x62,0x22,0x39]
420         eqv. 2, 3, 4
421# CHECK: andc 2, 3, 4                    # encoding: [0x7c,0x62,0x20,0x78]
422         andc 2, 3, 4
423# CHECK: andc. 2, 3, 4                   # encoding: [0x7c,0x62,0x20,0x79]
424         andc. 2, 3, 4
425# CHECK: orc 2, 3, 4                     # encoding: [0x7c,0x62,0x23,0x38]
426         orc 2, 3, 4
427# CHECK: orc. 2, 3, 4                    # encoding: [0x7c,0x62,0x23,0x39]
428         orc. 2, 3, 4
429
430# CHECK: extsb 2, 3                      # encoding: [0x7c,0x62,0x07,0x74]
431         extsb 2, 3
432# CHECK: extsb. 2, 3                     # encoding: [0x7c,0x62,0x07,0x75]
433         extsb. 2, 3
434# CHECK: extsh 2, 3                      # encoding: [0x7c,0x62,0x07,0x34]
435         extsh 2, 3
436# CHECK: extsh. 2, 3                     # encoding: [0x7c,0x62,0x07,0x35]
437         extsh. 2, 3
438
439# CHECK: cntlzw 2, 3                     # encoding: [0x7c,0x62,0x00,0x34]
440         cntlzw 2, 3
441# CHECK: cntlzw. 2, 3                    # encoding: [0x7c,0x62,0x00,0x35]
442         cntlzw. 2, 3
443# FIXME: cmpb 2, 3, 4
444# FIXME: popcntb 2, 3
445# CHECK: popcntw 2, 3                    # encoding: [0x7c,0x62,0x02,0xf4]
446         popcntw 2, 3
447# FIXME: prtyd 2, 3
448# FIXME: prtyw 2, 3
449
450# CHECK: extsw 2, 3                      # encoding: [0x7c,0x62,0x07,0xb4]
451         extsw 2, 3
452# CHECK: extsw. 2, 3                     # encoding: [0x7c,0x62,0x07,0xb5]
453         extsw. 2, 3
454
455# CHECK: cntlzd 2, 3                     # encoding: [0x7c,0x62,0x00,0x74]
456         cntlzd 2, 3
457# CHECK: cntlzd. 2, 3                    # encoding: [0x7c,0x62,0x00,0x75]
458         cntlzd. 2, 3
459# CHECK: popcntd 2, 3                    # encoding: [0x7c,0x62,0x03,0xf4]
460         popcntd 2, 3
461# FIXME: bpermd 2, 3, 4
462
463# Fixed-point rotate and shift instructions
464
465# CHECK: rlwinm 2, 3, 4, 5, 6            # encoding: [0x54,0x62,0x21,0x4c]
466         rlwinm 2, 3, 4, 5, 6
467# CHECK: rlwinm. 2, 3, 4, 5, 6           # encoding: [0x54,0x62,0x21,0x4d]
468         rlwinm. 2, 3, 4, 5, 6
469# CHECK: rlwnm 2, 3, 4, 5, 6             # encoding: [0x5c,0x62,0x21,0x4c]
470         rlwnm 2, 3, 4, 5, 6
471# CHECK: rlwnm. 2, 3, 4, 5, 6            # encoding: [0x5c,0x62,0x21,0x4d]
472         rlwnm. 2, 3, 4, 5, 6
473# CHECK: rlwimi 2, 3, 4, 5, 6            # encoding: [0x50,0x62,0x21,0x4c]
474         rlwimi 2, 3, 4, 5, 6
475# CHECK: rlwimi. 2, 3, 4, 5, 6           # encoding: [0x50,0x62,0x21,0x4d]
476         rlwimi. 2, 3, 4, 5, 6
477# CHECK: rldicl 2, 3, 4, 5               # encoding: [0x78,0x62,0x21,0x40]
478         rldicl 2, 3, 4, 5
479# CHECK: rldicl. 2, 3, 4, 5              # encoding: [0x78,0x62,0x21,0x41]
480         rldicl. 2, 3, 4, 5
481# CHECK: rldicr 2, 3, 4, 5               # encoding: [0x78,0x62,0x21,0x44]
482         rldicr 2, 3, 4, 5
483# CHECK: rldicr. 2, 3, 4, 5              # encoding: [0x78,0x62,0x21,0x45]
484         rldicr. 2, 3, 4, 5
485# CHECK: rldic 2, 3, 4, 5                # encoding: [0x78,0x62,0x21,0x48]
486         rldic 2, 3, 4, 5
487# CHECK: rldic. 2, 3, 4, 5               # encoding: [0x78,0x62,0x21,0x49]
488         rldic. 2, 3, 4, 5
489# CHECK: rldcl 2, 3, 4, 5                # encoding: [0x78,0x62,0x21,0x50]
490         rldcl 2, 3, 4, 5
491# CHECK: rldcl. 2, 3, 4, 5               # encoding: [0x78,0x62,0x21,0x51]
492         rldcl. 2, 3, 4, 5
493# CHECK: rldcr 2, 3, 4, 5                # encoding: [0x78,0x62,0x21,0x52]
494         rldcr 2, 3, 4, 5
495# CHECK: rldcr. 2, 3, 4, 5               # encoding: [0x78,0x62,0x21,0x53]
496         rldcr. 2, 3, 4, 5
497# CHECK: rldimi 2, 3, 4, 5               # encoding: [0x78,0x62,0x21,0x4c]
498         rldimi 2, 3, 4, 5
499# CHECK: rldimi. 2, 3, 4, 5              # encoding: [0x78,0x62,0x21,0x4d]
500         rldimi. 2, 3, 4, 5
501
502# CHECK: slw 2, 3, 4                     # encoding: [0x7c,0x62,0x20,0x30]
503         slw 2, 3, 4
504# CHECK: slw. 2, 3, 4                    # encoding: [0x7c,0x62,0x20,0x31]
505         slw. 2, 3, 4
506# CHECK: srw 2, 3, 4                     # encoding: [0x7c,0x62,0x24,0x30]
507         srw 2, 3, 4
508# CHECK: srw. 2, 3, 4                    # encoding: [0x7c,0x62,0x24,0x31]
509         srw. 2, 3, 4
510# CHECK: srawi 2, 3, 4                   # encoding: [0x7c,0x62,0x26,0x70]
511         srawi 2, 3, 4
512# CHECK: srawi. 2, 3, 4                  # encoding: [0x7c,0x62,0x26,0x71]
513         srawi. 2, 3, 4
514# CHECK: sraw 2, 3, 4                    # encoding: [0x7c,0x62,0x26,0x30]
515         sraw 2, 3, 4
516# CHECK: sraw. 2, 3, 4                   # encoding: [0x7c,0x62,0x26,0x31]
517         sraw. 2, 3, 4
518# CHECK: sld 2, 3, 4                     # encoding: [0x7c,0x62,0x20,0x36]
519         sld 2, 3, 4
520# CHECK: sld. 2, 3, 4                    # encoding: [0x7c,0x62,0x20,0x37]
521         sld. 2, 3, 4
522# CHECK: srd 2, 3, 4                     # encoding: [0x7c,0x62,0x24,0x36]
523         srd 2, 3, 4
524# CHECK: srd. 2, 3, 4                    # encoding: [0x7c,0x62,0x24,0x37]
525         srd. 2, 3, 4
526# CHECK: sradi 2, 3, 4                   # encoding: [0x7c,0x62,0x26,0x74]
527         sradi 2, 3, 4
528# CHECK: sradi. 2, 3, 4                  # encoding: [0x7c,0x62,0x26,0x75]
529         sradi. 2, 3, 4
530# CHECK: srad 2, 3, 4                    # encoding: [0x7c,0x62,0x26,0x34]
531         srad 2, 3, 4
532# CHECK: srad. 2, 3, 4                   # encoding: [0x7c,0x62,0x26,0x35]
533         srad. 2, 3, 4
534
535# FIXME: BCD assist instructions
536
537# Move to/from system register instructions
538
539# CHECK: mtspr 600, 2                    # encoding: [0x7c,0x58,0x93,0xa6]
540         mtspr 600, 2
541# CHECK: mfspr 2, 600                    # encoding: [0x7c,0x58,0x92,0xa6]
542         mfspr 2, 600
543# CHECK: mtcrf 123, 2                    # encoding: [0x7c,0x47,0xb1,0x20]
544         mtcrf 123, 2
545# CHECK: mfcr 2                          # encoding: [0x7c,0x40,0x00,0x26]
546         mfcr 2
547# CHECK: mtocrf 16, 2                    # encoding: [0x7c,0x51,0x01,0x20]
548         mtocrf 16, 2
549# CHECK: mfocrf 16, 8                    # encoding: [0x7e,0x10,0x80,0x26]
550         mfocrf 16, 8
551
552