1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef V8_CODEGEN_PPC_CONSTANTS_PPC_H_
6 #define V8_CODEGEN_PPC_CONSTANTS_PPC_H_
7
8 #include <stdint.h>
9
10 #include "src/base/logging.h"
11 #include "src/base/macros.h"
12 #include "src/common/globals.h"
13
14 // UNIMPLEMENTED_ macro for PPC.
15 #ifdef DEBUG
16 #define UNIMPLEMENTED_PPC() \
17 v8::internal::PrintF("%s, \tline %d: \tfunction %s not implemented. \n", \
18 __FILE__, __LINE__, __func__)
19 #else
20 #define UNIMPLEMENTED_PPC()
21 #endif
22
23 #if (V8_HOST_ARCH_PPC || V8_HOST_ARCH_PPC64) && \
24 (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && V8_TARGET_BIG_ENDIAN && \
25 (!defined(_CALL_ELF) || _CALL_ELF == 1)))
26 #define ABI_USES_FUNCTION_DESCRIPTORS 1
27 #else
28 #define ABI_USES_FUNCTION_DESCRIPTORS 0
29 #endif
30
31 #if !(V8_HOST_ARCH_PPC || V8_HOST_ARCH_PPC64) || V8_OS_AIX || \
32 V8_TARGET_ARCH_PPC64
33 #define ABI_PASSES_HANDLES_IN_REGS 1
34 #else
35 #define ABI_PASSES_HANDLES_IN_REGS 0
36 #endif
37
38 #if !(V8_HOST_ARCH_PPC || V8_HOST_ARCH_PPC64) || !V8_TARGET_ARCH_PPC64 || \
39 V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2)
40 #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 1
41 #else
42 #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 0
43 #endif
44
45 #if !(V8_HOST_ARCH_PPC || V8_HOST_ARCH_PPC64) || \
46 (V8_TARGET_ARCH_PPC64 && \
47 (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2)))
48 #define ABI_CALL_VIA_IP 1
49 #else
50 #define ABI_CALL_VIA_IP 0
51 #endif
52
53 #if !(V8_HOST_ARCH_PPC || V8_HOST_ARCH_PPC64) || V8_OS_AIX || \
54 V8_TARGET_ARCH_PPC64
55 #define ABI_TOC_REGISTER 2
56 #else
57 #define ABI_TOC_REGISTER 13
58 #endif
59 namespace v8 {
60 namespace internal {
61
62 // TODO(sigurds): Change this value once we use relative jumps.
63 constexpr size_t kMaxPCRelativeCodeRangeInMB = 0;
64
65 // Used to encode a boolean value when emitting 32 bit
66 // opcodes which will indicate the presence of function descriptors
67 constexpr int kHasFunctionDescriptorBitShift = 9;
68 constexpr int kHasFunctionDescriptorBitMask = 1
69 << kHasFunctionDescriptorBitShift;
70
71 // Number of registers
72 const int kNumRegisters = 32;
73
74 // FP support.
75 const int kNumDoubleRegisters = 32;
76
77 const int kNoRegister = -1;
78
79 // Used in embedded constant pool builder - max reach in bits for
80 // various load instructions (one less due to unsigned)
81 const int kLoadPtrMaxReachBits = 15;
82 const int kLoadDoubleMaxReachBits = 15;
83
84 // Actual value of root register is offset from the root array's start
85 // to take advantage of negative displacement values.
86 // TODO(sigurds): Choose best value.
87 constexpr int kRootRegisterBias = 128;
88
89 // sign-extend the least significant 16-bits of value <imm>
90 #define SIGN_EXT_IMM16(imm) ((static_cast<int>(imm) << 16) >> 16)
91
92 // sign-extend the least significant 22-bits of value <imm>
93 #define SIGN_EXT_IMM22(imm) ((static_cast<int>(imm) << 10) >> 10)
94
95 // sign-extend the least significant 26-bits of value <imm>
96 #define SIGN_EXT_IMM26(imm) ((static_cast<int>(imm) << 6) >> 6)
97
98 // -----------------------------------------------------------------------------
99 // Conditions.
100
101 // Defines constants and accessor classes to assemble, disassemble and
102 // simulate PPC instructions.
103 //
104 // Section references in the code refer to the "PowerPC Microprocessor
105 // Family: The Programmer.s Reference Guide" from 10/95
106 // https://www-01.ibm.com/chips/techlib/techlib.nsf/techdocs/852569B20050FF778525699600741775/$file/prg.pdf
107 //
108
109 // Constants for specific fields are defined in their respective named enums.
110 // General constants are in an anonymous enum in class Instr.
111 enum Condition {
112 kNoCondition = -1,
113 eq = 0, // Equal.
114 ne = 1, // Not equal.
115 ge = 2, // Greater or equal.
116 lt = 3, // Less than.
117 gt = 4, // Greater than.
118 le = 5, // Less then or equal
119 unordered = 6, // Floating-point unordered
120 ordered = 7,
121 overflow = 8, // Summary overflow
122 nooverflow = 9,
123 al = 10 // Always.
124 };
125
NegateCondition(Condition cond)126 inline Condition NegateCondition(Condition cond) {
127 DCHECK(cond != al);
128 return static_cast<Condition>(cond ^ ne);
129 }
130
131 // -----------------------------------------------------------------------------
132 // Instructions encoding.
133
134 // Instr is merely used by the Assembler to distinguish 32bit integers
135 // representing instructions from usual 32 bit values.
136 // Instruction objects are pointers to 32bit values, and provide methods to
137 // access the various ISA fields.
138 using Instr = uint32_t;
139
140 #define PPC_XX3_OPCODE_LIST(V) \
141 /* VSX Scalar Add Double-Precision */ \
142 V(xsadddp, XSADDDP, 0xF0000100) \
143 /* VSX Scalar Add Single-Precision */ \
144 V(xsaddsp, XSADDSP, 0xF0000000) \
145 /* VSX Scalar Compare Ordered Double-Precision */ \
146 V(xscmpodp, XSCMPODP, 0xF0000158) \
147 /* VSX Scalar Compare Unordered Double-Precision */ \
148 V(xscmpudp, XSCMPUDP, 0xF0000118) \
149 /* VSX Scalar Copy Sign Double-Precision */ \
150 V(xscpsgndp, XSCPSGNDP, 0xF0000580) \
151 /* VSX Scalar Divide Double-Precision */ \
152 V(xsdivdp, XSDIVDP, 0xF00001C0) \
153 /* VSX Scalar Divide Single-Precision */ \
154 V(xsdivsp, XSDIVSP, 0xF00000C0) \
155 /* VSX Scalar Multiply-Add Type-A Double-Precision */ \
156 V(xsmaddadp, XSMADDADP, 0xF0000108) \
157 /* VSX Scalar Multiply-Add Type-A Single-Precision */ \
158 V(xsmaddasp, XSMADDASP, 0xF0000008) \
159 /* VSX Scalar Multiply-Add Type-M Double-Precision */ \
160 V(xsmaddmdp, XSMADDMDP, 0xF0000148) \
161 /* VSX Scalar Multiply-Add Type-M Single-Precision */ \
162 V(xsmaddmsp, XSMADDMSP, 0xF0000048) \
163 /* VSX Scalar Maximum Double-Precision */ \
164 V(xsmaxdp, XSMAXDP, 0xF0000500) \
165 /* VSX Scalar Minimum Double-Precision */ \
166 V(xsmindp, XSMINDP, 0xF0000540) \
167 /* VSX Scalar Multiply-Subtract Type-A Double-Precision */ \
168 V(xsmsubadp, XSMSUBADP, 0xF0000188) \
169 /* VSX Scalar Multiply-Subtract Type-A Single-Precision */ \
170 V(xsmsubasp, XSMSUBASP, 0xF0000088) \
171 /* VSX Scalar Multiply-Subtract Type-M Double-Precision */ \
172 V(xsmsubmdp, XSMSUBMDP, 0xF00001C8) \
173 /* VSX Scalar Multiply-Subtract Type-M Single-Precision */ \
174 V(xsmsubmsp, XSMSUBMSP, 0xF00000C8) \
175 /* VSX Scalar Multiply Double-Precision */ \
176 V(xsmuldp, XSMULDP, 0xF0000180) \
177 /* VSX Scalar Multiply Single-Precision */ \
178 V(xsmulsp, XSMULSP, 0xF0000080) \
179 /* VSX Scalar Negative Multiply-Add Type-A Double-Precision */ \
180 V(xsnmaddadp, XSNMADDADP, 0xF0000508) \
181 /* VSX Scalar Negative Multiply-Add Type-A Single-Precision */ \
182 V(xsnmaddasp, XSNMADDASP, 0xF0000408) \
183 /* VSX Scalar Negative Multiply-Add Type-M Double-Precision */ \
184 V(xsnmaddmdp, XSNMADDMDP, 0xF0000548) \
185 /* VSX Scalar Negative Multiply-Add Type-M Single-Precision */ \
186 V(xsnmaddmsp, XSNMADDMSP, 0xF0000448) \
187 /* VSX Scalar Negative Multiply-Subtract Type-A Double-Precision */ \
188 V(xsnmsubadp, XSNMSUBADP, 0xF0000588) \
189 /* VSX Scalar Negative Multiply-Subtract Type-A Single-Precision */ \
190 V(xsnmsubasp, XSNMSUBASP, 0xF0000488) \
191 /* VSX Scalar Negative Multiply-Subtract Type-M Double-Precision */ \
192 V(xsnmsubmdp, XSNMSUBMDP, 0xF00005C8) \
193 /* VSX Scalar Negative Multiply-Subtract Type-M Single-Precision */ \
194 V(xsnmsubmsp, XSNMSUBMSP, 0xF00004C8) \
195 /* VSX Scalar Reciprocal Estimate Double-Precision */ \
196 V(xsredp, XSREDP, 0xF0000168) \
197 /* VSX Scalar Subtract Double-Precision */ \
198 V(xssubdp, XSSUBDP, 0xF0000140) \
199 /* VSX Scalar Subtract Single-Precision */ \
200 V(xssubsp, XSSUBSP, 0xF0000040) \
201 /* VSX Scalar Test for software Divide Double-Precision */ \
202 V(xstdivdp, XSTDIVDP, 0xF00001E8) \
203 /* VSX Vector Add Double-Precision */ \
204 V(xvadddp, XVADDDP, 0xF0000300) \
205 /* VSX Vector Add Single-Precision */ \
206 V(xvaddsp, XVADDSP, 0xF0000200) \
207 /* VSX Vector Compare Equal To Double-Precision */ \
208 V(xvcmpeqdp, XVCMPEQDP, 0xF0000318) \
209 /* VSX Vector Compare Equal To Double-Precision & record CR6 */ \
210 V(xvcmpeqdpx, XVCMPEQDPx, 0xF0000718) \
211 /* VSX Vector Compare Equal To Single-Precision */ \
212 V(xvcmpeqsp, XVCMPEQSP, 0xF0000218) \
213 /* VSX Vector Compare Equal To Single-Precision & record CR6 */ \
214 V(xvcmpeqspx, XVCMPEQSPx, 0xF0000618) \
215 /* VSX Vector Compare Greater Than or Equal To Double-Precision */ \
216 V(xvcmpgedp, XVCMPGEDP, 0xF0000398) \
217 /* VSX Vector Compare Greater Than or Equal To Double-Precision & record */ \
218 /* CR6 */ \
219 V(xvcmpgedpx, XVCMPGEDPx, 0xF0000798) \
220 /* VSX Vector Compare Greater Than or Equal To Single-Precision */ \
221 V(xvcmpgesp, XVCMPGESP, 0xF0000298) \
222 /* VSX Vector Compare Greater Than or Equal To Single-Precision & record */ \
223 /* CR6 */ \
224 V(xvcmpgespx, XVCMPGESPx, 0xF0000698) \
225 /* VSX Vector Compare Greater Than Double-Precision */ \
226 V(xvcmpgtdp, XVCMPGTDP, 0xF0000358) \
227 /* VSX Vector Compare Greater Than Double-Precision & record CR6 */ \
228 V(xvcmpgtdpx, XVCMPGTDPx, 0xF0000758) \
229 /* VSX Vector Compare Greater Than Single-Precision */ \
230 V(xvcmpgtsp, XVCMPGTSP, 0xF0000258) \
231 /* VSX Vector Compare Greater Than Single-Precision & record CR6 */ \
232 V(xvcmpgtspx, XVCMPGTSPx, 0xF0000658) \
233 /* VSX Vector Copy Sign Double-Precision */ \
234 V(xvcpsgndp, XVCPSGNDP, 0xF0000780) \
235 /* VSX Vector Copy Sign Single-Precision */ \
236 V(xvcpsgnsp, XVCPSGNSP, 0xF0000680) \
237 /* VSX Vector Divide Double-Precision */ \
238 V(xvdivdp, XVDIVDP, 0xF00003C0) \
239 /* VSX Vector Divide Single-Precision */ \
240 V(xvdivsp, XVDIVSP, 0xF00002C0) \
241 /* VSX Vector Multiply-Add Type-A Double-Precision */ \
242 V(xvmaddadp, XVMADDADP, 0xF0000308) \
243 /* VSX Vector Multiply-Add Type-A Single-Precision */ \
244 V(xvmaddasp, XVMADDASP, 0xF0000208) \
245 /* VSX Vector Multiply-Add Type-M Double-Precision */ \
246 V(xvmaddmdp, XVMADDMDP, 0xF0000348) \
247 /* VSX Vector Multiply-Add Type-M Single-Precision */ \
248 V(xvmaddmsp, XVMADDMSP, 0xF0000248) \
249 /* VSX Vector Maximum Double-Precision */ \
250 V(xvmaxdp, XVMAXDP, 0xF0000700) \
251 /* VSX Vector Maximum Single-Precision */ \
252 V(xvmaxsp, XVMAXSP, 0xF0000600) \
253 /* VSX Vector Minimum Double-Precision */ \
254 V(xvmindp, XVMINDP, 0xF0000740) \
255 /* VSX Vector Minimum Single-Precision */ \
256 V(xvminsp, XVMINSP, 0xF0000640) \
257 /* VSX Vector Multiply-Subtract Type-A Double-Precision */ \
258 V(xvmsubadp, XVMSUBADP, 0xF0000388) \
259 /* VSX Vector Multiply-Subtract Type-A Single-Precision */ \
260 V(xvmsubasp, XVMSUBASP, 0xF0000288) \
261 /* VSX Vector Multiply-Subtract Type-M Double-Precision */ \
262 V(xvmsubmdp, XVMSUBMDP, 0xF00003C8) \
263 /* VSX Vector Multiply-Subtract Type-M Single-Precision */ \
264 V(xvmsubmsp, XVMSUBMSP, 0xF00002C8) \
265 /* VSX Vector Multiply Double-Precision */ \
266 V(xvmuldp, XVMULDP, 0xF0000380) \
267 /* VSX Vector Multiply Single-Precision */ \
268 V(xvmulsp, XVMULSP, 0xF0000280) \
269 /* VSX Vector Negative Multiply-Add Type-A Double-Precision */ \
270 V(xvnmaddadp, XVNMADDADP, 0xF0000708) \
271 /* VSX Vector Negative Multiply-Add Type-A Single-Precision */ \
272 V(xvnmaddasp, XVNMADDASP, 0xF0000608) \
273 /* VSX Vector Negative Multiply-Add Type-M Double-Precision */ \
274 V(xvnmaddmdp, XVNMADDMDP, 0xF0000748) \
275 /* VSX Vector Negative Multiply-Add Type-M Single-Precision */ \
276 V(xvnmaddmsp, XVNMADDMSP, 0xF0000648) \
277 /* VSX Vector Negative Multiply-Subtract Type-A Double-Precision */ \
278 V(xvnmsubadp, XVNMSUBADP, 0xF0000788) \
279 /* VSX Vector Negative Multiply-Subtract Type-A Single-Precision */ \
280 V(xvnmsubasp, XVNMSUBASP, 0xF0000688) \
281 /* VSX Vector Negative Multiply-Subtract Type-M Double-Precision */ \
282 V(xvnmsubmdp, XVNMSUBMDP, 0xF00007C8) \
283 /* VSX Vector Negative Multiply-Subtract Type-M Single-Precision */ \
284 V(xvnmsubmsp, XVNMSUBMSP, 0xF00006C8) \
285 /* VSX Vector Reciprocal Estimate Double-Precision */ \
286 V(xvredp, XVREDP, 0xF0000368) \
287 /* VSX Vector Subtract Double-Precision */ \
288 V(xvsubdp, XVSUBDP, 0xF0000340) \
289 /* VSX Vector Subtract Single-Precision */ \
290 V(xvsubsp, XVSUBSP, 0xF0000240) \
291 /* VSX Vector Test for software Divide Double-Precision */ \
292 V(xvtdivdp, XVTDIVDP, 0xF00003E8) \
293 /* VSX Vector Test for software Divide Single-Precision */ \
294 V(xvtdivsp, XVTDIVSP, 0xF00002E8) \
295 /* VSX Logical AND */ \
296 V(xxland, XXLAND, 0xF0000410) \
297 /* VSX Logical AND with Complement */ \
298 V(xxlandc, XXLANDC, 0xF0000450) \
299 /* VSX Logical Equivalence */ \
300 V(xxleqv, XXLEQV, 0xF00005D0) \
301 /* VSX Logical NAND */ \
302 V(xxlnand, XXLNAND, 0xF0000590) \
303 /* VSX Logical NOR */ \
304 V(xxlnor, XXLNOR, 0xF0000510) \
305 /* VSX Logical OR */ \
306 V(xxlor, XXLOR, 0xF0000490) \
307 /* VSX Logical OR with Complement */ \
308 V(xxlorc, XXLORC, 0xF0000550) \
309 /* VSX Logical XOR */ \
310 V(xxlxor, XXLXOR, 0xF00004D0) \
311 /* VSX Merge High Word */ \
312 V(xxmrghw, XXMRGHW, 0xF0000090) \
313 /* VSX Merge Low Word */ \
314 V(xxmrglw, XXMRGLW, 0xF0000190) \
315 /* VSX Permute Doubleword Immediate */ \
316 V(xxpermdi, XXPERMDI, 0xF0000050) \
317 /* VSX Shift Left Double by Word Immediate */ \
318 V(xxsldwi, XXSLDWI, 0xF0000010) \
319 /* VSX Splat Word */ \
320 V(xxspltw, XXSPLTW, 0xF0000290)
321
322 #define PPC_Z23_OPCODE_LIST(V) \
323 /* Decimal Quantize */ \
324 V(dqua, DQUA, 0xEC000006) \
325 /* Decimal Quantize Immediate */ \
326 V(dquai, DQUAI, 0xEC000086) \
327 /* Decimal Quantize Immediate Quad */ \
328 V(dquaiq, DQUAIQ, 0xFC000086) \
329 /* Decimal Quantize Quad */ \
330 V(dquaq, DQUAQ, 0xFC000006) \
331 /* Decimal Floating Round To FP Integer Without Inexact */ \
332 V(drintn, DRINTN, 0xEC0001C6) \
333 /* Decimal Floating Round To FP Integer Without Inexact Quad */ \
334 V(drintnq, DRINTNQ, 0xFC0001C6) \
335 /* Decimal Floating Round To FP Integer With Inexact */ \
336 V(drintx, DRINTX, 0xEC0000C6) \
337 /* Decimal Floating Round To FP Integer With Inexact Quad */ \
338 V(drintxq, DRINTXQ, 0xFC0000C6) \
339 /* Decimal Floating Reround */ \
340 V(drrnd, DRRND, 0xEC000046) \
341 /* Decimal Floating Reround Quad */ \
342 V(drrndq, DRRNDQ, 0xFC000046)
343
344 #define PPC_Z22_OPCODE_LIST(V) \
345 /* Decimal Floating Shift Coefficient Left Immediate */ \
346 V(dscli, DSCLI, 0xEC000084) \
347 /* Decimal Floating Shift Coefficient Left Immediate Quad */ \
348 V(dscliq, DSCLIQ, 0xFC000084) \
349 /* Decimal Floating Shift Coefficient Right Immediate */ \
350 V(dscri, DSCRI, 0xEC0000C4) \
351 /* Decimal Floating Shift Coefficient Right Immediate Quad */ \
352 V(dscriq, DSCRIQ, 0xFC0000C4) \
353 /* Decimal Floating Test Data Class */ \
354 V(dtstdc, DTSTDC, 0xEC000184) \
355 /* Decimal Floating Test Data Class Quad */ \
356 V(dtstdcq, DTSTDCQ, 0xFC000184) \
357 /* Decimal Floating Test Data Group */ \
358 V(dtstdg, DTSTDG, 0xEC0001C4) \
359 /* Decimal Floating Test Data Group Quad */ \
360 V(dtstdgq, DTSTDGQ, 0xFC0001C4)
361
362 #define PPC_XX2_OPCODE_A_FORM_LIST(V) \
363 /* VSX Vector Absolute Value Double-Precision */ \
364 V(xvabsdp, XVABSDP, 0xF0000764) \
365 /* VSX Vector Negate Double-Precision */ \
366 V(xvnegdp, XVNEGDP, 0xF00007E4) \
367 /* VSX Vector Square Root Double-Precision */ \
368 V(xvsqrtdp, XVSQRTDP, 0xF000032C) \
369 /* VSX Vector Absolute Value Single-Precision */ \
370 V(xvabssp, XVABSSP, 0xF0000664) \
371 /* VSX Vector Negate Single-Precision */ \
372 V(xvnegsp, XVNEGSP, 0xF00006E4) \
373 /* VSX Vector Reciprocal Estimate Single-Precision */ \
374 V(xvresp, XVRESP, 0xF0000268) \
375 /* VSX Vector Reciprocal Square Root Estimate Single-Precision */ \
376 V(xvrsqrtesp, XVRSQRTESP, 0xF0000228) \
377 /* VSX Vector Square Root Single-Precision */ \
378 V(xvsqrtsp, XVSQRTSP, 0xF000022C) \
379 /* VSX Vector Convert Single-Precision to Signed Fixed-Point Word */ \
380 /* Saturate */ \
381 V(xvcvspsxws, XVCVSPSXWS, 0xF0000260) \
382 /* VSX Vector Convert Single-Precision to Unsigned Fixed-Point Word */ \
383 /* Saturate */ \
384 V(xvcvspuxws, XVCVSPUXWS, 0xF0000220) \
385 /* VSX Vector Convert Signed Fixed-Point Word to Single-Precision */ \
386 V(xvcvsxwsp, XVCVSXWSP, 0xF00002E0) \
387 /* VSX Vector Convert Unsigned Fixed-Point Word to Single-Precision */ \
388 V(xvcvuxwsp, XVCVUXWSP, 0xF00002A0) \
389 /* VSX Vector Round to Double-Precision Integer toward +Infinity */ \
390 V(xvrdpip, XVRDPIP, 0xF00003A4) \
391 /* VSX Vector Round to Double-Precision Integer toward -Infinity */ \
392 V(xvrdpim, XVRDPIM, 0xF00003E4) \
393 /* VSX Vector Round to Double-Precision Integer toward Zero */ \
394 V(xvrdpiz, XVRDPIZ, 0xF0000364) \
395 /* VSX Vector Round to Double-Precision Integer */ \
396 V(xvrdpi, XVRDPI, 0xF0000324) \
397 /* VSX Vector Round to Single-Precision Integer toward +Infinity */ \
398 V(xvrspip, XVRSPIP, 0xF00002A4) \
399 /* VSX Vector Round to Single-Precision Integer toward -Infinity */ \
400 V(xvrspim, XVRSPIM, 0xF00002E4) \
401 /* VSX Vector Round to Single-Precision Integer toward Zero */ \
402 V(xvrspiz, XVRSPIZ, 0xF0000264) \
403 /* VSX Vector Round to Single-Precision Integer */ \
404 V(xvrspi, XVRSPI, 0xF0000224)
405
406 #define PPC_XX2_OPCODE_UNUSED_LIST(V) \
407 /* VSX Scalar Square Root Double-Precision */ \
408 V(xssqrtdp, XSSQRTDP, 0xF000012C) \
409 /* VSX Scalar Reciprocal Estimate Single-Precision */ \
410 V(xsresp, XSRESP, 0xF0000068) \
411 /* VSX Scalar Reciprocal Square Root Estimate Single-Precision */ \
412 V(xsrsqrtesp, XSRSQRTESP, 0xF0000028) \
413 /* VSX Scalar Square Root Single-Precision */ \
414 V(xssqrtsp, XSSQRTSP, 0xF000002C) \
415 /* Move To VSR Doubleword */ \
416 V(mtvsrd, MTVSRD, 0x7C000166) \
417 /* Move To VSR Double Doubleword */ \
418 V(mtvsrdd, MTVSRDD, 0x7C000366) \
419 /* Move To VSR Word Algebraic */ \
420 V(mtvsrwa, MTVSRWA, 0x7C0001A6) \
421 /* Move To VSR Word and Zero */ \
422 V(mtvsrwz, MTVSRWZ, 0x7C0001E6) \
423 /* VSX Scalar Absolute Value Double-Precision */ \
424 V(xsabsdp, XSABSDP, 0xF0000564) \
425 /* VSX Scalar Convert Double-Precision to Single-Precision */ \
426 V(xscvdpsp, XSCVDPSP, 0xF0000424) \
427 /* VSX Scalar Convert Double-Precision to Single-Precision format Non- */ \
428 /* signalling */ \
429 V(xscvdpspn, XSCVDPSPN, 0xF000042C) \
430 /* VSX Scalar Convert Double-Precision to Signed Fixed-Point Doubleword */ \
431 /* Saturate */ \
432 V(xscvdpsxds, XSCVDPSXDS, 0xF0000560) \
433 /* VSX Scalar Convert Double-Precision to Signed Fixed-Point Word */ \
434 /* Saturate */ \
435 V(xscvdpsxws, XSCVDPSXWS, 0xF0000160) \
436 /* VSX Scalar Convert Double-Precision to Unsigned Fixed-Point */ \
437 /* Doubleword Saturate */ \
438 V(xscvdpuxds, XSCVDPUXDS, 0xF0000520) \
439 /* VSX Scalar Convert Double-Precision to Unsigned Fixed-Point Word */ \
440 /* Saturate */ \
441 V(xscvdpuxws, XSCVDPUXWS, 0xF0000120) \
442 /* VSX Scalar Convert Single-Precision to Double-Precision (p=1) */ \
443 V(xscvspdp, XSCVSPDP, 0xF0000524) \
444 /* Scalar Convert Single-Precision to Double-Precision format Non- */ \
445 /* signalling */ \
446 V(xscvspdpn, XSCVSPDPN, 0xF000052C) \
447 /* VSX Scalar Convert Signed Fixed-Point Doubleword to Double-Precision */ \
448 V(xscvsxddp, XSCVSXDDP, 0xF00005E0) \
449 /* VSX Scalar Convert Signed Fixed-Point Doubleword to Single-Precision */ \
450 V(xscvsxdsp, XSCVSXDSP, 0xF00004E0) \
451 /* VSX Scalar Convert Unsigned Fixed-Point Doubleword to Double- */ \
452 /* Precision */ \
453 V(xscvuxddp, XSCVUXDDP, 0xF00005A0) \
454 /* VSX Scalar Convert Unsigned Fixed-Point Doubleword to Single- */ \
455 /* Precision */ \
456 V(xscvuxdsp, XSCVUXDSP, 0xF00004A0) \
457 /* VSX Scalar Negative Absolute Value Double-Precision */ \
458 V(xsnabsdp, XSNABSDP, 0xF00005A4) \
459 /* VSX Scalar Negate Double-Precision */ \
460 V(xsnegdp, XSNEGDP, 0xF00005E4) \
461 /* VSX Scalar Round to Double-Precision Integer */ \
462 V(xsrdpi, XSRDPI, 0xF0000124) \
463 /* VSX Scalar Round to Double-Precision Integer using Current rounding */ \
464 /* mode */ \
465 V(xsrdpic, XSRDPIC, 0xF00001AC) \
466 /* VSX Scalar Round to Double-Precision Integer toward -Infinity */ \
467 V(xsrdpim, XSRDPIM, 0xF00001E4) \
468 /* VSX Scalar Round to Double-Precision Integer toward +Infinity */ \
469 V(xsrdpip, XSRDPIP, 0xF00001A4) \
470 /* VSX Scalar Round to Double-Precision Integer toward Zero */ \
471 V(xsrdpiz, XSRDPIZ, 0xF0000164) \
472 /* VSX Scalar Round to Single-Precision */ \
473 V(xsrsp, XSRSP, 0xF0000464) \
474 /* VSX Scalar Reciprocal Square Root Estimate Double-Precision */ \
475 V(xsrsqrtedp, XSRSQRTEDP, 0xF0000128) \
476 /* VSX Scalar Test for software Square Root Double-Precision */ \
477 V(xstsqrtdp, XSTSQRTDP, 0xF00001A8) \
478 /* VSX Vector Convert Double-Precision to Single-Precision */ \
479 V(xvcvdpsp, XVCVDPSP, 0xF0000624) \
480 /* VSX Vector Convert Double-Precision to Signed Fixed-Point Doubleword */ \
481 /* Saturate */ \
482 V(xvcvdpsxds, XVCVDPSXDS, 0xF0000760) \
483 /* VSX Vector Convert Double-Precision to Signed Fixed-Point Word */ \
484 /* Saturate */ \
485 V(xvcvdpsxws, XVCVDPSXWS, 0xF0000360) \
486 /* VSX Vector Convert Double-Precision to Unsigned Fixed-Point */ \
487 /* Doubleword Saturate */ \
488 V(xvcvdpuxds, XVCVDPUXDS, 0xF0000720) \
489 /* VSX Vector Convert Double-Precision to Unsigned Fixed-Point Word */ \
490 /* Saturate */ \
491 V(xvcvdpuxws, XVCVDPUXWS, 0xF0000320) \
492 /* VSX Vector Convert Single-Precision to Double-Precision */ \
493 V(xvcvspdp, XVCVSPDP, 0xF0000724) \
494 /* VSX Vector Convert Single-Precision to Signed Fixed-Point Doubleword */ \
495 /* Saturate */ \
496 V(xvcvspsxds, XVCVSPSXDS, 0xF0000660) \
497 /* VSX Vector Convert Single-Precision to Unsigned Fixed-Point */ \
498 /* Doubleword Saturate */ \
499 V(xvcvspuxds, XVCVSPUXDS, 0xF0000620) \
500 /* VSX Vector Convert Signed Fixed-Point Doubleword to Double-Precision */ \
501 V(xvcvsxddp, XVCVSXDDP, 0xF00007E0) \
502 /* VSX Vector Convert Signed Fixed-Point Doubleword to Single-Precision */ \
503 V(xvcvsxdsp, XVCVSXDSP, 0xF00006E0) \
504 /* VSX Vector Convert Signed Fixed-Point Word to Double-Precision */ \
505 V(xvcvsxwdp, XVCVSXWDP, 0xF00003E0) \
506 /* VSX Vector Convert Unsigned Fixed-Point Doubleword to Double- */ \
507 /* Precision */ \
508 V(xvcvuxddp, XVCVUXDDP, 0xF00007A0) \
509 /* VSX Vector Convert Unsigned Fixed-Point Doubleword to Single- */ \
510 /* Precision */ \
511 V(xvcvuxdsp, XVCVUXDSP, 0xF00006A0) \
512 /* VSX Vector Convert Unsigned Fixed-Point Word to Double-Precision */ \
513 V(xvcvuxwdp, XVCVUXWDP, 0xF00003A0) \
514 /* VSX Vector Negative Absolute Value Double-Precision */ \
515 V(xvnabsdp, XVNABSDP, 0xF00007A4) \
516 /* VSX Vector Negative Absolute Value Single-Precision */ \
517 V(xvnabssp, XVNABSSP, 0xF00006A4) \
518 /* VSX Vector Round to Double-Precision Integer using Current rounding */ \
519 /* mode */ \
520 V(xvrdpic, XVRDPIC, 0xF00003AC) \
521 /* VSX Vector Round to Single-Precision Integer using Current rounding */ \
522 /* mode */ \
523 V(xvrspic, XVRSPIC, 0xF00002AC) \
524 /* VSX Vector Reciprocal Square Root Estimate Double-Precision */ \
525 V(xvrsqrtedp, XVRSQRTEDP, 0xF0000328) \
526 /* VSX Vector Test for software Square Root Double-Precision */ \
527 V(xvtsqrtdp, XVTSQRTDP, 0xF00003A8) \
528 /* VSX Vector Test for software Square Root Single-Precision */ \
529 V(xvtsqrtsp, XVTSQRTSP, 0xF00002A8)
530
531 #define PPC_XX2_OPCODE_LIST(V) \
532 PPC_XX2_OPCODE_A_FORM_LIST(V) \
533 PPC_XX2_OPCODE_UNUSED_LIST(V)
534
535 #define PPC_EVX_OPCODE_LIST(V) \
536 /* Vector Load Double Word into Double Word by External PID Indexed */ \
537 V(evlddepx, EVLDDEPX, 0x7C00063E) \
538 /* Vector Store Double of Double by External PID Indexed */ \
539 V(evstddepx, EVSTDDEPX, 0x7C00073E) \
540 /* Bit Reversed Increment */ \
541 V(brinc, BRINC, 0x1000020F) \
542 /* Vector Absolute Value */ \
543 V(evabs, EVABS, 0x10000208) \
544 /* Vector Add Immediate Word */ \
545 V(evaddiw, EVADDIW, 0x10000202) \
546 /* Vector Add Signed, Modulo, Integer to Accumulator Word */ \
547 V(evaddsmiaaw, EVADDSMIAAW, 0x100004C9) \
548 /* Vector Add Signed, Saturate, Integer to Accumulator Word */ \
549 V(evaddssiaaw, EVADDSSIAAW, 0x100004C1) \
550 /* Vector Add Unsigned, Modulo, Integer to Accumulator Word */ \
551 V(evaddumiaaw, EVADDUMIAAW, 0x100004C8) \
552 /* Vector Add Unsigned, Saturate, Integer to Accumulator Word */ \
553 V(evaddusiaaw, EVADDUSIAAW, 0x100004C0) \
554 /* Vector Add Word */ \
555 V(evaddw, EVADDW, 0x10000200) \
556 /* Vector AND */ \
557 V(evand, EVAND, 0x10000211) \
558 /* Vector AND with Complement */ \
559 V(evandc, EVANDC, 0x10000212) \
560 /* Vector Compare Equal */ \
561 V(evcmpeq, EVCMPEQ, 0x10000234) \
562 /* Vector Compare Greater Than Signed */ \
563 V(evcmpgts, EVCMPGTS, 0x10000231) \
564 /* Vector Compare Greater Than Unsigned */ \
565 V(evcmpgtu, EVCMPGTU, 0x10000230) \
566 /* Vector Compare Less Than Signed */ \
567 V(evcmplts, EVCMPLTS, 0x10000233) \
568 /* Vector Compare Less Than Unsigned */ \
569 V(evcmpltu, EVCMPLTU, 0x10000232) \
570 /* Vector Count Leading Signed Bits Word */ \
571 V(evcntlsw, EVCNTLSW, 0x1000020E) \
572 /* Vector Count Leading Zeros Word */ \
573 V(evcntlzw, EVCNTLZW, 0x1000020D) \
574 /* Vector Divide Word Signed */ \
575 V(evdivws, EVDIVWS, 0x100004C6) \
576 /* Vector Divide Word Unsigned */ \
577 V(evdivwu, EVDIVWU, 0x100004C7) \
578 /* Vector Equivalent */ \
579 V(eveqv, EVEQV, 0x10000219) \
580 /* Vector Extend Sign Byte */ \
581 V(evextsb, EVEXTSB, 0x1000020A) \
582 /* Vector Extend Sign Half Word */ \
583 V(evextsh, EVEXTSH, 0x1000020B) \
584 /* Vector Load Double Word into Double Word */ \
585 V(evldd, EVLDD, 0x10000301) \
586 /* Vector Load Double Word into Double Word Indexed */ \
587 V(evlddx, EVLDDX, 0x10000300) \
588 /* Vector Load Double into Four Half Words */ \
589 V(evldh, EVLDH, 0x10000305) \
590 /* Vector Load Double into Four Half Words Indexed */ \
591 V(evldhx, EVLDHX, 0x10000304) \
592 /* Vector Load Double into Two Words */ \
593 V(evldw, EVLDW, 0x10000303) \
594 /* Vector Load Double into Two Words Indexed */ \
595 V(evldwx, EVLDWX, 0x10000302) \
596 /* Vector Load Half Word into Half Words Even and Splat */ \
597 V(evlhhesplat, EVLHHESPLAT, 0x10000309) \
598 /* Vector Load Half Word into Half Words Even and Splat Indexed */ \
599 V(evlhhesplatx, EVLHHESPLATX, 0x10000308) \
600 /* Vector Load Half Word into Half Word Odd Signed and Splat */ \
601 V(evlhhossplat, EVLHHOSSPLAT, 0x1000030F) \
602 /* Vector Load Half Word into Half Word Odd Signed and Splat Indexed */ \
603 V(evlhhossplatx, EVLHHOSSPLATX, 0x1000030E) \
604 /* Vector Load Half Word into Half Word Odd Unsigned and Splat */ \
605 V(evlhhousplat, EVLHHOUSPLAT, 0x1000030D) \
606 /* Vector Load Half Word into Half Word Odd Unsigned and Splat Indexed */ \
607 V(evlhhousplatx, EVLHHOUSPLATX, 0x1000030C) \
608 /* Vector Load Word into Two Half Words Even */ \
609 V(evlwhe, EVLWHE, 0x10000311) \
610 /* Vector Load Word into Two Half Words Odd Signed (with sign extension) */ \
611 V(evlwhos, EVLWHOS, 0x10000317) \
612 /* Vector Load Word into Two Half Words Odd Signed Indexed (with sign */ \
613 /* extension) */ \
614 V(evlwhosx, EVLWHOSX, 0x10000316) \
615 /* Vector Load Word into Two Half Words Odd Unsigned (zero-extended) */ \
616 V(evlwhou, EVLWHOU, 0x10000315) \
617 /* Vector Load Word into Two Half Words Odd Unsigned Indexed (zero- */ \
618 /* extended) */ \
619 V(evlwhoux, EVLWHOUX, 0x10000314) \
620 /* Vector Load Word into Two Half Words and Splat */ \
621 V(evlwhsplat, EVLWHSPLAT, 0x1000031D) \
622 /* Vector Load Word into Two Half Words and Splat Indexed */ \
623 V(evlwhsplatx, EVLWHSPLATX, 0x1000031C) \
624 /* Vector Load Word into Word and Splat */ \
625 V(evlwwsplat, EVLWWSPLAT, 0x10000319) \
626 /* Vector Load Word into Word and Splat Indexed */ \
627 V(evlwwsplatx, EVLWWSPLATX, 0x10000318) \
628 /* Vector Merge High */ \
629 V(evmergehi, EVMERGEHI, 0x1000022C) \
630 /* Vector Merge High/Low */ \
631 V(evmergehilo, EVMERGEHILO, 0x1000022E) \
632 /* Vector Merge Low */ \
633 V(evmergelo, EVMERGELO, 0x1000022D) \
634 /* Vector Merge Low/High */ \
635 V(evmergelohi, EVMERGELOHI, 0x1000022F) \
636 /* Vector Multiply Half Words, Even, Guarded, Signed, Modulo, Fractional */ \
637 /* and Accumulate */ \
638 V(evmhegsmfaa, EVMHEGSMFAA, 0x1000052B) \
639 /* Vector Multiply Half Words, Even, Guarded, Signed, Modulo, Fractional */ \
640 /* and Accumulate Negative */ \
641 V(evmhegsmfan, EVMHEGSMFAN, 0x100005AB) \
642 /* Vector Multiply Half Words, Even, Guarded, Signed, Modulo, Integer */ \
643 /* and Accumulate */ \
644 V(evmhegsmiaa, EVMHEGSMIAA, 0x10000529) \
645 /* Vector Multiply Half Words, Even, Guarded, Signed, Modulo, Integer */ \
646 /* and Accumulate Negative */ \
647 V(evmhegsmian, EVMHEGSMIAN, 0x100005A9) \
648 /* Vector Multiply Half Words, Even, Guarded, Unsigned, Modulo, Integer */ \
649 /* and Accumulate */ \
650 V(evmhegumiaa, EVMHEGUMIAA, 0x10000528) \
651 /* Vector Multiply Half Words, Even, Guarded, Unsigned, Modulo, Integer */ \
652 /* and Accumulate Negative */ \
653 V(evmhegumian, EVMHEGUMIAN, 0x100005A8) \
654 /* Vector Multiply Half Words, Even, Signed, Modulo, Fractional */ \
655 V(evmhesmf, EVMHESMF, 0x1000040B) \
656 /* Vector Multiply Half Words, Even, Signed, Modulo, Fractional to */ \
657 /* Accumulator */ \
658 V(evmhesmfa, EVMHESMFA, 0x1000042B) \
659 /* Vector Multiply Half Words, Even, Signed, Modulo, Fractional and */ \
660 /* Accumulate into Words */ \
661 V(evmhesmfaaw, EVMHESMFAAW, 0x1000050B) \
662 /* Vector Multiply Half Words, Even, Signed, Modulo, Fractional and */ \
663 /* Accumulate Negative into Words */ \
664 V(evmhesmfanw, EVMHESMFANW, 0x1000058B) \
665 /* Vector Multiply Half Words, Even, Signed, Modulo, Integer */ \
666 V(evmhesmi, EVMHESMI, 0x10000409) \
667 /* Vector Multiply Half Words, Even, Signed, Modulo, Integer to */ \
668 /* Accumulator */ \
669 V(evmhesmia, EVMHESMIA, 0x10000429) \
670 /* Vector Multiply Half Words, Even, Signed, Modulo, Integer and */ \
671 /* Accumulate into Words */ \
672 V(evmhesmiaaw, EVMHESMIAAW, 0x10000509) \
673 /* Vector Multiply Half Words, Even, Signed, Modulo, Integer and */ \
674 /* Accumulate Negative into Words */ \
675 V(evmhesmianw, EVMHESMIANW, 0x10000589) \
676 /* Vector Multiply Half Words, Even, Signed, Saturate, Fractional */ \
677 V(evmhessf, EVMHESSF, 0x10000403) \
678 /* Vector Multiply Half Words, Even, Signed, Saturate, Fractional to */ \
679 /* Accumulator */ \
680 V(evmhessfa, EVMHESSFA, 0x10000423) \
681 /* Vector Multiply Half Words, Even, Signed, Saturate, Fractional and */ \
682 /* Accumulate into Words */ \
683 V(evmhessfaaw, EVMHESSFAAW, 0x10000503) \
684 /* Vector Multiply Half Words, Even, Signed, Saturate, Fractional and */ \
685 /* Accumulate Negative into Words */ \
686 V(evmhessfanw, EVMHESSFANW, 0x10000583) \
687 /* Vector Multiply Half Words, Even, Signed, Saturate, Integer and */ \
688 /* Accumulate into Words */ \
689 V(evmhessiaaw, EVMHESSIAAW, 0x10000501) \
690 /* Vector Multiply Half Words, Even, Signed, Saturate, Integer and */ \
691 /* Accumulate Negative into Words */ \
692 V(evmhessianw, EVMHESSIANW, 0x10000581) \
693 /* Vector Multiply Half Words, Even, Unsigned, Modulo, Integer */ \
694 V(evmheumi, EVMHEUMI, 0x10000408) \
695 /* Vector Multiply Half Words, Even, Unsigned, Modulo, Integer to */ \
696 /* Accumulator */ \
697 V(evmheumia, EVMHEUMIA, 0x10000428) \
698 /* Vector Multiply Half Words, Even, Unsigned, Modulo, Integer and */ \
699 /* Accumulate into Words */ \
700 V(evmheumiaaw, EVMHEUMIAAW, 0x10000508) \
701 /* Vector Multiply Half Words, Even, Unsigned, Modulo, Integer and */ \
702 /* Accumulate Negative into Words */ \
703 V(evmheumianw, EVMHEUMIANW, 0x10000588) \
704 /* Vector Multiply Half Words, Even, Unsigned, Saturate, Integer and */ \
705 /* Accumulate into Words */ \
706 V(evmheusiaaw, EVMHEUSIAAW, 0x10000500) \
707 /* Vector Multiply Half Words, Even, Unsigned, Saturate, Integer and */ \
708 /* Accumulate Negative into Words */ \
709 V(evmheusianw, EVMHEUSIANW, 0x10000580) \
710 /* Vector Multiply Half Words, Odd, Guarded, Signed, Modulo, Fractional */ \
711 /* and Accumulate */ \
712 V(evmhogsmfaa, EVMHOGSMFAA, 0x1000052F) \
713 /* Vector Multiply Half Words, Odd, Guarded, Signed, Modulo, Fractional */ \
714 /* and Accumulate Negative */ \
715 V(evmhogsmfan, EVMHOGSMFAN, 0x100005AF) \
716 /* Vector Multiply Half Words, Odd, Guarded, Signed, Modulo, Integer, */ \
717 /* and Accumulate */ \
718 V(evmhogsmiaa, EVMHOGSMIAA, 0x1000052D) \
719 /* Vector Multiply Half Words, Odd, Guarded, Signed, Modulo, Integer and */ \
720 /* Accumulate Negative */ \
721 V(evmhogsmian, EVMHOGSMIAN, 0x100005AD) \
722 /* Vector Multiply Half Words, Odd, Guarded, Unsigned, Modulo, Integer */ \
723 /* and Accumulate */ \
724 V(evmhogumiaa, EVMHOGUMIAA, 0x1000052C) \
725 /* Vector Multiply Half Words, Odd, Guarded, Unsigned, Modulo, Integer */ \
726 /* and Accumulate Negative */ \
727 V(evmhogumian, EVMHOGUMIAN, 0x100005AC) \
728 /* Vector Multiply Half Words, Odd, Signed, Modulo, Fractional */ \
729 V(evmhosmf, EVMHOSMF, 0x1000040F) \
730 /* Vector Multiply Half Words, Odd, Signed, Modulo, Fractional to */ \
731 /* Accumulator */ \
732 V(evmhosmfa, EVMHOSMFA, 0x1000042F) \
733 /* Vector Multiply Half Words, Odd, Signed, Modulo, Fractional and */ \
734 /* Accumulate into Words */ \
735 V(evmhosmfaaw, EVMHOSMFAAW, 0x1000050F) \
736 /* Vector Multiply Half Words, Odd, Signed, Modulo, Fractional and */ \
737 /* Accumulate Negative into Words */ \
738 V(evmhosmfanw, EVMHOSMFANW, 0x1000058F) \
739 /* Vector Multiply Half Words, Odd, Signed, Modulo, Integer */ \
740 V(evmhosmi, EVMHOSMI, 0x1000040D) \
741 /* Vector Multiply Half Words, Odd, Signed, Modulo, Integer to */ \
742 /* Accumulator */ \
743 V(evmhosmia, EVMHOSMIA, 0x1000042D) \
744 /* Vector Multiply Half Words, Odd, Signed, Modulo, Integer and */ \
745 /* Accumulate into Words */ \
746 V(evmhosmiaaw, EVMHOSMIAAW, 0x1000050D) \
747 /* Vector Multiply Half Words, Odd, Signed, Modulo, Integer and */ \
748 /* Accumulate Negative into Words */ \
749 V(evmhosmianw, EVMHOSMIANW, 0x1000058D) \
750 /* Vector Multiply Half Words, Odd, Signed, Saturate, Fractional */ \
751 V(evmhossf, EVMHOSSF, 0x10000407) \
752 /* Vector Multiply Half Words, Odd, Signed, Saturate, Fractional to */ \
753 /* Accumulator */ \
754 V(evmhossfa, EVMHOSSFA, 0x10000427) \
755 /* Vector Multiply Half Words, Odd, Signed, Saturate, Fractional and */ \
756 /* Accumulate into Words */ \
757 V(evmhossfaaw, EVMHOSSFAAW, 0x10000507) \
758 /* Vector Multiply Half Words, Odd, Signed, Saturate, Fractional and */ \
759 /* Accumulate Negative into Words */ \
760 V(evmhossfanw, EVMHOSSFANW, 0x10000587) \
761 /* Vector Multiply Half Words, Odd, Signed, Saturate, Integer and */ \
762 /* Accumulate into Words */ \
763 V(evmhossiaaw, EVMHOSSIAAW, 0x10000505) \
764 /* Vector Multiply Half Words, Odd, Signed, Saturate, Integer and */ \
765 /* Accumulate Negative into Words */ \
766 V(evmhossianw, EVMHOSSIANW, 0x10000585) \
767 /* Vector Multiply Half Words, Odd, Unsigned, Modulo, Integer */ \
768 V(evmhoumi, EVMHOUMI, 0x1000040C) \
769 /* Vector Multiply Half Words, Odd, Unsigned, Modulo, Integer to */ \
770 /* Accumulator */ \
771 V(evmhoumia, EVMHOUMIA, 0x1000042C) \
772 /* Vector Multiply Half Words, Odd, Unsigned, Modulo, Integer and */ \
773 /* Accumulate into Words */ \
774 V(evmhoumiaaw, EVMHOUMIAAW, 0x1000050C) \
775 /* Vector Multiply Half Words, Odd, Unsigned, Modulo, Integer and */ \
776 /* Accumulate Negative into Words */ \
777 V(evmhoumianw, EVMHOUMIANW, 0x1000058C) \
778 /* Vector Multiply Half Words, Odd, Unsigned, Saturate, Integer and */ \
779 /* Accumulate into Words */ \
780 V(evmhousiaaw, EVMHOUSIAAW, 0x10000504) \
781 /* Vector Multiply Half Words, Odd, Unsigned, Saturate, Integer and */ \
782 /* Accumulate Negative into Words */ \
783 V(evmhousianw, EVMHOUSIANW, 0x10000584) \
784 /* Initialize Accumulator */ \
785 V(evmra, EVMRA, 0x100004C4) \
786 /* Vector Multiply Word High Signed, Modulo, Fractional */ \
787 V(evmwhsmf, EVMWHSMF, 0x1000044F) \
788 /* Vector Multiply Word High Signed, Modulo, Fractional to Accumulator */ \
789 V(evmwhsmfa, EVMWHSMFA, 0x1000046F) \
790 /* Vector Multiply Word High Signed, Modulo, Integer */ \
791 V(evmwhsmi, EVMWHSMI, 0x1000044D) \
792 /* Vector Multiply Word High Signed, Modulo, Integer to Accumulator */ \
793 V(evmwhsmia, EVMWHSMIA, 0x1000046D) \
794 /* Vector Multiply Word High Signed, Saturate, Fractional */ \
795 V(evmwhssf, EVMWHSSF, 0x10000447) \
796 /* Vector Multiply Word High Signed, Saturate, Fractional to Accumulator */ \
797 V(evmwhssfa, EVMWHSSFA, 0x10000467) \
798 /* Vector Multiply Word High Unsigned, Modulo, Integer */ \
799 V(evmwhumi, EVMWHUMI, 0x1000044C) \
800 /* Vector Multiply Word High Unsigned, Modulo, Integer to Accumulator */ \
801 V(evmwhumia, EVMWHUMIA, 0x1000046C) \
802 /* Vector Multiply Word Low Signed, Modulo, Integer and Accumulate in */ \
803 /* Words */ \
804 V(evmwlsmiaaw, EVMWLSMIAAW, 0x10000549) \
805 /* Vector Multiply Word Low Signed, Modulo, Integer and Accumulate */ \
806 /* Negative in Words */ \
807 V(evmwlsmianw, EVMWLSMIANW, 0x100005C9) \
808 /* Vector Multiply Word Low Signed, Saturate, Integer and Accumulate in */ \
809 /* Words */ \
810 V(evmwlssiaaw, EVMWLSSIAAW, 0x10000541) \
811 /* Vector Multiply Word Low Signed, Saturate, Integer and Accumulate */ \
812 /* Negative in Words */ \
813 V(evmwlssianw, EVMWLSSIANW, 0x100005C1) \
814 /* Vector Multiply Word Low Unsigned, Modulo, Integer */ \
815 V(evmwlumi, EVMWLUMI, 0x10000448) \
816 /* Vector Multiply Word Low Unsigned, Modulo, Integer to Accumulator */ \
817 V(evmwlumia, EVMWLUMIA, 0x10000468) \
818 /* Vector Multiply Word Low Unsigned, Modulo, Integer and Accumulate in */ \
819 /* Words */ \
820 V(evmwlumiaaw, EVMWLUMIAAW, 0x10000548) \
821 /* Vector Multiply Word Low Unsigned, Modulo, Integer and Accumulate */ \
822 /* Negative in Words */ \
823 V(evmwlumianw, EVMWLUMIANW, 0x100005C8) \
824 /* Vector Multiply Word Low Unsigned, Saturate, Integer and Accumulate */ \
825 /* in Words */ \
826 V(evmwlusiaaw, EVMWLUSIAAW, 0x10000540) \
827 /* Vector Multiply Word Low Unsigned, Saturate, Integer and Accumulate */ \
828 /* Negative in Words */ \
829 V(evmwlusianw, EVMWLUSIANW, 0x100005C0) \
830 /* Vector Multiply Word Signed, Modulo, Fractional */ \
831 V(evmwsmf, EVMWSMF, 0x1000045B) \
832 /* Vector Multiply Word Signed, Modulo, Fractional to Accumulator */ \
833 V(evmwsmfa, EVMWSMFA, 0x1000047B) \
834 /* Vector Multiply Word Signed, Modulo, Fractional and Accumulate */ \
835 V(evmwsmfaa, EVMWSMFAA, 0x1000055B) \
836 /* Vector Multiply Word Signed, Modulo, Fractional and Accumulate */ \
837 /* Negative */ \
838 V(evmwsmfan, EVMWSMFAN, 0x100005DB) \
839 /* Vector Multiply Word Signed, Modulo, Integer */ \
840 V(evmwsmi, EVMWSMI, 0x10000459) \
841 /* Vector Multiply Word Signed, Modulo, Integer to Accumulator */ \
842 V(evmwsmia, EVMWSMIA, 0x10000479) \
843 /* Vector Multiply Word Signed, Modulo, Integer and Accumulate */ \
844 V(evmwsmiaa, EVMWSMIAA, 0x10000559) \
845 /* Vector Multiply Word Signed, Modulo, Integer and Accumulate Negative */ \
846 V(evmwsmian, EVMWSMIAN, 0x100005D9) \
847 /* Vector Multiply Word Signed, Saturate, Fractional */ \
848 V(evmwssf, EVMWSSF, 0x10000453) \
849 /* Vector Multiply Word Signed, Saturate, Fractional to Accumulator */ \
850 V(evmwssfa, EVMWSSFA, 0x10000473) \
851 /* Vector Multiply Word Signed, Saturate, Fractional and Accumulate */ \
852 V(evmwssfaa, EVMWSSFAA, 0x10000553) \
853 /* Vector Multiply Word Signed, Saturate, Fractional and Accumulate */ \
854 /* Negative */ \
855 V(evmwssfan, EVMWSSFAN, 0x100005D3) \
856 /* Vector Multiply Word Unsigned, Modulo, Integer */ \
857 V(evmwumi, EVMWUMI, 0x10000458) \
858 /* Vector Multiply Word Unsigned, Modulo, Integer to Accumulator */ \
859 V(evmwumia, EVMWUMIA, 0x10000478) \
860 /* Vector Multiply Word Unsigned, Modulo, Integer and Accumulate */ \
861 V(evmwumiaa, EVMWUMIAA, 0x10000558) \
862 /* Vector Multiply Word Unsigned, Modulo, Integer and Accumulate */ \
863 /* Negative */ \
864 V(evmwumian, EVMWUMIAN, 0x100005D8) \
865 /* Vector NAND */ \
866 V(evnand, EVNAND, 0x1000021E) \
867 /* Vector Negate */ \
868 V(evneg, EVNEG, 0x10000209) \
869 /* Vector NOR */ \
870 V(evnor, EVNOR, 0x10000218) \
871 /* Vector OR */ \
872 V(evor, EVOR, 0x10000217) \
873 /* Vector OR with Complement */ \
874 V(evorc, EVORC, 0x1000021B) \
875 /* Vector Rotate Left Word */ \
876 V(evrlw, EVRLW, 0x10000228) \
877 /* Vector Rotate Left Word Immediate */ \
878 V(evrlwi, EVRLWI, 0x1000022A) \
879 /* Vector Round Word */ \
880 V(evrndw, EVRNDW, 0x1000020C) \
881 /* Vector Shift Left Word */ \
882 V(evslw, EVSLW, 0x10000224) \
883 /* Vector Shift Left Word Immediate */ \
884 V(evslwi, EVSLWI, 0x10000226) \
885 /* Vector Splat Fractional Immediate */ \
886 V(evsplatfi, EVSPLATFI, 0x1000022B) \
887 /* Vector Splat Immediate */ \
888 V(evsplati, EVSPLATI, 0x10000229) \
889 /* Vector Shift Right Word Immediate Signed */ \
890 V(evsrwis, EVSRWIS, 0x10000223) \
891 /* Vector Shift Right Word Immediate Unsigned */ \
892 V(evsrwiu, EVSRWIU, 0x10000222) \
893 /* Vector Shift Right Word Signed */ \
894 V(evsrws, EVSRWS, 0x10000221) \
895 /* Vector Shift Right Word Unsigned */ \
896 V(evsrwu, EVSRWU, 0x10000220) \
897 /* Vector Store Double of Double */ \
898 V(evstdd, EVSTDD, 0x10000321) \
899 /* Vector Store Double of Double Indexed */ \
900 V(evstddx, EVSTDDX, 0x10000320) \
901 /* Vector Store Double of Four Half Words */ \
902 V(evstdh, EVSTDH, 0x10000325) \
903 /* Vector Store Double of Four Half Words Indexed */ \
904 V(evstdhx, EVSTDHX, 0x10000324) \
905 /* Vector Store Double of Two Words */ \
906 V(evstdw, EVSTDW, 0x10000323) \
907 /* Vector Store Double of Two Words Indexed */ \
908 V(evstdwx, EVSTDWX, 0x10000322) \
909 /* Vector Store Word of Two Half Words from Even */ \
910 V(evstwhe, EVSTWHE, 0x10000331) \
911 /* Vector Store Word of Two Half Words from Even Indexed */ \
912 V(evstwhex, EVSTWHEX, 0x10000330) \
913 /* Vector Store Word of Two Half Words from Odd */ \
914 V(evstwho, EVSTWHO, 0x10000335) \
915 /* Vector Store Word of Two Half Words from Odd Indexed */ \
916 V(evstwhox, EVSTWHOX, 0x10000334) \
917 /* Vector Store Word of Word from Even */ \
918 V(evstwwe, EVSTWWE, 0x10000339) \
919 /* Vector Store Word of Word from Even Indexed */ \
920 V(evstwwex, EVSTWWEX, 0x10000338) \
921 /* Vector Store Word of Word from Odd */ \
922 V(evstwwo, EVSTWWO, 0x1000033D) \
923 /* Vector Store Word of Word from Odd Indexed */ \
924 V(evstwwox, EVSTWWOX, 0x1000033C) \
925 /* Vector Subtract Signed, Modulo, Integer to Accumulator Word */ \
926 V(evsubfsmiaaw, EVSUBFSMIAAW, 0x100004CB) \
927 /* Vector Subtract Signed, Saturate, Integer to Accumulator Word */ \
928 V(evsubfssiaaw, EVSUBFSSIAAW, 0x100004C3) \
929 /* Vector Subtract Unsigned, Modulo, Integer to Accumulator Word */ \
930 V(evsubfumiaaw, EVSUBFUMIAAW, 0x100004CA) \
931 /* Vector Subtract Unsigned, Saturate, Integer to Accumulator Word */ \
932 V(evsubfusiaaw, EVSUBFUSIAAW, 0x100004C2) \
933 /* Vector Subtract from Word */ \
934 V(evsubfw, EVSUBFW, 0x10000204) \
935 /* Vector Subtract Immediate from Word */ \
936 V(evsubifw, EVSUBIFW, 0x10000206) \
937 /* Vector XOR */ \
938 V(evxor, EVXOR, 0x10000216) \
939 /* Floating-Point Double-Precision Absolute Value */ \
940 V(efdabs, EFDABS, 0x100002E4) \
941 /* Floating-Point Double-Precision Add */ \
942 V(efdadd, EFDADD, 0x100002E0) \
943 /* Floating-Point Double-Precision Convert from Single-Precision */ \
944 V(efdcfs, EFDCFS, 0x100002EF) \
945 /* Convert Floating-Point Double-Precision from Signed Fraction */ \
946 V(efdcfsf, EFDCFSF, 0x100002F3) \
947 /* Convert Floating-Point Double-Precision from Signed Integer */ \
948 V(efdcfsi, EFDCFSI, 0x100002F1) \
949 /* Convert Floating-Point Double-Precision from Signed Integer */ \
950 /* Doubleword */ \
951 V(efdcfsid, EFDCFSID, 0x100002E3) \
952 /* Convert Floating-Point Double-Precision from Unsigned Fraction */ \
953 V(efdcfuf, EFDCFUF, 0x100002F2) \
954 /* Convert Floating-Point Double-Precision from Unsigned Integer */ \
955 V(efdcfui, EFDCFUI, 0x100002F0) \
956 /* Convert Floating-Point Double-Precision fromUnsigned Integer */ \
957 /* Doubleword */ \
958 V(efdcfuid, EFDCFUID, 0x100002E2) \
959 /* Floating-Point Double-Precision Compare Equal */ \
960 V(efdcmpeq, EFDCMPEQ, 0x100002EE) \
961 /* Floating-Point Double-Precision Compare Greater Than */ \
962 V(efdcmpgt, EFDCMPGT, 0x100002EC) \
963 /* Floating-Point Double-Precision Compare Less Than */ \
964 V(efdcmplt, EFDCMPLT, 0x100002ED) \
965 /* Convert Floating-Point Double-Precision to Signed Fraction */ \
966 V(efdctsf, EFDCTSF, 0x100002F7) \
967 /* Convert Floating-Point Double-Precision to Signed Integer */ \
968 V(efdctsi, EFDCTSI, 0x100002F5) \
969 /* Convert Floating-Point Double-Precision to Signed Integer Doubleword */ \
970 /* with Round toward Zero */ \
971 V(efdctsidz, EFDCTSIDZ, 0x100002EB) \
972 /* Convert Floating-Point Double-Precision to Signed Integer with Round */ \
973 /* toward Zero */ \
974 V(efdctsiz, EFDCTSIZ, 0x100002FA) \
975 /* Convert Floating-Point Double-Precision to Unsigned Fraction */ \
976 V(efdctuf, EFDCTUF, 0x100002F6) \
977 /* Convert Floating-Point Double-Precision to Unsigned Integer */ \
978 V(efdctui, EFDCTUI, 0x100002F4) \
979 /* Convert Floating-Point Double-Precision to Unsigned Integer */ \
980 /* Doubleword with Round toward Zero */ \
981 V(efdctuidz, EFDCTUIDZ, 0x100002EA) \
982 /* Convert Floating-Point Double-Precision to Unsigned Integer with */ \
983 /* Round toward Zero */ \
984 V(efdctuiz, EFDCTUIZ, 0x100002F8) \
985 /* Floating-Point Double-Precision Divide */ \
986 V(efddiv, EFDDIV, 0x100002E9) \
987 /* Floating-Point Double-Precision Multiply */ \
988 V(efdmul, EFDMUL, 0x100002E8) \
989 /* Floating-Point Double-Precision Negative Absolute Value */ \
990 V(efdnabs, EFDNABS, 0x100002E5) \
991 /* Floating-Point Double-Precision Negate */ \
992 V(efdneg, EFDNEG, 0x100002E6) \
993 /* Floating-Point Double-Precision Subtract */ \
994 V(efdsub, EFDSUB, 0x100002E1) \
995 /* Floating-Point Double-Precision Test Equal */ \
996 V(efdtsteq, EFDTSTEQ, 0x100002FE) \
997 /* Floating-Point Double-Precision Test Greater Than */ \
998 V(efdtstgt, EFDTSTGT, 0x100002FC) \
999 /* Floating-Point Double-Precision Test Less Than */ \
1000 V(efdtstlt, EFDTSTLT, 0x100002FD) \
1001 /* Floating-Point Single-Precision Convert from Double-Precision */ \
1002 V(efscfd, EFSCFD, 0x100002CF) \
1003 /* Floating-Point Absolute Value */ \
1004 V(efsabs, EFSABS, 0x100002C4) \
1005 /* Floating-Point Add */ \
1006 V(efsadd, EFSADD, 0x100002C0) \
1007 /* Convert Floating-Point from Signed Fraction */ \
1008 V(efscfsf, EFSCFSF, 0x100002D3) \
1009 /* Convert Floating-Point from Signed Integer */ \
1010 V(efscfsi, EFSCFSI, 0x100002D1) \
1011 /* Convert Floating-Point from Unsigned Fraction */ \
1012 V(efscfuf, EFSCFUF, 0x100002D2) \
1013 /* Convert Floating-Point from Unsigned Integer */ \
1014 V(efscfui, EFSCFUI, 0x100002D0) \
1015 /* Floating-Point Compare Equal */ \
1016 V(efscmpeq, EFSCMPEQ, 0x100002CE) \
1017 /* Floating-Point Compare Greater Than */ \
1018 V(efscmpgt, EFSCMPGT, 0x100002CC) \
1019 /* Floating-Point Compare Less Than */ \
1020 V(efscmplt, EFSCMPLT, 0x100002CD) \
1021 /* Convert Floating-Point to Signed Fraction */ \
1022 V(efsctsf, EFSCTSF, 0x100002D7) \
1023 /* Convert Floating-Point to Signed Integer */ \
1024 V(efsctsi, EFSCTSI, 0x100002D5) \
1025 /* Convert Floating-Point to Signed Integer with Round toward Zero */ \
1026 V(efsctsiz, EFSCTSIZ, 0x100002DA) \
1027 /* Convert Floating-Point to Unsigned Fraction */ \
1028 V(efsctuf, EFSCTUF, 0x100002D6) \
1029 /* Convert Floating-Point to Unsigned Integer */ \
1030 V(efsctui, EFSCTUI, 0x100002D4) \
1031 /* Convert Floating-Point to Unsigned Integer with Round toward Zero */ \
1032 V(efsctuiz, EFSCTUIZ, 0x100002D8) \
1033 /* Floating-Point Divide */ \
1034 V(efsdiv, EFSDIV, 0x100002C9) \
1035 /* Floating-Point Multiply */ \
1036 V(efsmul, EFSMUL, 0x100002C8) \
1037 /* Floating-Point Negative Absolute Value */ \
1038 V(efsnabs, EFSNABS, 0x100002C5) \
1039 /* Floating-Point Negate */ \
1040 V(efsneg, EFSNEG, 0x100002C6) \
1041 /* Floating-Point Subtract */ \
1042 V(efssub, EFSSUB, 0x100002C1) \
1043 /* Floating-Point Test Equal */ \
1044 V(efststeq, EFSTSTEQ, 0x100002DE) \
1045 /* Floating-Point Test Greater Than */ \
1046 V(efststgt, EFSTSTGT, 0x100002DC) \
1047 /* Floating-Point Test Less Than */ \
1048 V(efststlt, EFSTSTLT, 0x100002DD) \
1049 /* Vector Floating-Point Absolute Value */ \
1050 V(evfsabs, EVFSABS, 0x10000284) \
1051 /* Vector Floating-Point Add */ \
1052 V(evfsadd, EVFSADD, 0x10000280) \
1053 /* Vector Convert Floating-Point from Signed Fraction */ \
1054 V(evfscfsf, EVFSCFSF, 0x10000293) \
1055 /* Vector Convert Floating-Point from Signed Integer */ \
1056 V(evfscfsi, EVFSCFSI, 0x10000291) \
1057 /* Vector Convert Floating-Point from Unsigned Fraction */ \
1058 V(evfscfuf, EVFSCFUF, 0x10000292) \
1059 /* Vector Convert Floating-Point from Unsigned Integer */ \
1060 V(evfscfui, EVFSCFUI, 0x10000290) \
1061 /* Vector Floating-Point Compare Equal */ \
1062 V(evfscmpeq, EVFSCMPEQ, 0x1000028E) \
1063 /* Vector Floating-Point Compare Greater Than */ \
1064 V(evfscmpgt, EVFSCMPGT, 0x1000028C) \
1065 /* Vector Floating-Point Compare Less Than */ \
1066 V(evfscmplt, EVFSCMPLT, 0x1000028D) \
1067 /* Vector Convert Floating-Point to Signed Fraction */ \
1068 V(evfsctsf, EVFSCTSF, 0x10000297) \
1069 /* Vector Convert Floating-Point to Signed Integer */ \
1070 V(evfsctsi, EVFSCTSI, 0x10000295) \
1071 /* Vector Convert Floating-Point to Signed Integer with Round toward */ \
1072 /* Zero */ \
1073 V(evfsctsiz, EVFSCTSIZ, 0x1000029A) \
1074 /* Vector Convert Floating-Point to Unsigned Fraction */ \
1075 V(evfsctuf, EVFSCTUF, 0x10000296) \
1076 /* Vector Convert Floating-Point to Unsigned Integer */ \
1077 V(evfsctui, EVFSCTUI, 0x10000294) \
1078 /* Vector Convert Floating-Point to Unsigned Integer with Round toward */ \
1079 /* Zero */ \
1080 V(evfsctuiz, EVFSCTUIZ, 0x10000298) \
1081 /* Vector Floating-Point Divide */ \
1082 V(evfsdiv, EVFSDIV, 0x10000289) \
1083 /* Vector Floating-Point Multiply */ \
1084 V(evfsmul, EVFSMUL, 0x10000288) \
1085 /* Vector Floating-Point Negative Absolute Value */ \
1086 V(evfsnabs, EVFSNABS, 0x10000285) \
1087 /* Vector Floating-Point Negate */ \
1088 V(evfsneg, EVFSNEG, 0x10000286) \
1089 /* Vector Floating-Point Subtract */ \
1090 V(evfssub, EVFSSUB, 0x10000281) \
1091 /* Vector Floating-Point Test Equal */ \
1092 V(evfststeq, EVFSTSTEQ, 0x1000029E) \
1093 /* Vector Floating-Point Test Greater Than */ \
1094 V(evfststgt, EVFSTSTGT, 0x1000029C) \
1095 /* Vector Floating-Point Test Less Than */ \
1096 V(evfststlt, EVFSTSTLT, 0x1000029D)
1097
1098 #define PPC_VC_OPCODE_LIST(V) \
1099 /* Vector Compare Bounds Single-Precision */ \
1100 V(vcmpbfp, VCMPBFP, 0x100003C6) \
1101 /* Vector Compare Equal To Single-Precision */ \
1102 V(vcmpeqfp, VCMPEQFP, 0x100000C6) \
1103 /* Vector Compare Equal To Unsigned Byte */ \
1104 V(vcmpequb, VCMPEQUB, 0x10000006) \
1105 /* Vector Compare Equal To Unsigned Doubleword */ \
1106 V(vcmpequd, VCMPEQUD, 0x100000C7) \
1107 /* Vector Compare Equal To Unsigned Halfword */ \
1108 V(vcmpequh, VCMPEQUH, 0x10000046) \
1109 /* Vector Compare Equal To Unsigned Word */ \
1110 V(vcmpequw, VCMPEQUW, 0x10000086) \
1111 /* Vector Compare Greater Than or Equal To Single-Precision */ \
1112 V(vcmpgefp, VCMPGEFP, 0x100001C6) \
1113 /* Vector Compare Greater Than Single-Precision */ \
1114 V(vcmpgtfp, VCMPGTFP, 0x100002C6) \
1115 /* Vector Compare Greater Than Signed Byte */ \
1116 V(vcmpgtsb, VCMPGTSB, 0x10000306) \
1117 /* Vector Compare Greater Than Signed Doubleword */ \
1118 V(vcmpgtsd, VCMPGTSD, 0x100003C7) \
1119 /* Vector Compare Greater Than Signed Halfword */ \
1120 V(vcmpgtsh, VCMPGTSH, 0x10000346) \
1121 /* Vector Compare Greater Than Signed Word */ \
1122 V(vcmpgtsw, VCMPGTSW, 0x10000386) \
1123 /* Vector Compare Greater Than Unsigned Byte */ \
1124 V(vcmpgtub, VCMPGTUB, 0x10000206) \
1125 /* Vector Compare Greater Than Unsigned Doubleword */ \
1126 V(vcmpgtud, VCMPGTUD, 0x100002C7) \
1127 /* Vector Compare Greater Than Unsigned Halfword */ \
1128 V(vcmpgtuh, VCMPGTUH, 0x10000246) \
1129 /* Vector Compare Greater Than Unsigned Word */ \
1130 V(vcmpgtuw, VCMPGTUW, 0x10000286)
1131
1132 #define PPC_X_OPCODE_A_FORM_LIST(V) \
1133 /* Modulo Signed Dword */ \
1134 V(modsd, MODSD, 0x7C000612) \
1135 /* Modulo Unsigned Dword */ \
1136 V(modud, MODUD, 0x7C000212) \
1137 /* Modulo Signed Word */ \
1138 V(modsw, MODSW, 0x7C000616) \
1139 /* Modulo Unsigned Word */ \
1140 V(moduw, MODUW, 0x7C000216)
1141
1142 #define PPC_X_OPCODE_B_FORM_LIST(V) \
1143 /* XOR */ \
1144 V(xor_, XORX, 0x7C000278) \
1145 /* AND */ \
1146 V(and_, ANDX, 0x7C000038) \
1147 /* AND with Complement */ \
1148 V(andc, ANDCX, 0x7C000078) \
1149 /* OR */ \
1150 V(orx, ORX, 0x7C000378) \
1151 /* OR with Complement */ \
1152 V(orc, ORC, 0x7C000338) \
1153 /* NOR */ \
1154 V(nor, NORX, 0x7C0000F8) \
1155 /* Shift Right Word */ \
1156 V(srw, SRWX, 0x7C000430) \
1157 /* Shift Left Word */ \
1158 V(slw, SLWX, 0x7C000030) \
1159 /* Shift Right Algebraic Word */ \
1160 V(sraw, SRAW, 0x7C000630) \
1161 /* Shift Left Doubleword */ \
1162 V(sld, SLDX, 0x7C000036) \
1163 /* Shift Right Algebraic Doubleword */ \
1164 V(srad, SRAD, 0x7C000634) \
1165 /* Shift Right Doubleword */ \
1166 V(srd, SRDX, 0x7C000436)
1167
1168 #define PPC_X_OPCODE_C_FORM_LIST(V) \
1169 /* Count Leading Zeros Word */ \
1170 V(cntlzw, CNTLZWX, 0x7C000034) \
1171 /* Count Leading Zeros Doubleword */ \
1172 V(cntlzd, CNTLZDX, 0x7C000074) \
1173 /* Population Count Byte-wise */ \
1174 V(popcntb, POPCNTB, 0x7C0000F4) \
1175 /* Population Count Words */ \
1176 V(popcntw, POPCNTW, 0x7C0002F4) \
1177 /* Population Count Doubleword */ \
1178 V(popcntd, POPCNTD, 0x7C0003F4) \
1179 /* Extend Sign Byte */ \
1180 V(extsb, EXTSB, 0x7C000774) \
1181 /* Extend Sign Halfword */ \
1182 V(extsh, EXTSH, 0x7C000734)
1183
1184 #define PPC_X_OPCODE_D_FORM_LIST(V) \
1185 /* Load Halfword Byte-Reverse Indexed */ \
1186 V(lhbrx, LHBRX, 0x7C00062C) \
1187 /* Load Word Byte-Reverse Indexed */ \
1188 V(lwbrx, LWBRX, 0x7C00042C) \
1189 /* Load Doubleword Byte-Reverse Indexed */ \
1190 V(ldbrx, LDBRX, 0x7C000428) \
1191 /* Load Byte and Zero Indexed */ \
1192 V(lbzx, LBZX, 0x7C0000AE) \
1193 /* Load Byte and Zero with Update Indexed */ \
1194 V(lbzux, LBZUX, 0x7C0000EE) \
1195 /* Load Halfword and Zero Indexed */ \
1196 V(lhzx, LHZX, 0x7C00022E) \
1197 /* Load Halfword and Zero with Update Indexed */ \
1198 V(lhzux, LHZUX, 0x7C00026E) \
1199 /* Load Halfword Algebraic Indexed */ \
1200 V(lhax, LHAX, 0x7C0002AE) \
1201 /* Load Word and Zero Indexed */ \
1202 V(lwzx, LWZX, 0x7C00002E) \
1203 /* Load Word and Zero with Update Indexed */ \
1204 V(lwzux, LWZUX, 0x7C00006E) \
1205 /* Load Doubleword Indexed */ \
1206 V(ldx, LDX, 0x7C00002A) \
1207 /* Load Doubleword with Update Indexed */ \
1208 V(ldux, LDUX, 0x7C00006A) \
1209 /* Load Floating-Point Double Indexed */ \
1210 V(lfdx, LFDX, 0x7C0004AE) \
1211 /* Load Floating-Point Single Indexed */ \
1212 V(lfsx, LFSX, 0x7C00042E) \
1213 /* Load Floating-Point Double with Update Indexed */ \
1214 V(lfdux, LFDUX, 0x7C0004EE) \
1215 /* Load Floating-Point Single with Update Indexed */ \
1216 V(lfsux, LFSUX, 0x7C00046E) \
1217 /* Store Byte with Update Indexed */ \
1218 V(stbux, STBUX, 0x7C0001EE) \
1219 /* Store Byte Indexed */ \
1220 V(stbx, STBX, 0x7C0001AE) \
1221 /* Store Halfword with Update Indexed */ \
1222 V(sthux, STHUX, 0x7C00036E) \
1223 /* Store Halfword Indexed */ \
1224 V(sthx, STHX, 0x7C00032E) \
1225 /* Store Word with Update Indexed */ \
1226 V(stwux, STWUX, 0x7C00016E) \
1227 /* Store Word Indexed */ \
1228 V(stwx, STWX, 0x7C00012E) \
1229 /* Store Doubleword with Update Indexed */ \
1230 V(stdux, STDUX, 0x7C00016A) \
1231 /* Store Doubleword Indexed */ \
1232 V(stdx, STDX, 0x7C00012A) \
1233 /* Store Floating-Point Double with Update Indexed */ \
1234 V(stfdux, STFDUX, 0x7C0005EE) \
1235 /* Store Floating-Point Double Indexed */ \
1236 V(stfdx, STFDX, 0x7C0005AE) \
1237 /* Store Floating-Point Single with Update Indexed */ \
1238 V(stfsux, STFSUX, 0x7C00056E) \
1239 /* Store Floating-Point Single Indexed */ \
1240 V(stfsx, STFSX, 0x7C00052E) \
1241 /* Load Vector Indexed */ \
1242 V(lvx, LVX, 0x7C0000CE) \
1243 /* Store Vector Indexed */ \
1244 V(stvx, STVX, 0x7C0001CE)
1245
1246 #define PPC_X_OPCODE_E_FORM_LIST(V) \
1247 /* Shift Right Algebraic Word Immediate */ \
1248 V(srawi, SRAWIX, 0x7C000670)
1249
1250 #define PPC_X_OPCODE_F_FORM_LIST(V) \
1251 /* Compare */ \
1252 V(cmp, CMP, 0x7C000000) \
1253 /* Compare Logical */ \
1254 V(cmpl, CMPL, 0x7C000040)
1255
1256 #define PPC_X_OPCODE_EH_S_FORM_LIST(V) \
1257 /* Store Byte Conditional Indexed */ \
1258 V(stbcx, STBCX, 0x7C00056D) \
1259 /* Store Halfword Conditional Indexed Xform */ \
1260 V(sthcx, STHCX, 0x7C0005AD) \
1261 /* Store Word Conditional Indexed & record CR0 */ \
1262 V(stwcx, STWCX, 0x7C00012D) \
1263 /* Store Doubleword Conditional Indexed & record CR0 */ \
1264 V(stdcx, STDCX, 0x7C0001AD)
1265
1266 #define PPC_X_OPCODE_EH_L_FORM_LIST(V) \
1267 /* Load Byte And Reserve Indexed */ \
1268 V(lbarx, LBARX, 0x7C000068) \
1269 /* Load Halfword And Reserve Indexed Xform */ \
1270 V(lharx, LHARX, 0x7C0000E8) \
1271 /* Load Word and Reserve Indexed */ \
1272 V(lwarx, LWARX, 0x7C000028) \
1273 /* Load Doubleword And Reserve Indexed */ \
1274 V(ldarx, LDARX, 0x7C0000A8)
1275
1276 #define PPC_X_OPCODE_UNUSED_LIST(V) \
1277 /* Bit Permute Doubleword */ \
1278 V(bpermd, BPERMD, 0x7C0001F8) \
1279 /* Extend Sign Word */ \
1280 V(extsw, EXTSW, 0x7C0007B4) \
1281 /* Load Word Algebraic with Update Indexed */ \
1282 V(lwaux, LWAUX, 0x7C0002EA) \
1283 /* Load Word Algebraic Indexed */ \
1284 V(lwax, LWAX, 0x7C0002AA) \
1285 /* Parity Doubleword */ \
1286 V(prtyd, PRTYD, 0x7C000174) \
1287 /* Store Doubleword Byte-Reverse Indexed */ \
1288 V(stdbrx, STDBRX, 0x7C000528) \
1289 /* Trap Doubleword */ \
1290 V(td, TD, 0x7C000088) \
1291 /* Branch Conditional to Branch Target Address Register */ \
1292 V(bctar, BCTAR, 0x4C000460) \
1293 /* Compare Byte */ \
1294 V(cmpb, CMPB, 0x7C0003F8) \
1295 /* Data Cache Block Flush */ \
1296 V(dcbf, DCBF, 0x7C0000AC) \
1297 /* Data Cache Block Store */ \
1298 V(dcbst, DCBST, 0x7C00006C) \
1299 /* Data Cache Block Touch */ \
1300 V(dcbt, DCBT, 0x7C00022C) \
1301 /* Data Cache Block Touch for Store */ \
1302 V(dcbtst, DCBTST, 0x7C0001EC) \
1303 /* Data Cache Block Zero */ \
1304 V(dcbz, DCBZ, 0x7C0007EC) \
1305 /* Equivalent */ \
1306 V(eqv, EQV, 0x7C000238) \
1307 /* Instruction Cache Block Invalidate */ \
1308 V(icbi, ICBI, 0x7C0007AC) \
1309 /* NAND */ \
1310 V(nand, NAND, 0x7C0003B8) \
1311 /* Parity Word */ \
1312 V(prtyw, PRTYW, 0x7C000134) \
1313 /* Store Halfword Byte-Reverse Indexed */ \
1314 V(sthbrx, STHBRX, 0x7C00072C) \
1315 /* Store Word Byte-Reverse Indexed */ \
1316 V(stwbrx, STWBRX, 0x7C00052C) \
1317 /* Synchronize */ \
1318 V(sync, SYNC, 0x7C0004AC) \
1319 /* Trap Word */ \
1320 V(tw, TW, 0x7C000008) \
1321 /* ExecuExecuted No Operation */ \
1322 V(xnop, XNOP, 0x68000000) \
1323 /* Convert Binary Coded Decimal To Declets */ \
1324 V(cbcdtd, CBCDTD, 0x7C000274) \
1325 /* Convert Declets To Binary Coded Decimal */ \
1326 V(cdtbcd, CDTBCD, 0x7C000234) \
1327 /* Decimal Floating Add */ \
1328 V(dadd, DADD, 0xEC000004) \
1329 /* Decimal Floating Add Quad */ \
1330 V(daddq, DADDQ, 0xFC000004) \
1331 /* Decimal Floating Convert From Fixed */ \
1332 V(dcffix, DCFFIX, 0xEC000644) \
1333 /* Decimal Floating Convert From Fixed Quad */ \
1334 V(dcffixq, DCFFIXQ, 0xFC000644) \
1335 /* Decimal Floating Compare Ordered */ \
1336 V(dcmpo, DCMPO, 0xEC000104) \
1337 /* Decimal Floating Compare Ordered Quad */ \
1338 V(dcmpoq, DCMPOQ, 0xFC000104) \
1339 /* Decimal Floating Compare Unordered */ \
1340 V(dcmpu, DCMPU, 0xEC000504) \
1341 /* Decimal Floating Compare Unordered Quad */ \
1342 V(dcmpuq, DCMPUQ, 0xFC000504) \
1343 /* Decimal Floating Convert To DFP Long */ \
1344 V(dctdp, DCTDP, 0xEC000204) \
1345 /* Decimal Floating Convert To Fixed */ \
1346 V(dctfix, DCTFIX, 0xEC000244) \
1347 /* Decimal Floating Convert To Fixed Quad */ \
1348 V(dctfixq, DCTFIXQ, 0xFC000244) \
1349 /* Decimal Floating Convert To DFP Extended */ \
1350 V(dctqpq, DCTQPQ, 0xFC000204) \
1351 /* Decimal Floating Decode DPD To BCD */ \
1352 V(ddedpd, DDEDPD, 0xEC000284) \
1353 /* Decimal Floating Decode DPD To BCD Quad */ \
1354 V(ddedpdq, DDEDPDQ, 0xFC000284) \
1355 /* Decimal Floating Divide */ \
1356 V(ddiv, DDIV, 0xEC000444) \
1357 /* Decimal Floating Divide Quad */ \
1358 V(ddivq, DDIVQ, 0xFC000444) \
1359 /* Decimal Floating Encode BCD To DPD */ \
1360 V(denbcd, DENBCD, 0xEC000684) \
1361 /* Decimal Floating Encode BCD To DPD Quad */ \
1362 V(denbcdq, DENBCDQ, 0xFC000684) \
1363 /* Decimal Floating Insert Exponent */ \
1364 V(diex, DIEX, 0xEC0006C4) \
1365 /* Decimal Floating Insert Exponent Quad */ \
1366 V(diexq, DIEXQ, 0xFC0006C4) \
1367 /* Decimal Floating Multiply */ \
1368 V(dmul, DMUL, 0xEC000044) \
1369 /* Decimal Floating Multiply Quad */ \
1370 V(dmulq, DMULQ, 0xFC000044) \
1371 /* Decimal Floating Round To DFP Long */ \
1372 V(drdpq, DRDPQ, 0xFC000604) \
1373 /* Decimal Floating Round To DFP Short */ \
1374 V(drsp, DRSP, 0xEC000604) \
1375 /* Decimal Floating Subtract */ \
1376 V(dsub, DSUB, 0xEC000404) \
1377 /* Decimal Floating Subtract Quad */ \
1378 V(dsubq, DSUBQ, 0xFC000404) \
1379 /* Decimal Floating Test Exponent */ \
1380 V(dtstex, DTSTEX, 0xEC000144) \
1381 /* Decimal Floating Test Exponent Quad */ \
1382 V(dtstexq, DTSTEXQ, 0xFC000144) \
1383 /* Decimal Floating Test Significance */ \
1384 V(dtstsf, DTSTSF, 0xEC000544) \
1385 /* Decimal Floating Test Significance Quad */ \
1386 V(dtstsfq, DTSTSFQ, 0xFC000544) \
1387 /* Decimal Floating Extract Exponent */ \
1388 V(dxex, DXEX, 0xEC0002C4) \
1389 /* Decimal Floating Extract Exponent Quad */ \
1390 V(dxexq, DXEXQ, 0xFC0002C4) \
1391 /* Decorated Storage Notify */ \
1392 V(dsn, DSN, 0x7C0003C6) \
1393 /* Load Byte with Decoration Indexed */ \
1394 V(lbdx, LBDX, 0x7C000406) \
1395 /* Load Doubleword with Decoration Indexed */ \
1396 V(lddx, LDDX, 0x7C0004C6) \
1397 /* Load Floating Doubleword with Decoration Indexed */ \
1398 V(lfddx, LFDDX, 0x7C000646) \
1399 /* Load Halfword with Decoration Indexed */ \
1400 V(lhdx, LHDX, 0x7C000446) \
1401 /* Load Word with Decoration Indexed */ \
1402 V(lwdx, LWDX, 0x7C000486) \
1403 /* Store Byte with Decoration Indexed */ \
1404 V(stbdx, STBDX, 0x7C000506) \
1405 /* Store Doubleword with Decoration Indexed */ \
1406 V(stddx, STDDX, 0x7C0005C6) \
1407 /* Store Floating Doubleword with Decoration Indexed */ \
1408 V(stfddx, STFDDX, 0x7C000746) \
1409 /* Store Halfword with Decoration Indexed */ \
1410 V(sthdx, STHDX, 0x7C000546) \
1411 /* Store Word with Decoration Indexed */ \
1412 V(stwdx, STWDX, 0x7C000586) \
1413 /* Data Cache Block Allocate */ \
1414 V(dcba, DCBA, 0x7C0005EC) \
1415 /* Data Cache Block Invalidate */ \
1416 V(dcbi, DCBI, 0x7C0003AC) \
1417 /* Instruction Cache Block Touch */ \
1418 V(icbt, ICBT, 0x7C00002C) \
1419 /* Move to Condition Register from XER */ \
1420 V(mcrxr, MCRXR, 0x7C000400) \
1421 /* TLB Invalidate Local Indexed */ \
1422 V(tlbilx, TLBILX, 0x7C000024) \
1423 /* TLB Invalidate Virtual Address Indexed */ \
1424 V(tlbivax, TLBIVAX, 0x7C000624) \
1425 /* TLB Read Entry */ \
1426 V(tlbre, TLBRE, 0x7C000764) \
1427 /* TLB Search Indexed */ \
1428 V(tlbsx, TLBSX, 0x7C000724) \
1429 /* TLB Write Entry */ \
1430 V(tlbwe, TLBWE, 0x7C0007A4) \
1431 /* Write External Enable */ \
1432 V(wrtee, WRTEE, 0x7C000106) \
1433 /* Write External Enable Immediate */ \
1434 V(wrteei, WRTEEI, 0x7C000146) \
1435 /* Data Cache Read */ \
1436 V(dcread, DCREAD, 0x7C00028C) \
1437 /* Instruction Cache Read */ \
1438 V(icread, ICREAD, 0x7C0007CC) \
1439 /* Data Cache Invalidate */ \
1440 V(dci, DCI, 0x7C00038C) \
1441 /* Instruction Cache Invalidate */ \
1442 V(ici, ICI, 0x7C00078C) \
1443 /* Move From Device Control Register User Mode Indexed */ \
1444 V(mfdcrux, MFDCRUX, 0x7C000246) \
1445 /* Move From Device Control Register Indexed */ \
1446 V(mfdcrx, MFDCRX, 0x7C000206) \
1447 /* Move To Device Control Register User Mode Indexed */ \
1448 V(mtdcrux, MTDCRUX, 0x7C000346) \
1449 /* Move To Device Control Register Indexed */ \
1450 V(mtdcrx, MTDCRX, 0x7C000306) \
1451 /* Return From Debug Interrupt */ \
1452 V(rfdi, RFDI, 0x4C00004E) \
1453 /* Data Cache Block Flush by External PID */ \
1454 V(dcbfep, DCBFEP, 0x7C0000FE) \
1455 /* Data Cache Block Store by External PID */ \
1456 V(dcbstep, DCBSTEP, 0x7C00007E) \
1457 /* Data Cache Block Touch by External PID */ \
1458 V(dcbtep, DCBTEP, 0x7C00027E) \
1459 /* Data Cache Block Touch for Store by External PID */ \
1460 V(dcbtstep, DCBTSTEP, 0x7C0001FE) \
1461 /* Data Cache Block Zero by External PID */ \
1462 V(dcbzep, DCBZEP, 0x7C0007FE) \
1463 /* Instruction Cache Block Invalidate by External PID */ \
1464 V(icbiep, ICBIEP, 0x7C0007BE) \
1465 /* Load Byte and Zero by External PID Indexed */ \
1466 V(lbepx, LBEPX, 0x7C0000BE) \
1467 /* Load Floating-Point Double by External PID Indexed */ \
1468 V(lfdepx, LFDEPX, 0x7C0004BE) \
1469 /* Load Halfword and Zero by External PID Indexed */ \
1470 V(lhepx, LHEPX, 0x7C00023E) \
1471 /* Load Vector by External PID Indexed */ \
1472 V(lvepx, LVEPX, 0x7C00024E) \
1473 /* Load Vector by External PID Indexed Last */ \
1474 V(lvepxl, LVEPXL, 0x7C00020E) \
1475 /* Load Word and Zero by External PID Indexed */ \
1476 V(lwepx, LWEPX, 0x7C00003E) \
1477 /* Store Byte by External PID Indexed */ \
1478 V(stbepx, STBEPX, 0x7C0001BE) \
1479 /* Store Floating-Point Double by External PID Indexed */ \
1480 V(stfdepx, STFDEPX, 0x7C0005BE) \
1481 /* Store Halfword by External PID Indexed */ \
1482 V(sthepx, STHEPX, 0x7C00033E) \
1483 /* Store Vector by External PID Indexed */ \
1484 V(stvepx, STVEPX, 0x7C00064E) \
1485 /* Store Vector by External PID Indexed Last */ \
1486 V(stvepxl, STVEPXL, 0x7C00060E) \
1487 /* Store Word by External PID Indexed */ \
1488 V(stwepx, STWEPX, 0x7C00013E) \
1489 /* Load Doubleword by External PID Indexed */ \
1490 V(ldepx, LDEPX, 0x7C00003A) \
1491 /* Store Doubleword by External PID Indexed */ \
1492 V(stdepx, STDEPX, 0x7C00013A) \
1493 /* TLB Search and Reserve Indexed */ \
1494 V(tlbsrx, TLBSRX, 0x7C0006A5) \
1495 /* External Control In Word Indexed */ \
1496 V(eciwx, ECIWX, 0x7C00026C) \
1497 /* External Control Out Word Indexed */ \
1498 V(ecowx, ECOWX, 0x7C00036C) \
1499 /* Data Cache Block Lock Clear */ \
1500 V(dcblc, DCBLC, 0x7C00030C) \
1501 /* Data Cache Block Lock Query */ \
1502 V(dcblq, DCBLQ, 0x7C00034D) \
1503 /* Data Cache Block Touch and Lock Set */ \
1504 V(dcbtls, DCBTLS, 0x7C00014C) \
1505 /* Data Cache Block Touch for Store and Lock Set */ \
1506 V(dcbtstls, DCBTSTLS, 0x7C00010C) \
1507 /* Instruction Cache Block Lock Clear */ \
1508 V(icblc, ICBLC, 0x7C0001CC) \
1509 /* Instruction Cache Block Lock Query */ \
1510 V(icblq, ICBLQ, 0x7C00018D) \
1511 /* Instruction Cache Block Touch and Lock Set */ \
1512 V(icbtls, ICBTLS, 0x7C0003CC) \
1513 /* Floating Compare Ordered */ \
1514 V(fcmpo, FCMPO, 0xFC000040) \
1515 /* Floating Compare Unordered */ \
1516 V(fcmpu, FCMPU, 0xFC000000) \
1517 /* Floating Test for software Divide */ \
1518 V(ftdiv, FTDIV, 0xFC000100) \
1519 /* Floating Test for software Square Root */ \
1520 V(ftsqrt, FTSQRT, 0xFC000140) \
1521 /* Load Floating-Point as Integer Word Algebraic Indexed */ \
1522 V(lfiwax, LFIWAX, 0x7C0006AE) \
1523 /* Load Floating-Point as Integer Word and Zero Indexed */ \
1524 V(lfiwzx, LFIWZX, 0x7C0006EE) \
1525 /* Move To Condition Register from FPSCR */ \
1526 V(mcrfs, MCRFS, 0xFC000080) \
1527 /* Store Floating-Point as Integer Word Indexed */ \
1528 V(stfiwx, STFIWX, 0x7C0007AE) \
1529 /* Load Floating-Point Double Pair Indexed */ \
1530 V(lfdpx, LFDPX, 0x7C00062E) \
1531 /* Store Floating-Point Double Pair Indexed */ \
1532 V(stfdpx, STFDPX, 0x7C00072E) \
1533 /* Floating Absolute Value */ \
1534 V(fabs, FABS, 0xFC000210) \
1535 /* Floating Convert From Integer Doubleword */ \
1536 V(fcfid, FCFID, 0xFC00069C) \
1537 /* Floating Convert From Integer Doubleword Single */ \
1538 V(fcfids, FCFIDS, 0xEC00069C) \
1539 /* Floating Convert From Integer Doubleword Unsigned */ \
1540 V(fcfidu, FCFIDU, 0xFC00079C) \
1541 /* Floating Convert From Integer Doubleword Unsigned Single */ \
1542 V(fcfidus, FCFIDUS, 0xEC00079C) \
1543 /* Floating Copy Sign */ \
1544 V(fcpsgn, FCPSGN, 0xFC000010) \
1545 /* Floating Convert To Integer Doubleword */ \
1546 V(fctid, FCTID, 0xFC00065C) \
1547 /* Floating Convert To Integer Doubleword Unsigned */ \
1548 V(fctidu, FCTIDU, 0xFC00075C) \
1549 /* Floating Convert To Integer Doubleword Unsigned with round toward */ \
1550 /* Zero */ \
1551 V(fctiduz, FCTIDUZ, 0xFC00075E) \
1552 /* Floating Convert To Integer Doubleword with round toward Zero */ \
1553 V(fctidz, FCTIDZ, 0xFC00065E) \
1554 /* Floating Convert To Integer Word */ \
1555 V(fctiw, FCTIW, 0xFC00001C) \
1556 /* Floating Convert To Integer Word Unsigned */ \
1557 V(fctiwu, FCTIWU, 0xFC00011C) \
1558 /* Floating Convert To Integer Word Unsigned with round toward Zero */ \
1559 V(fctiwuz, FCTIWUZ, 0xFC00011E) \
1560 /* Floating Convert To Integer Word with round to Zero */ \
1561 V(fctiwz, FCTIWZ, 0xFC00001E) \
1562 /* Floating Move Register */ \
1563 V(fmr, FMR, 0xFC000090) \
1564 /* Floating Negative Absolute Value */ \
1565 V(fnabs, FNABS, 0xFC000110) \
1566 /* Floating Negate */ \
1567 V(fneg, FNEG, 0xFC000050) \
1568 /* Floating Round to Single-Precision */ \
1569 V(frsp, FRSP, 0xFC000018) \
1570 /* Move From FPSCR */ \
1571 V(mffs, MFFS, 0xFC00048E) \
1572 /* Move To FPSCR Bit 0 */ \
1573 V(mtfsb0, MTFSB0, 0xFC00008C) \
1574 /* Move To FPSCR Bit 1 */ \
1575 V(mtfsb1, MTFSB1, 0xFC00004C) \
1576 /* Move To FPSCR Field Immediate */ \
1577 V(mtfsfi, MTFSFI, 0xFC00010C) \
1578 /* Floating Round To Integer Minus */ \
1579 V(frim, FRIM, 0xFC0003D0) \
1580 /* Floating Round To Integer Nearest */ \
1581 V(frin, FRIN, 0xFC000310) \
1582 /* Floating Round To Integer Plus */ \
1583 V(frip, FRIP, 0xFC000390) \
1584 /* Floating Round To Integer toward Zero */ \
1585 V(friz, FRIZ, 0xFC000350) \
1586 /* Multiply Cross Halfword to Word Signed */ \
1587 V(mulchw, MULCHW, 0x10000150) \
1588 /* Multiply Cross Halfword to Word Unsigned */ \
1589 V(mulchwu, MULCHWU, 0x10000110) \
1590 /* Multiply High Halfword to Word Signed */ \
1591 V(mulhhw, MULHHW, 0x10000050) \
1592 /* Multiply High Halfword to Word Unsigned */ \
1593 V(mulhhwu, MULHHWU, 0x10000010) \
1594 /* Multiply Low Halfword to Word Signed */ \
1595 V(mullhw, MULLHW, 0x10000350) \
1596 /* Multiply Low Halfword to Word Unsigned */ \
1597 V(mullhwu, MULLHWU, 0x10000310) \
1598 /* Determine Leftmost Zero Byte DQ 56 E0000000 P 58 LSQ lq Load Quadword */ \
1599 V(dlmzb, DLMZB, 0x7C00009C) \
1600 /* Load Quadword And Reserve Indexed */ \
1601 V(lqarx, LQARX, 0x7C000228) \
1602 /* Store Quadword Conditional Indexed and record CR0 */ \
1603 V(stqcx, STQCX, 0x7C00016D) \
1604 /* Load String Word Immediate */ \
1605 V(lswi, LSWI, 0x7C0004AA) \
1606 /* Load String Word Indexed */ \
1607 V(lswx, LSWX, 0x7C00042A) \
1608 /* Store String Word Immediate */ \
1609 V(stswi, STSWI, 0x7C0005AA) \
1610 /* Store String Word Indexed */ \
1611 V(stswx, STSWX, 0x7C00052A) \
1612 /* Clear BHRB */ \
1613 V(clrbhrb, CLRBHRB, 0x7C00035C) \
1614 /* Enforce In-order Execution of I/O */ \
1615 V(eieio, EIEIO, 0x7C0006AC) \
1616 /* Load Byte and Zero Caching Inhibited Indexed */ \
1617 V(lbzcix, LBZCIX, 0x7C0006AA) \
1618 /* Load Doubleword Caching Inhibited Indexed */ \
1619 V(ldcix, LDCIX, 0x7C0006EA) \
1620 /* Load Halfword and Zero Caching Inhibited Indexed */ \
1621 V(lhzcix, LHZCIX, 0x7C00066A) \
1622 /* Load Word and Zero Caching Inhibited Indexed */ \
1623 V(lwzcix, LWZCIX, 0x7C00062A) \
1624 /* Move From Segment Register */ \
1625 V(mfsr, MFSR, 0x7C0004A6) \
1626 /* Move From Segment Register Indirect */ \
1627 V(mfsrin, MFSRIN, 0x7C000526) \
1628 /* Move To Machine State Register Doubleword */ \
1629 V(mtmsrd, MTMSRD, 0x7C000164) \
1630 /* Move To Split Little Endian */ \
1631 V(mtsle, MTSLE, 0x7C000126) \
1632 /* Move To Segment Register */ \
1633 V(mtsr, MTSR, 0x7C0001A4) \
1634 /* Move To Segment Register Indirect */ \
1635 V(mtsrin, MTSRIN, 0x7C0001E4) \
1636 /* SLB Find Entry ESID */ \
1637 V(slbfee, SLBFEE, 0x7C0007A7) \
1638 /* SLB Invalidate All */ \
1639 V(slbia, SLBIA, 0x7C0003E4) \
1640 /* SLB Invalidate Entry */ \
1641 V(slbie, SLBIE, 0x7C000364) \
1642 /* SLB Move From Entry ESID */ \
1643 V(slbmfee, SLBMFEE, 0x7C000726) \
1644 /* SLB Move From Entry VSID */ \
1645 V(slbmfev, SLBMFEV, 0x7C0006A6) \
1646 /* SLB Move To Entry */ \
1647 V(slbmte, SLBMTE, 0x7C000324) \
1648 /* Store Byte Caching Inhibited Indexed */ \
1649 V(stbcix, STBCIX, 0x7C0007AA) \
1650 /* Store Doubleword Caching Inhibited Indexed */ \
1651 V(stdcix, STDCIX, 0x7C0007EA) \
1652 /* Store Halfword and Zero Caching Inhibited Indexed */ \
1653 V(sthcix, STHCIX, 0x7C00076A) \
1654 /* Store Word and Zero Caching Inhibited Indexed */ \
1655 V(stwcix, STWCIX, 0x7C00072A) \
1656 /* TLB Invalidate All */ \
1657 V(tlbia, TLBIA, 0x7C0002E4) \
1658 /* TLB Invalidate Entry */ \
1659 V(tlbie, TLBIE, 0x7C000264) \
1660 /* TLB Invalidate Entry Local */ \
1661 V(tlbiel, TLBIEL, 0x7C000224) \
1662 /* Message Clear Privileged */ \
1663 V(msgclrp, MSGCLRP, 0x7C00015C) \
1664 /* Message Send Privileged */ \
1665 V(msgsndp, MSGSNDP, 0x7C00011C) \
1666 /* Message Clear */ \
1667 V(msgclr, MSGCLR, 0x7C0001DC) \
1668 /* Message Send */ \
1669 V(msgsnd, MSGSND, 0x7C00019C) \
1670 /* Move From Machine State Register */ \
1671 V(mfmsr, MFMSR, 0x7C0000A6) \
1672 /* Move To Machine State Register */ \
1673 V(mtmsr, MTMSR, 0x7C000124) \
1674 /* TLB Synchronize */ \
1675 V(tlbsync, TLBSYNC, 0x7C00046C) \
1676 /* Transaction Abort */ \
1677 V(tabort, TABORT, 0x7C00071D) \
1678 /* Transaction Abort Doubleword Conditional */ \
1679 V(tabortdc, TABORTDC, 0x7C00065D) \
1680 /* Transaction Abort Doubleword Conditional Immediate */ \
1681 V(tabortdci, TABORTDCI, 0x7C0006DD) \
1682 /* Transaction Abort Word Conditional */ \
1683 V(tabortwc, TABORTWC, 0x7C00061D) \
1684 /* Transaction Abort Word Conditional Immediate */ \
1685 V(tabortwci, TABORTWCI, 0x7C00069D) \
1686 /* Transaction Begin */ \
1687 V(tbegin, TBEGIN, 0x7C00051D) \
1688 /* Transaction Check */ \
1689 V(tcheck, TCHECK, 0x7C00059C) \
1690 /* Transaction End */ \
1691 V(tend, TEND, 0x7C00055C) \
1692 /* Transaction Recheckpoint */ \
1693 V(trechkpt, TRECHKPT, 0x7C0007DD) \
1694 /* Transaction Reclaim */ \
1695 V(treclaim, TRECLAIM, 0x7C00075D) \
1696 /* Transaction Suspend or Resume */ \
1697 V(tsr, TSR, 0x7C0005DC) \
1698 /* Load Vector Element Byte Indexed */ \
1699 V(lvebx, LVEBX, 0x7C00000E) \
1700 /* Load Vector Element Halfword Indexed */ \
1701 V(lvehx, LVEHX, 0x7C00004E) \
1702 /* Load Vector Element Word Indexed */ \
1703 V(lvewx, LVEWX, 0x7C00008E) \
1704 /* Load Vector for Shift Left */ \
1705 V(lvsl, LVSL, 0x7C00000C) \
1706 /* Load Vector for Shift Right */ \
1707 V(lvsr, LVSR, 0x7C00004C) \
1708 /* Load Vector Indexed Last */ \
1709 V(lvxl, LVXL, 0x7C0002CE) \
1710 /* Store Vector Element Byte Indexed */ \
1711 V(stvebx, STVEBX, 0x7C00010E) \
1712 /* Store Vector Element Halfword Indexed */ \
1713 V(stvehx, STVEHX, 0x7C00014E) \
1714 /* Store Vector Element Word Indexed */ \
1715 V(stvewx, STVEWX, 0x7C00018E) \
1716 /* Store Vector Indexed Last */ \
1717 V(stvxl, STVXL, 0x7C0003CE) \
1718 /* Floating Merge Even Word */ \
1719 V(fmrgew, FMRGEW, 0xFC00078C) \
1720 /* Floating Merge Odd Word */ \
1721 V(fmrgow, FMRGOW, 0xFC00068C) \
1722 /* Wait for Interrupt */ \
1723 V(wait, WAIT, 0x7C00007C)
1724
1725 #define PPC_X_OPCODE_LIST(V) \
1726 PPC_X_OPCODE_A_FORM_LIST(V) \
1727 PPC_X_OPCODE_B_FORM_LIST(V) \
1728 PPC_X_OPCODE_C_FORM_LIST(V) \
1729 PPC_X_OPCODE_D_FORM_LIST(V) \
1730 PPC_X_OPCODE_E_FORM_LIST(V) \
1731 PPC_X_OPCODE_F_FORM_LIST(V) \
1732 PPC_X_OPCODE_EH_L_FORM_LIST(V) \
1733 PPC_X_OPCODE_UNUSED_LIST(V)
1734
1735 #define PPC_EVS_OPCODE_LIST(V) \
1736 /* Vector Select */ \
1737 V(evsel, EVSEL, 0x10000278)
1738
1739 #define PPC_DS_OPCODE_LIST(V) \
1740 /* Load Doubleword */ \
1741 V(ld, LD, 0xE8000000) \
1742 /* Load Doubleword with Update */ \
1743 V(ldu, LDU, 0xE8000001) \
1744 /* Load Word Algebraic */ \
1745 V(lwa, LWA, 0xE8000002) \
1746 /* Store Doubleword */ \
1747 V(std, STD, 0xF8000000) \
1748 /* Store Doubleword with Update */ \
1749 V(stdu, STDU, 0xF8000001) \
1750 /* Load Floating-Point Double Pair */ \
1751 V(lfdp, LFDP, 0xE4000000) \
1752 /* Store Floating-Point Double Pair */ \
1753 V(stfdp, STFDP, 0xF4000000) \
1754 /* Store Quadword */ \
1755 V(stq, STQ, 0xF8000002)
1756
1757 #define PPC_DQ_OPCODE_LIST(V) V(lsq, LSQ, 0xE0000000)
1758
1759 #define PPC_D_OPCODE_LIST(V) \
1760 /* Trap Doubleword Immediate */ \
1761 V(tdi, TDI, 0x08000000) \
1762 /* Add Immediate */ \
1763 V(addi, ADDI, 0x38000000) \
1764 /* Add Immediate Carrying */ \
1765 V(addic, ADDIC, 0x30000000) \
1766 /* Add Immediate Carrying & record CR0 */ \
1767 V(addicx, ADDICx, 0x34000000) \
1768 /* Add Immediate Shifted */ \
1769 V(addis, ADDIS, 0x3C000000) \
1770 /* AND Immediate & record CR0 */ \
1771 V(andix, ANDIx, 0x70000000) \
1772 /* AND Immediate Shifted & record CR0 */ \
1773 V(andisx, ANDISx, 0x74000000) \
1774 /* Compare Immediate */ \
1775 V(cmpi, CMPI, 0x2C000000) \
1776 /* Compare Logical Immediate */ \
1777 V(cmpli, CMPLI, 0x28000000) \
1778 /* Load Byte and Zero */ \
1779 V(lbz, LBZ, 0x88000000) \
1780 /* Load Byte and Zero with Update */ \
1781 V(lbzu, LBZU, 0x8C000000) \
1782 /* Load Halfword Algebraic */ \
1783 V(lha, LHA, 0xA8000000) \
1784 /* Load Halfword Algebraic with Update */ \
1785 V(lhau, LHAU, 0xAC000000) \
1786 /* Load Halfword and Zero */ \
1787 V(lhz, LHZ, 0xA0000000) \
1788 /* Load Halfword and Zero with Update */ \
1789 V(lhzu, LHZU, 0xA4000000) \
1790 /* Load Multiple Word */ \
1791 V(lmw, LMW, 0xB8000000) \
1792 /* Load Word and Zero */ \
1793 V(lwz, LWZ, 0x80000000) \
1794 /* Load Word and Zero with Update */ \
1795 V(lwzu, LWZU, 0x84000000) \
1796 /* Multiply Low Immediate */ \
1797 V(mulli, MULLI, 0x1C000000) \
1798 /* OR Immediate */ \
1799 V(ori, ORI, 0x60000000) \
1800 /* OR Immediate Shifted */ \
1801 V(oris, ORIS, 0x64000000) \
1802 /* Store Byte */ \
1803 V(stb, STB, 0x98000000) \
1804 /* Store Byte with Update */ \
1805 V(stbu, STBU, 0x9C000000) \
1806 /* Store Halfword */ \
1807 V(sth, STH, 0xB0000000) \
1808 /* Store Halfword with Update */ \
1809 V(sthu, STHU, 0xB4000000) \
1810 /* Store Multiple Word */ \
1811 V(stmw, STMW, 0xBC000000) \
1812 /* Store Word */ \
1813 V(stw, STW, 0x90000000) \
1814 /* Store Word with Update */ \
1815 V(stwu, STWU, 0x94000000) \
1816 /* Subtract From Immediate Carrying */ \
1817 V(subfic, SUBFIC, 0x20000000) \
1818 /* Trap Word Immediate */ \
1819 V(twi, TWI, 0x0C000000) \
1820 /* XOR Immediate */ \
1821 V(xori, XORI, 0x68000000) \
1822 /* XOR Immediate Shifted */ \
1823 V(xoris, XORIS, 0x6C000000) \
1824 /* Load Floating-Point Double */ \
1825 V(lfd, LFD, 0xC8000000) \
1826 /* Load Floating-Point Double with Update */ \
1827 V(lfdu, LFDU, 0xCC000000) \
1828 /* Load Floating-Point Single */ \
1829 V(lfs, LFS, 0xC0000000) \
1830 /* Load Floating-Point Single with Update */ \
1831 V(lfsu, LFSU, 0xC4000000) \
1832 /* Store Floating-Point Double */ \
1833 V(stfd, STFD, 0xD8000000) \
1834 /* Store Floating-Point Double with Update */ \
1835 V(stfdu, STFDU, 0xDC000000) \
1836 /* Store Floating-Point Single */ \
1837 V(stfs, STFS, 0xD0000000) \
1838 /* Store Floating-Point Single with Update */ \
1839 V(stfsu, STFSU, 0xD4000000)
1840
1841 #define PPC_XFL_OPCODE_LIST(V) \
1842 /* Move To FPSCR Fields */ \
1843 V(mtfsf, MTFSF, 0xFC00058E)
1844
1845 #define PPC_XFX_OPCODE_LIST(V) \
1846 /* Move From Condition Register */ \
1847 V(mfcr, MFCR, 0x7C000026) \
1848 /* Move From One Condition Register Field */ \
1849 V(mfocrf, MFOCRF, 0x7C100026) \
1850 /* Move From Special Purpose Register */ \
1851 V(mfspr, MFSPR, 0x7C0002A6) \
1852 /* Move To Condition Register Fields */ \
1853 V(mtcrf, MTCRF, 0x7C000120) \
1854 /* Move To One Condition Register Field */ \
1855 V(mtocrf, MTOCRF, 0x7C100120) \
1856 /* Move To Special Purpose Register */ \
1857 V(mtspr, MTSPR, 0x7C0003A6) \
1858 /* Debugger Notify Halt */ \
1859 V(dnh, DNH, 0x4C00018C) \
1860 /* Move From Device Control Register */ \
1861 V(mfdcr, MFDCR, 0x7C000286) \
1862 /* Move To Device Control Register */ \
1863 V(mtdcr, MTDCR, 0x7C000386) \
1864 /* Move from Performance Monitor Register */ \
1865 V(mfpmr, MFPMR, 0x7C00029C) \
1866 /* Move To Performance Monitor Register */ \
1867 V(mtpmr, MTPMR, 0x7C00039C) \
1868 /* Move From Branch History Rolling Buffer */ \
1869 V(mfbhrbe, MFBHRBE, 0x7C00025C) \
1870 /* Move From Time Base */ \
1871 V(mftb, MFTB, 0x7C0002E6)
1872
1873 #define PPC_MDS_OPCODE_LIST(V) \
1874 /* Rotate Left Doubleword then Clear Left */ \
1875 V(rldcl, RLDCL, 0x78000010) \
1876 /* Rotate Left Doubleword then Clear Right */ \
1877 V(rldcr, RLDCR, 0x78000012)
1878
1879 #define PPC_A_OPCODE_LIST(V) \
1880 /* Integer Select */ \
1881 V(isel, ISEL, 0x7C00001E) \
1882 /* Floating Add */ \
1883 V(fadd, FADD, 0xFC00002A) \
1884 /* Floating Add Single */ \
1885 V(fadds, FADDS, 0xEC00002A) \
1886 /* Floating Divide */ \
1887 V(fdiv, FDIV, 0xFC000024) \
1888 /* Floating Divide Single */ \
1889 V(fdivs, FDIVS, 0xEC000024) \
1890 /* Floating Multiply-Add */ \
1891 V(fmadd, FMADD, 0xFC00003A) \
1892 /* Floating Multiply-Add Single */ \
1893 V(fmadds, FMADDS, 0xEC00003A) \
1894 /* Floating Multiply-Subtract */ \
1895 V(fmsub, FMSUB, 0xFC000038) \
1896 /* Floating Multiply-Subtract Single */ \
1897 V(fmsubs, FMSUBS, 0xEC000038) \
1898 /* Floating Multiply */ \
1899 V(fmul, FMUL, 0xFC000032) \
1900 /* Floating Multiply Single */ \
1901 V(fmuls, FMULS, 0xEC000032) \
1902 /* Floating Negative Multiply-Add */ \
1903 V(fnmadd, FNMADD, 0xFC00003E) \
1904 /* Floating Negative Multiply-Add Single */ \
1905 V(fnmadds, FNMADDS, 0xEC00003E) \
1906 /* Floating Negative Multiply-Subtract */ \
1907 V(fnmsub, FNMSUB, 0xFC00003C) \
1908 /* Floating Negative Multiply-Subtract Single */ \
1909 V(fnmsubs, FNMSUBS, 0xEC00003C) \
1910 /* Floating Reciprocal Estimate Single */ \
1911 V(fres, FRES, 0xEC000030) \
1912 /* Floating Reciprocal Square Root Estimate */ \
1913 V(frsqrte, FRSQRTE, 0xFC000034) \
1914 /* Floating Select */ \
1915 V(fsel, FSEL, 0xFC00002E) \
1916 /* Floating Square Root */ \
1917 V(fsqrt, FSQRT, 0xFC00002C) \
1918 /* Floating Square Root Single */ \
1919 V(fsqrts, FSQRTS, 0xEC00002C) \
1920 /* Floating Subtract */ \
1921 V(fsub, FSUB, 0xFC000028) \
1922 /* Floating Subtract Single */ \
1923 V(fsubs, FSUBS, 0xEC000028) \
1924 /* Floating Reciprocal Estimate */ \
1925 V(fre, FRE, 0xFC000030) \
1926 /* Floating Reciprocal Square Root Estimate Single */ \
1927 V(frsqrtes, FRSQRTES, 0xEC000034)
1928
1929 #define PPC_VA_OPCODE_A_FORM_LIST(V) \
1930 /* Vector Permute */ \
1931 V(vperm, VPERM, 0x1000002B) \
1932 /* Vector Multiply-Low-Add Unsigned Halfword Modulo */ \
1933 V(vmladduhm, VMLADDUHM, 0x10000022) \
1934 /* Vector Select */ \
1935 V(vsel, VSEL, 0x1000002A) \
1936 /* Vector Multiply-Sum Signed Halfword Modulo */ \
1937 V(vmsumshm, VMSUMSHM, 0x10000028)
1938
1939 #define PPC_VA_OPCODE_UNUSED_LIST(V) \
1940 /* Vector Add Extended & write Carry Unsigned Quadword */ \
1941 V(vaddecuq, VADDECUQ, 0x1000003D) \
1942 /* Vector Add Extended Unsigned Quadword Modulo */ \
1943 V(vaddeuqm, VADDEUQM, 0x1000003C) \
1944 /* Vector Multiply-Add Single-Precision */ \
1945 V(vmaddfp, VMADDFP, 0x1000002E) \
1946 /* Vector Multiply-High-Add Signed Halfword Saturate */ \
1947 V(vmhaddshs, VMHADDSHS, 0x10000020) \
1948 /* Vector Multiply-High-Round-Add Signed Halfword Saturate */ \
1949 V(vmhraddshs, VMHRADDSHS, 0x10000021) \
1950 /* Vector Multiply-Sum Mixed Byte Modulo */ \
1951 V(vmsummbm, VMSUMMBM, 0x10000025) \
1952 /* Vector Multiply-Sum Signed Halfword Saturate */ \
1953 V(vmsumshs, VMSUMSHS, 0x10000029) \
1954 /* Vector Multiply-Sum Unsigned Byte Modulo */ \
1955 V(vmsumubm, VMSUMUBM, 0x10000024) \
1956 /* Vector Multiply-Sum Unsigned Halfword Modulo */ \
1957 V(vmsumuhm, VMSUMUHM, 0x10000026) \
1958 /* Vector Multiply-Sum Unsigned Halfword Saturate */ \
1959 V(vmsumuhs, VMSUMUHS, 0x10000027) \
1960 /* Vector Negative Multiply-Subtract Single-Precision */ \
1961 V(vnmsubfp, VNMSUBFP, 0x1000002F) \
1962 /* Vector Shift Left Double by Octet Immediate */ \
1963 V(vsldoi, VSLDOI, 0x1000002C) \
1964 /* Vector Subtract Extended & write Carry Unsigned Quadword */ \
1965 V(vsubecuq, VSUBECUQ, 0x1000003F) \
1966 /* Vector Subtract Extended Unsigned Quadword Modulo */ \
1967 V(vsubeuqm, VSUBEUQM, 0x1000003E) \
1968 /* Vector Permute and Exclusive-OR */ \
1969 V(vpermxor, VPERMXOR, 0x1000002D)
1970
1971 #define PPC_VA_OPCODE_LIST(V) \
1972 PPC_VA_OPCODE_A_FORM_LIST(V) \
1973 PPC_VA_OPCODE_UNUSED_LIST(V)
1974
1975 #define PPC_XX1_OPCODE_LIST(V) \
1976 /* Load VSR Scalar Doubleword Indexed */ \
1977 V(lxsdx, LXSDX, 0x7C000498) \
1978 /* Load VSX Scalar as Integer Word Algebraic Indexed */ \
1979 V(lxsiwax, LXSIWAX, 0x7C000098) \
1980 /* Load VSX Scalar as Integer Word and Zero Indexed */ \
1981 V(lxsiwzx, LXSIWZX, 0x7C000018) \
1982 /* Load VSX Scalar Single-Precision Indexed */ \
1983 V(lxsspx, LXSSPX, 0x7C000418) \
1984 /* Load VSR Vector Doubleword*2 Indexed */ \
1985 V(lxvd, LXVD, 0x7C000698) \
1986 /* Load VSR Vector Doubleword & Splat Indexed */ \
1987 V(lxvdsx, LXVDSX, 0x7C000298) \
1988 /* Load VSR Vector Word*4 Indexed */ \
1989 V(lxvw, LXVW, 0x7C000618) \
1990 /* Move From VSR Doubleword */ \
1991 V(mfvsrd, MFVSRD, 0x7C000066) \
1992 /* Move From VSR Word and Zero */ \
1993 V(mfvsrwz, MFVSRWZ, 0x7C0000E6) \
1994 /* Store VSR Scalar Doubleword Indexed */ \
1995 V(stxsdx, STXSDX, 0x7C000598) \
1996 /* Store VSX Scalar as Integer Word Indexed */ \
1997 V(stxsiwx, STXSIWX, 0x7C000118) \
1998 /* Store VSR Scalar Word Indexed */ \
1999 V(stxsspx, STXSSPX, 0x7C000518) \
2000 /* Store VSR Vector Doubleword*2 Indexed */ \
2001 V(stxvd, STXVD, 0x7C000798) \
2002 /* Store VSR Vector Word*4 Indexed */ \
2003 V(stxvw, STXVW, 0x7C000718) \
2004 /* Vector Splat Immediate Byte */ \
2005 V(xxspltib, XXSPLTIB, 0xF00002D1)
2006
2007 #define PPC_B_OPCODE_LIST(V) \
2008 /* Branch Conditional */ \
2009 V(bc, BCX, 0x40000000)
2010
2011 #define PPC_XO_OPCODE_LIST(V) \
2012 /* Divide Doubleword */ \
2013 V(divd, DIVD, 0x7C0003D2) \
2014 /* Divide Doubleword Extended */ \
2015 V(divde, DIVDE, 0x7C000352) \
2016 /* Divide Doubleword Extended & record OV */ \
2017 V(divdeo, DIVDEO, 0x7C000752) \
2018 /* Divide Doubleword Extended Unsigned */ \
2019 V(divdeu, DIVDEU, 0x7C000312) \
2020 /* Divide Doubleword Extended Unsigned & record OV */ \
2021 V(divdeuo, DIVDEUO, 0x7C000712) \
2022 /* Divide Doubleword & record OV */ \
2023 V(divdo, DIVDO, 0x7C0007D2) \
2024 /* Divide Doubleword Unsigned */ \
2025 V(divdu, DIVDU, 0x7C000392) \
2026 /* Divide Doubleword Unsigned & record OV */ \
2027 V(divduo, DIVDUO, 0x7C000792) \
2028 /* Multiply High Doubleword */ \
2029 V(mulhd, MULHD, 0x7C000092) \
2030 /* Multiply High Doubleword Unsigned */ \
2031 V(mulhdu, MULHDU, 0x7C000012) \
2032 /* Multiply Low Doubleword */ \
2033 V(mulld, MULLD, 0x7C0001D2) \
2034 /* Multiply Low Doubleword & record OV */ \
2035 V(mulldo, MULLDO, 0x7C0005D2) \
2036 /* Add */ \
2037 V(add, ADDX, 0x7C000214) \
2038 /* Add Carrying */ \
2039 V(addc, ADDCX, 0x7C000014) \
2040 /* Add Carrying & record OV */ \
2041 V(addco, ADDCO, 0x7C000414) \
2042 /* Add Extended */ \
2043 V(adde, ADDEX, 0x7C000114) \
2044 /* Add Extended & record OV & record OV */ \
2045 V(addeo, ADDEO, 0x7C000514) \
2046 /* Add to Minus One Extended */ \
2047 V(addme, ADDME, 0x7C0001D4) \
2048 /* Add to Minus One Extended & record OV */ \
2049 V(addmeo, ADDMEO, 0x7C0005D4) \
2050 /* Add & record OV */ \
2051 V(addo, ADDO, 0x7C000614) \
2052 /* Add to Zero Extended */ \
2053 V(addze, ADDZEX, 0x7C000194) \
2054 /* Add to Zero Extended & record OV */ \
2055 V(addzeo, ADDZEO, 0x7C000594) \
2056 /* Divide Word Format */ \
2057 V(divw, DIVW, 0x7C0003D6) \
2058 /* Divide Word Extended */ \
2059 V(divwe, DIVWE, 0x7C000356) \
2060 /* Divide Word Extended & record OV */ \
2061 V(divweo, DIVWEO, 0x7C000756) \
2062 /* Divide Word Extended Unsigned */ \
2063 V(divweu, DIVWEU, 0x7C000316) \
2064 /* Divide Word Extended Unsigned & record OV */ \
2065 V(divweuo, DIVWEUO, 0x7C000716) \
2066 /* Divide Word & record OV */ \
2067 V(divwo, DIVWO, 0x7C0007D6) \
2068 /* Divide Word Unsigned */ \
2069 V(divwu, DIVWU, 0x7C000396) \
2070 /* Divide Word Unsigned & record OV */ \
2071 V(divwuo, DIVWUO, 0x7C000796) \
2072 /* Multiply High Word */ \
2073 V(mulhw, MULHWX, 0x7C000096) \
2074 /* Multiply High Word Unsigned */ \
2075 V(mulhwu, MULHWUX, 0x7C000016) \
2076 /* Multiply Low Word */ \
2077 V(mullw, MULLW, 0x7C0001D6) \
2078 /* Multiply Low Word & record OV */ \
2079 V(mullwo, MULLWO, 0x7C0005D6) \
2080 /* Negate */ \
2081 V(neg, NEGX, 0x7C0000D0) \
2082 /* Negate & record OV */ \
2083 V(nego, NEGO, 0x7C0004D0) \
2084 /* Subtract From */ \
2085 V(subf, SUBFX, 0x7C000050) \
2086 /* Subtract From Carrying */ \
2087 V(subfc, SUBFCX, 0x7C000010) \
2088 /* Subtract From Carrying & record OV */ \
2089 V(subfco, SUBFCO, 0x7C000410) \
2090 /* Subtract From Extended */ \
2091 V(subfe, SUBFEX, 0x7C000110) \
2092 /* Subtract From Extended & record OV */ \
2093 V(subfeo, SUBFEO, 0x7C000510) \
2094 /* Subtract From Minus One Extended */ \
2095 V(subfme, SUBFME, 0x7C0001D0) \
2096 /* Subtract From Minus One Extended & record OV */ \
2097 V(subfmeo, SUBFMEO, 0x7C0005D0) \
2098 /* Subtract From & record OV */ \
2099 V(subfo, SUBFO, 0x7C000450) \
2100 /* Subtract From Zero Extended */ \
2101 V(subfze, SUBFZE, 0x7C000190) \
2102 /* Subtract From Zero Extended & record OV */ \
2103 V(subfzeo, SUBFZEO, 0x7C000590) \
2104 /* Add and Generate Sixes */ \
2105 V(addg, ADDG, 0x7C000094) \
2106 /* Multiply Accumulate Cross Halfword to Word Modulo Signed */ \
2107 V(macchw, MACCHW, 0x10000158) \
2108 /* Multiply Accumulate Cross Halfword to Word Saturate Signed */ \
2109 V(macchws, MACCHWS, 0x100001D8) \
2110 /* Multiply Accumulate Cross Halfword to Word Saturate Unsigned */ \
2111 V(macchwsu, MACCHWSU, 0x10000198) \
2112 /* Multiply Accumulate Cross Halfword to Word Modulo Unsigned */ \
2113 V(macchwu, MACCHWU, 0x10000118) \
2114 /* Multiply Accumulate High Halfword to Word Modulo Signed */ \
2115 V(machhw, MACHHW, 0x10000058) \
2116 /* Multiply Accumulate High Halfword to Word Saturate Signed */ \
2117 V(machhws, MACHHWS, 0x100000D8) \
2118 /* Multiply Accumulate High Halfword to Word Saturate Unsigned */ \
2119 V(machhwsu, MACHHWSU, 0x10000098) \
2120 /* Multiply Accumulate High Halfword to Word Modulo Unsigned */ \
2121 V(machhwu, MACHHWU, 0x10000018) \
2122 /* Multiply Accumulate Low Halfword to Word Modulo Signed */ \
2123 V(maclhw, MACLHW, 0x10000358) \
2124 /* Multiply Accumulate Low Halfword to Word Saturate Signed */ \
2125 V(maclhws, MACLHWS, 0x100003D8) \
2126 /* Multiply Accumulate Low Halfword to Word Saturate Unsigned */ \
2127 V(maclhwsu, MACLHWSU, 0x10000398) \
2128 /* Multiply Accumulate Low Halfword to Word Modulo Unsigned */ \
2129 V(maclhwu, MACLHWU, 0x10000318) \
2130 /* Negative Multiply Accumulate Cross Halfword to Word Modulo Signed */ \
2131 V(nmacchw, NMACCHW, 0x1000015C) \
2132 /* Negative Multiply Accumulate Cross Halfword to Word Saturate Signed */ \
2133 V(nmacchws, NMACCHWS, 0x100001DC) \
2134 /* Negative Multiply Accumulate High Halfword to Word Modulo Signed */ \
2135 V(nmachhw, NMACHHW, 0x1000005C) \
2136 /* Negative Multiply Accumulate High Halfword to Word Saturate Signed */ \
2137 V(nmachhws, NMACHHWS, 0x100000DC) \
2138 /* Negative Multiply Accumulate Low Halfword to Word Modulo Signed */ \
2139 V(nmaclhw, NMACLHW, 0x1000035C) \
2140 /* Negative Multiply Accumulate Low Halfword to Word Saturate Signed */ \
2141 V(nmaclhws, NMACLHWS, 0x100003DC)
2142
2143 #define PPC_XL_OPCODE_LIST(V) \
2144 /* Branch Conditional to Count Register */ \
2145 V(bcctr, BCCTRX, 0x4C000420) \
2146 /* Branch Conditional to Link Register */ \
2147 V(bclr, BCLRX, 0x4C000020) \
2148 /* Condition Register AND */ \
2149 V(crand, CRAND, 0x4C000202) \
2150 /* Condition Register AND with Complement */ \
2151 V(crandc, CRANDC, 0x4C000102) \
2152 /* Condition Register Equivalent */ \
2153 V(creqv, CREQV, 0x4C000242) \
2154 /* Condition Register NAND */ \
2155 V(crnand, CRNAND, 0x4C0001C2) \
2156 /* Condition Register NOR */ \
2157 V(crnor, CRNOR, 0x4C000042) \
2158 /* Condition Register OR */ \
2159 V(cror, CROR, 0x4C000382) \
2160 /* Condition Register OR with Complement */ \
2161 V(crorc, CRORC, 0x4C000342) \
2162 /* Condition Register XOR */ \
2163 V(crxor, CRXOR, 0x4C000182) \
2164 /* Instruction Synchronize */ \
2165 V(isync, ISYNC, 0x4C00012C) \
2166 /* Move Condition Register Field */ \
2167 V(mcrf, MCRF, 0x4C000000) \
2168 /* Return From Critical Interrupt */ \
2169 V(rfci, RFCI, 0x4C000066) \
2170 /* Return From Interrupt */ \
2171 V(rfi, RFI, 0x4C000064) \
2172 /* Return From Machine Check Interrupt */ \
2173 V(rfmci, RFMCI, 0x4C00004C) \
2174 /* Embedded Hypervisor Privilege */ \
2175 V(ehpriv, EHPRIV, 0x7C00021C) \
2176 /* Return From Guest Interrupt */ \
2177 V(rfgi, RFGI, 0x4C0000CC) \
2178 /* Doze */ \
2179 V(doze, DOZE, 0x4C000324) \
2180 /* Return From Interrupt Doubleword Hypervisor */ \
2181 V(hrfid, HRFID, 0x4C000224) \
2182 /* Nap */ \
2183 V(nap, NAP, 0x4C000364) \
2184 /* Return from Event Based Branch */ \
2185 V(rfebb, RFEBB, 0x4C000124) \
2186 /* Return from Interrupt Doubleword */ \
2187 V(rfid, RFID, 0x4C000024) \
2188 /* Rip Van Winkle */ \
2189 V(rvwinkle, RVWINKLE, 0x4C0003E4) \
2190 /* Sleep */ \
2191 V(sleep, SLEEP, 0x4C0003A4)
2192
2193 #define PPC_XX4_OPCODE_LIST(V) \
2194 /* VSX Select */ \
2195 V(xxsel, XXSEL, 0xF0000030)
2196
2197 #define PPC_I_OPCODE_LIST(V) \
2198 /* Branch */ \
2199 V(b, BX, 0x48000000)
2200
2201 #define PPC_M_OPCODE_LIST(V) \
2202 /* Rotate Left Word Immediate then Mask Insert */ \
2203 V(rlwimi, RLWIMIX, 0x50000000) \
2204 /* Rotate Left Word Immediate then AND with Mask */ \
2205 V(rlwinm, RLWINMX, 0x54000000) \
2206 /* Rotate Left Word then AND with Mask */ \
2207 V(rlwnm, RLWNMX, 0x5C000000)
2208
2209 #define PPC_VX_OPCODE_A_FORM_LIST(V) \
2210 /* Vector Splat Byte */ \
2211 V(vspltb, VSPLTB, 0x1000020C) \
2212 /* Vector Splat Word */ \
2213 V(vspltw, VSPLTW, 0x1000028C) \
2214 /* Vector Splat Halfword */ \
2215 V(vsplth, VSPLTH, 0x1000024C) \
2216 /* Vector Extract Unsigned Byte */ \
2217 V(vextractub, VEXTRACTUB, 0x1000020D) \
2218 /* Vector Extract Unsigned Halfword */ \
2219 V(vextractuh, VEXTRACTUH, 0x1000024D) \
2220 /* Vector Extract Unsigned Word */ \
2221 V(vextractuw, VEXTRACTUW, 0x1000028D) \
2222 /* Vector Extract Doubleword */ \
2223 V(vextractd, VEXTRACTD, 0x100002CD) \
2224 /* Vector Insert Byte */ \
2225 V(vinsertb, VINSERTB, 0x1000030D) \
2226 /* Vector Insert Halfword */ \
2227 V(vinserth, VINSERTH, 0x1000034D) \
2228 /* Vector Insert Word */ \
2229 V(vinsertw, VINSERTW, 0x1000038D) \
2230 /* Vector Insert Doubleword */ \
2231 V(vinsertd, VINSERTD, 0x100003CD)
2232
2233 #define PPC_VX_OPCODE_B_FORM_LIST(V) \
2234 /* Vector Logical OR */ \
2235 V(vor, VOR, 0x10000484) \
2236 /* Vector Logical XOR */ \
2237 V(vxor, VXOR, 0x100004C4) \
2238 /* Vector Logical NOR */ \
2239 V(vnor, VNOR, 0x10000504) \
2240 /* Vector Shift Right by Octet */ \
2241 V(vsro, VSRO, 0x1000044C) \
2242 /* Vector Shift Left by Octet */ \
2243 V(vslo, VSLO, 0x1000040C) \
2244 /* Vector Add Unsigned Doubleword Modulo */ \
2245 V(vaddudm, VADDUDM, 0x100000C0) \
2246 /* Vector Add Unsigned Word Modulo */ \
2247 V(vadduwm, VADDUWM, 0x10000080) \
2248 /* Vector Add Unsigned Halfword Modulo */ \
2249 V(vadduhm, VADDUHM, 0x10000040) \
2250 /* Vector Add Unsigned Byte Modulo */ \
2251 V(vaddubm, VADDUBM, 0x10000000) \
2252 /* Vector Add Single-Precision */ \
2253 V(vaddfp, VADDFP, 0x1000000A) \
2254 /* Vector Subtract Single-Precision */ \
2255 V(vsubfp, VSUBFP, 0x1000004A) \
2256 /* Vector Subtract Unsigned Doubleword Modulo */ \
2257 V(vsubudm, VSUBUDM, 0x100004C0) \
2258 /* Vector Subtract Unsigned Word Modulo */ \
2259 V(vsubuwm, VSUBUWM, 0x10000480) \
2260 /* Vector Subtract Unsigned Halfword Modulo */ \
2261 V(vsubuhm, VSUBUHM, 0x10000440) \
2262 /* Vector Subtract Unsigned Byte Modulo */ \
2263 V(vsububm, VSUBUBM, 0x10000400) \
2264 /* Vector Multiply Unsigned Word Modulo */ \
2265 V(vmuluwm, VMULUWM, 0x10000089) \
2266 /* Vector Pack Unsigned Halfword Unsigned Modulo */ \
2267 V(vpkuhum, VPKUHUM, 0x1000000E) \
2268 /* Vector Multiply Even Unsigned Byte */ \
2269 V(vmuleub, VMULEUB, 0x10000208) \
2270 /* Vector Multiply Odd Unsigned Byte */ \
2271 V(vmuloub, VMULOUB, 0x10000008) \
2272 /* Vector Sum across Quarter Signed Halfword Saturate */ \
2273 V(vsum4shs, VSUM4SHS, 0x10000648) \
2274 /* Vector Pack Unsigned Word Unsigned Saturate */ \
2275 V(vpkuwus, VPKUWUS, 0x100000CE) \
2276 /* Vector Sum across Half Signed Word Saturate */ \
2277 V(vsum2sws, VSUM2SWS, 0x10000688) \
2278 /* Vector Pack Unsigned Doubleword Unsigned Modulo */ \
2279 V(vpkudum, VPKUDUM, 0x1000044E) \
2280 /* Vector Maximum Signed Byte */ \
2281 V(vmaxsb, VMAXSB, 0x10000102) \
2282 /* Vector Maximum Unsigned Byte */ \
2283 V(vmaxub, VMAXUB, 0x10000002) \
2284 /* Vector Maximum Signed Doubleword */ \
2285 V(vmaxsd, VMAXSD, 0x100001C2) \
2286 /* Vector Maximum Unsigned Doubleword */ \
2287 V(vmaxud, VMAXUD, 0x100000C2) \
2288 /* Vector Maximum Signed Halfword */ \
2289 V(vmaxsh, VMAXSH, 0x10000142) \
2290 /* Vector Maximum Unsigned Halfword */ \
2291 V(vmaxuh, VMAXUH, 0x10000042) \
2292 /* Vector Maximum Signed Word */ \
2293 V(vmaxsw, VMAXSW, 0x10000182) \
2294 /* Vector Maximum Unsigned Word */ \
2295 V(vmaxuw, VMAXUW, 0x10000082) \
2296 /* Vector Minimum Signed Byte */ \
2297 V(vminsb, VMINSB, 0x10000302) \
2298 /* Vector Minimum Unsigned Byte */ \
2299 V(vminub, VMINUB, 0x10000202) \
2300 /* Vector Minimum Signed Doubleword */ \
2301 V(vminsd, VMINSD, 0x100003C2) \
2302 /* Vector Minimum Unsigned Doubleword */ \
2303 V(vminud, VMINUD, 0x100002C2) \
2304 /* Vector Minimum Signed Halfword */ \
2305 V(vminsh, VMINSH, 0x10000342) \
2306 /* Vector Minimum Unsigned Halfword */ \
2307 V(vminuh, VMINUH, 0x10000242) \
2308 /* Vector Minimum Signed Word */ \
2309 V(vminsw, VMINSW, 0x10000382) \
2310 /* Vector Minimum Unsigned Word */ \
2311 V(vminuw, VMINUW, 0x10000282) \
2312 /* Vector Shift Left Byte */ \
2313 V(vslb, VSLB, 0x10000104) \
2314 /* Vector Shift Left Word */ \
2315 V(vslw, VSLW, 0x10000184) \
2316 /* Vector Shift Left Halfword */ \
2317 V(vslh, VSLH, 0x10000144) \
2318 /* Vector Shift Left Doubleword */ \
2319 V(vsld, VSLD, 0x100005C4) \
2320 /* Vector Shift Right Byte */ \
2321 V(vsrb, VSRB, 0x10000204) \
2322 /* Vector Shift Right Word */ \
2323 V(vsrw, VSRW, 0x10000284) \
2324 /* Vector Shift Right Halfword */ \
2325 V(vsrh, VSRH, 0x10000244) \
2326 /* Vector Shift Right Doubleword */ \
2327 V(vsrd, VSRD, 0x100006C4) \
2328 /* Vector Shift Right Algebraic Byte */ \
2329 V(vsrab, VSRAB, 0x10000304) \
2330 /* Vector Shift Right Algebraic Word */ \
2331 V(vsraw, VSRAW, 0x10000384) \
2332 /* Vector Shift Right Algebraic Halfword */ \
2333 V(vsrah, VSRAH, 0x10000344) \
2334 /* Vector Shift Right Algebraic Doubleword */ \
2335 V(vsrad, VSRAD, 0x100003C4) \
2336 /* Vector Logical AND */ \
2337 V(vand, VAND, 0x10000404) \
2338 /* Vector Pack Signed Word Signed Saturate */ \
2339 V(vpkswss, VPKSWSS, 0x100001CE) \
2340 /* Vector Pack Signed Word Unsigned Saturate */ \
2341 V(vpkswus, VPKSWUS, 0x1000014E) \
2342 /* Vector Pack Signed Halfword Signed Saturate */ \
2343 V(vpkshss, VPKSHSS, 0x1000018E) \
2344 /* Vector Pack Signed Halfword Unsigned Saturate */ \
2345 V(vpkshus, VPKSHUS, 0x1000010E) \
2346 /* Vector Add Signed Halfword Saturate */ \
2347 V(vaddshs, VADDSHS, 0x10000340) \
2348 /* Vector Subtract Signed Halfword Saturate */ \
2349 V(vsubshs, VSUBSHS, 0x10000740) \
2350 /* Vector Add Unsigned Halfword Saturate */ \
2351 V(vadduhs, VADDUHS, 0x10000240) \
2352 /* Vector Subtract Unsigned Halfword Saturate */ \
2353 V(vsubuhs, VSUBUHS, 0x10000640) \
2354 /* Vector Add Signed Byte Saturate */ \
2355 V(vaddsbs, VADDSBS, 0x10000300) \
2356 /* Vector Subtract Signed Byte Saturate */ \
2357 V(vsubsbs, VSUBSBS, 0x10000700) \
2358 /* Vector Add Unsigned Byte Saturate */ \
2359 V(vaddubs, VADDUBS, 0x10000200) \
2360 /* Vector Subtract Unsigned Byte Saturate */ \
2361 V(vsububs, VSUBUBS, 0x10000600) \
2362 /* Vector Average Unsigned Byte */ \
2363 V(vavgub, VAVGUB, 0x10000402) \
2364 /* Vector Average Unsigned Halfword */ \
2365 V(vavguh, VAVGUH, 0x10000442) \
2366 /* Vector Logical AND with Complement */ \
2367 V(vandc, VANDC, 0x10000444) \
2368 /* Vector Minimum Single-Precision */ \
2369 V(vminfp, VMINFP, 0x1000044A) \
2370 /* Vector Maximum Single-Precision */ \
2371 V(vmaxfp, VMAXFP, 0x1000040A) \
2372 /* Vector Bit Permute Quadword */ \
2373 V(vbpermq, VBPERMQ, 0x1000054C)
2374
2375 #define PPC_VX_OPCODE_C_FORM_LIST(V) \
2376 /* Vector Unpack Low Signed Halfword */ \
2377 V(vupklsh, VUPKLSH, 0x100002CE) \
2378 /* Vector Unpack High Signed Halfword */ \
2379 V(vupkhsh, VUPKHSH, 0x1000024E) \
2380 /* Vector Unpack Low Signed Byte */ \
2381 V(vupklsb, VUPKLSB, 0x1000028E) \
2382 /* Vector Unpack High Signed Byte */ \
2383 V(vupkhsb, VUPKHSB, 0x1000020E)
2384
2385 #define PPC_VX_OPCODE_UNUSED_LIST(V) \
2386 /* Decimal Add Modulo */ \
2387 V(bcdadd, BCDADD, 0xF0000400) \
2388 /* Decimal Subtract Modulo */ \
2389 V(bcdsub, BCDSUB, 0xF0000440) \
2390 /* Move From Vector Status and Control Register */ \
2391 V(mfvscr, MFVSCR, 0x10000604) \
2392 /* Move To Vector Status and Control Register */ \
2393 V(mtvscr, MTVSCR, 0x10000644) \
2394 /* Vector Add & write Carry Unsigned Quadword */ \
2395 V(vaddcuq, VADDCUQ, 0x10000140) \
2396 /* Vector Add and Write Carry-Out Unsigned Word */ \
2397 V(vaddcuw, VADDCUW, 0x10000180) \
2398 /* Vector Add Signed Word Saturate */ \
2399 V(vaddsws, VADDSWS, 0x10000380) \
2400 /* Vector Add Unsigned Quadword Modulo */ \
2401 V(vadduqm, VADDUQM, 0x10000100) \
2402 /* Vector Add Unsigned Word Saturate */ \
2403 V(vadduws, VADDUWS, 0x10000280) \
2404 /* Vector Average Signed Byte */ \
2405 V(vavgsb, VAVGSB, 0x10000502) \
2406 /* Vector Average Signed Halfword */ \
2407 V(vavgsh, VAVGSH, 0x10000542) \
2408 /* Vector Average Signed Word */ \
2409 V(vavgsw, VAVGSW, 0x10000582) \
2410 /* Vector Average Unsigned Word */ \
2411 V(vavguw, VAVGUW, 0x10000482) \
2412 /* Vector Convert From Signed Fixed-Point Word To Single-Precision */ \
2413 V(vcfsx, VCFSX, 0x1000034A) \
2414 /* Vector Convert From Unsigned Fixed-Point Word To Single-Precision */ \
2415 V(vcfux, VCFUX, 0x1000030A) \
2416 /* Vector Count Leading Zeros Byte */ \
2417 V(vclzb, VCLZB, 0x10000702) \
2418 /* Vector Count Leading Zeros Doubleword */ \
2419 V(vclzd, VCLZD, 0x100007C2) \
2420 /* Vector Count Leading Zeros Halfword */ \
2421 V(vclzh, VCLZH, 0x10000742) \
2422 /* Vector Count Leading Zeros Word */ \
2423 V(vclzw, VCLZW, 0x10000782) \
2424 /* Vector Convert From Single-Precision To Signed Fixed-Point Word */ \
2425 /* Saturate */ \
2426 V(vctsxs, VCTSXS, 0x100003CA) \
2427 /* Vector Convert From Single-Precision To Unsigned Fixed-Point Word */ \
2428 /* Saturate */ \
2429 V(vctuxs, VCTUXS, 0x1000038A) \
2430 /* Vector Equivalence */ \
2431 V(veqv, VEQV, 0x10000684) \
2432 /* Vector 2 Raised to the Exponent Estimate Single-Precision */ \
2433 V(vexptefp, VEXPTEFP, 0x1000018A) \
2434 /* Vector Gather Bits by Byte by Doubleword */ \
2435 V(vgbbd, VGBBD, 0x1000050C) \
2436 /* Vector Log Base 2 Estimate Single-Precision */ \
2437 V(vlogefp, VLOGEFP, 0x100001CA) \
2438 /* Vector Merge High Byte */ \
2439 V(vmrghb, VMRGHB, 0x1000000C) \
2440 /* Vector Merge High Halfword */ \
2441 V(vmrghh, VMRGHH, 0x1000004C) \
2442 /* Vector Merge High Word */ \
2443 V(vmrghw, VMRGHW, 0x1000008C) \
2444 /* Vector Merge Low Byte */ \
2445 V(vmrglb, VMRGLB, 0x1000010C) \
2446 /* Vector Merge Low Halfword */ \
2447 V(vmrglh, VMRGLH, 0x1000014C) \
2448 /* Vector Merge Low Word */ \
2449 V(vmrglw, VMRGLW, 0x1000018C) \
2450 /* Vector Multiply Even Signed Byte */ \
2451 V(vmulesb, VMULESB, 0x10000308) \
2452 /* Vector Multiply Even Signed Halfword */ \
2453 V(vmulesh, VMULESH, 0x10000348) \
2454 /* Vector Multiply Even Signed Word */ \
2455 V(vmulesw, VMULESW, 0x10000388) \
2456 /* Vector Multiply Even Unsigned Halfword */ \
2457 V(vmuleuh, VMULEUH, 0x10000248) \
2458 /* Vector Multiply Even Unsigned Word */ \
2459 V(vmuleuw, VMULEUW, 0x10000288) \
2460 /* Vector Multiply Odd Signed Byte */ \
2461 V(vmulosb, VMULOSB, 0x10000108) \
2462 /* Vector Multiply Odd Signed Halfword */ \
2463 V(vmulosh, VMULOSH, 0x10000148) \
2464 /* Vector Multiply Odd Signed Word */ \
2465 V(vmulosw, VMULOSW, 0x10000188) \
2466 /* Vector Multiply Odd Unsigned Halfword */ \
2467 V(vmulouh, VMULOUH, 0x10000048) \
2468 /* Vector Multiply Odd Unsigned Word */ \
2469 V(vmulouw, VMULOUW, 0x10000088) \
2470 /* Vector NAND */ \
2471 V(vnand, VNAND, 0x10000584) \
2472 /* Vector OR with Complement */ \
2473 V(vorc, VORC, 0x10000544) \
2474 /* Vector Pack Pixel */ \
2475 V(vpkpx, VPKPX, 0x1000030E) \
2476 /* Vector Pack Signed Doubleword Signed Saturate */ \
2477 V(vpksdss, VPKSDSS, 0x100005CE) \
2478 /* Vector Pack Signed Doubleword Unsigned Saturate */ \
2479 V(vpksdus, VPKSDUS, 0x1000054E) \
2480 /* Vector Pack Unsigned Doubleword Unsigned Saturate */ \
2481 V(vpkudus, VPKUDUS, 0x100004CE) \
2482 /* Vector Pack Unsigned Halfword Unsigned Saturate */ \
2483 V(vpkuhus, VPKUHUS, 0x1000008E) \
2484 /* Vector Pack Unsigned Word Unsigned Modulo */ \
2485 V(vpkuwum, VPKUWUM, 0x1000004E) \
2486 /* Vector Polynomial Multiply-Sum Byte */ \
2487 V(vpmsumb, VPMSUMB, 0x10000408) \
2488 /* Vector Polynomial Multiply-Sum Doubleword */ \
2489 V(vpmsumd, VPMSUMD, 0x100004C8) \
2490 /* Vector Polynomial Multiply-Sum Halfword */ \
2491 V(vpmsumh, VPMSUMH, 0x10000448) \
2492 /* Vector Polynomial Multiply-Sum Word */ \
2493 V(vpmsumw, VPMSUMW, 0x10000488) \
2494 /* Vector Population Count Byte */ \
2495 V(vpopcntb, VPOPCNTB, 0x10000703) \
2496 /* Vector Population Count Doubleword */ \
2497 V(vpopcntd, VPOPCNTD, 0x100007C3) \
2498 /* Vector Population Count Halfword */ \
2499 V(vpopcnth, VPOPCNTH, 0x10000743) \
2500 /* Vector Population Count Word */ \
2501 V(vpopcntw, VPOPCNTW, 0x10000783) \
2502 /* Vector Reciprocal Estimate Single-Precision */ \
2503 V(vrefp, VREFP, 0x1000010A) \
2504 /* Vector Round to Single-Precision Integer toward -Infinity */ \
2505 V(vrfim, VRFIM, 0x100002CA) \
2506 /* Vector Round to Single-Precision Integer Nearest */ \
2507 V(vrfin, VRFIN, 0x1000020A) \
2508 /* Vector Round to Single-Precision Integer toward +Infinity */ \
2509 V(vrfip, VRFIP, 0x1000028A) \
2510 /* Vector Round to Single-Precision Integer toward Zero */ \
2511 V(vrfiz, VRFIZ, 0x1000024A) \
2512 /* Vector Rotate Left Byte */ \
2513 V(vrlb, VRLB, 0x10000004) \
2514 /* Vector Rotate Left Doubleword */ \
2515 V(vrld, VRLD, 0x100000C4) \
2516 /* Vector Rotate Left Halfword */ \
2517 V(vrlh, VRLH, 0x10000044) \
2518 /* Vector Rotate Left Word */ \
2519 V(vrlw, VRLW, 0x10000084) \
2520 /* Vector Reciprocal Square Root Estimate Single-Precision */ \
2521 V(vrsqrtefp, VRSQRTEFP, 0x1000014A) \
2522 /* Vector Shift Left */ \
2523 V(vsl, VSL, 0x100001C4) \
2524 /* Vector Splat Immediate Signed Byte */ \
2525 V(vspltisb, VSPLTISB, 0x1000030C) \
2526 /* Vector Splat Immediate Signed Halfword */ \
2527 V(vspltish, VSPLTISH, 0x1000034C) \
2528 /* Vector Splat Immediate Signed Word */ \
2529 V(vspltisw, VSPLTISW, 0x1000038C) \
2530 /* Vector Shift Right */ \
2531 V(vsr, VSR, 0x100002C4) \
2532 /* Vector Subtract & write Carry Unsigned Quadword */ \
2533 V(vsubcuq, VSUBCUQ, 0x10000540) \
2534 /* Vector Subtract and Write Carry-Out Unsigned Word */ \
2535 V(vsubcuw, VSUBCUW, 0x10000580) \
2536 /* Vector Subtract Signed Word Saturate */ \
2537 V(vsubsws, VSUBSWS, 0x10000780) \
2538 /* Vector Subtract Unsigned Quadword Modulo */ \
2539 V(vsubuqm, VSUBUQM, 0x10000500) \
2540 /* Vector Subtract Unsigned Word Saturate */ \
2541 V(vsubuws, VSUBUWS, 0x10000680) \
2542 /* Vector Sum across Quarter Signed Byte Saturate */ \
2543 V(vsum4sbs, VSUM4SBS, 0x10000708) \
2544 /* Vector Sum across Quarter Unsigned Byte Saturate */ \
2545 V(vsum4bus, VSUM4BUS, 0x10000608) \
2546 /* Vector Sum across Signed Word Saturate */ \
2547 V(vsumsws, VSUMSWS, 0x10000788) \
2548 /* Vector Unpack High Pixel */ \
2549 V(vupkhpx, VUPKHPX, 0x1000034E) \
2550 /* Vector Unpack High Signed Word */ \
2551 V(vupkhsw, VUPKHSW, 0x1000064E) \
2552 /* Vector Unpack Low Pixel */ \
2553 V(vupklpx, VUPKLPX, 0x100003CE) \
2554 /* Vector Unpack Low Signed Word */ \
2555 V(vupklsw, VUPKLSW, 0x100006CE) \
2556 /* Vector AES Cipher */ \
2557 V(vcipher, VCIPHER, 0x10000508) \
2558 /* Vector AES Cipher Last */ \
2559 V(vcipherlast, VCIPHERLAST, 0x10000509) \
2560 /* Vector AES Inverse Cipher */ \
2561 V(vncipher, VNCIPHER, 0x10000548) \
2562 /* Vector AES Inverse Cipher Last */ \
2563 V(vncipherlast, VNCIPHERLAST, 0x10000549) \
2564 /* Vector AES S-Box */ \
2565 V(vsbox, VSBOX, 0x100005C8) \
2566 /* Vector SHA-512 Sigma Doubleword */ \
2567 V(vshasigmad, VSHASIGMAD, 0x100006C2) \
2568 /* Vector SHA-256 Sigma Word */ \
2569 V(vshasigmaw, VSHASIGMAW, 0x10000682) \
2570 /* Vector Merge Even Word */ \
2571 V(vmrgew, VMRGEW, 0x1000078C) \
2572 /* Vector Merge Odd Word */ \
2573 V(vmrgow, VMRGOW, 0x1000068C)
2574
2575 #define PPC_VX_OPCODE_LIST(V) \
2576 PPC_VX_OPCODE_A_FORM_LIST(V) \
2577 PPC_VX_OPCODE_B_FORM_LIST(V) \
2578 PPC_VX_OPCODE_C_FORM_LIST(V) \
2579 PPC_VX_OPCODE_UNUSED_LIST(V)
2580
2581 #define PPC_XS_OPCODE_LIST(V) \
2582 /* Shift Right Algebraic Doubleword Immediate */ \
2583 V(sradi, SRADIX, 0x7C000674)
2584
2585 #define PPC_MD_OPCODE_LIST(V) \
2586 /* Rotate Left Doubleword Immediate then Clear */ \
2587 V(rldic, RLDIC, 0x78000008) \
2588 /* Rotate Left Doubleword Immediate then Clear Left */ \
2589 V(rldicl, RLDICL, 0x78000000) \
2590 /* Rotate Left Doubleword Immediate then Clear Right */ \
2591 V(rldicr, RLDICR, 0x78000004) \
2592 /* Rotate Left Doubleword Immediate then Mask Insert */ \
2593 V(rldimi, RLDIMI, 0x7800000C)
2594
2595 #define PPC_SC_OPCODE_LIST(V) \
2596 /* System Call */ \
2597 V(sc, SC, 0x44000002)
2598
2599 #define PPC_OPCODE_LIST(V) \
2600 PPC_X_OPCODE_LIST(V) \
2601 PPC_X_OPCODE_EH_S_FORM_LIST(V) \
2602 PPC_XO_OPCODE_LIST(V) \
2603 PPC_DS_OPCODE_LIST(V) \
2604 PPC_DQ_OPCODE_LIST(V) \
2605 PPC_MDS_OPCODE_LIST(V) \
2606 PPC_MD_OPCODE_LIST(V) \
2607 PPC_XS_OPCODE_LIST(V) \
2608 PPC_D_OPCODE_LIST(V) \
2609 PPC_I_OPCODE_LIST(V) \
2610 PPC_B_OPCODE_LIST(V) \
2611 PPC_XL_OPCODE_LIST(V) \
2612 PPC_A_OPCODE_LIST(V) \
2613 PPC_XFX_OPCODE_LIST(V) \
2614 PPC_M_OPCODE_LIST(V) \
2615 PPC_SC_OPCODE_LIST(V) \
2616 PPC_Z23_OPCODE_LIST(V) \
2617 PPC_Z22_OPCODE_LIST(V) \
2618 PPC_EVX_OPCODE_LIST(V) \
2619 PPC_XFL_OPCODE_LIST(V) \
2620 PPC_EVS_OPCODE_LIST(V) \
2621 PPC_VX_OPCODE_LIST(V) \
2622 PPC_VA_OPCODE_LIST(V) \
2623 PPC_VC_OPCODE_LIST(V) \
2624 PPC_XX1_OPCODE_LIST(V) \
2625 PPC_XX2_OPCODE_LIST(V) \
2626 PPC_XX3_OPCODE_LIST(V) \
2627 PPC_XX4_OPCODE_LIST(V)
2628
2629 enum Opcode : uint32_t {
2630 #define DECLARE_INSTRUCTION(name, opcode_name, opcode_value) \
2631 opcode_name = opcode_value,
2632 PPC_OPCODE_LIST(DECLARE_INSTRUCTION)
2633 #undef DECLARE_INSTRUCTION
2634 EXT0 = 0x10000000, // Extended code set 0
2635 EXT1 = 0x4C000000, // Extended code set 1
2636 EXT2 = 0x7C000000, // Extended code set 2
2637 EXT3 = 0xEC000000, // Extended code set 3
2638 EXT4 = 0xFC000000, // Extended code set 4
2639 EXT5 = 0x78000000, // Extended code set 5 - 64bit only
2640 EXT6 = 0xF0000000, // Extended code set 6
2641 };
2642
2643 // Instruction encoding bits and masks.
2644 enum {
2645 // Instruction encoding bit
2646 B1 = 1 << 1,
2647 B2 = 1 << 2,
2648 B3 = 1 << 3,
2649 B4 = 1 << 4,
2650 B5 = 1 << 5,
2651 B7 = 1 << 7,
2652 B8 = 1 << 8,
2653 B9 = 1 << 9,
2654 B12 = 1 << 12,
2655 B18 = 1 << 18,
2656 B19 = 1 << 19,
2657 B20 = 1 << 20,
2658 B22 = 1 << 22,
2659 B23 = 1 << 23,
2660 B24 = 1 << 24,
2661 B25 = 1 << 25,
2662 B26 = 1 << 26,
2663 B27 = 1 << 27,
2664 B28 = 1 << 28,
2665 B6 = 1 << 6,
2666 B10 = 1 << 10,
2667 B11 = 1 << 11,
2668 B16 = 1 << 16,
2669 B17 = 1 << 17,
2670 B21 = 1 << 21,
2671
2672 // Instruction bit masks
2673 kCondMask = 0x1F << 21,
2674 kOff12Mask = (1 << 12) - 1,
2675 kImm24Mask = (1 << 24) - 1,
2676 kOff16Mask = (1 << 16) - 1,
2677 kImm16Mask = (1 << 16) - 1,
2678 kImm22Mask = (1 << 22) - 1,
2679 kImm26Mask = (1 << 26) - 1,
2680 kBOfieldMask = 0x1f << 21,
2681 kOpcodeMask = 0x3f << 26,
2682 kExt1OpcodeMask = 0x3ff << 1,
2683 kExt2OpcodeMask = 0x3ff << 1,
2684 kExt2OpcodeVariant2Mask = 0x1ff << 2,
2685 kExt5OpcodeMask = 0x3 << 2,
2686 kBOMask = 0x1f << 21,
2687 kBIMask = 0x1F << 16,
2688 kBDMask = 0x14 << 2,
2689 kAAMask = 0x01 << 1,
2690 kLKMask = 0x01,
2691 kRCMask = 0x01,
2692 kTOMask = 0x1f << 21
2693 };
2694
2695 // -----------------------------------------------------------------------------
2696 // Addressing modes and instruction variants.
2697
2698 // Overflow Exception
2699 enum OEBit {
2700 SetOE = 1 << 10, // Set overflow exception
2701 LeaveOE = 0 << 10 // No overflow exception
2702 };
2703
2704 // Record bit
2705 enum RCBit { // Bit 0
2706 SetRC = 1, // LT,GT,EQ,SO
2707 LeaveRC = 0 // None
2708 };
2709 // Exclusive Access hint bit
2710 enum EHBit { // Bit 0
2711 SetEH = 1, // Exclusive Access
2712 LeaveEH = 0 // Atomic Update
2713 };
2714
2715 // Link bit
2716 enum LKBit { // Bit 0
2717 SetLK = 1, // Load effective address of next instruction
2718 LeaveLK = 0 // No action
2719 };
2720
2721 enum BOfield { // Bits 25-21
2722 DCBNZF = 0 << 21, // Decrement CTR; branch if CTR != 0 and condition false
2723 DCBEZF = 2 << 21, // Decrement CTR; branch if CTR == 0 and condition false
2724 BF = 4 << 21, // Branch if condition false
2725 DCBNZT = 8 << 21, // Decrement CTR; branch if CTR != 0 and condition true
2726 DCBEZT = 10 << 21, // Decrement CTR; branch if CTR == 0 and condition true
2727 BT = 12 << 21, // Branch if condition true
2728 DCBNZ = 16 << 21, // Decrement CTR; branch if CTR != 0
2729 DCBEZ = 18 << 21, // Decrement CTR; branch if CTR == 0
2730 BA = 20 << 21 // Branch always
2731 };
2732
2733 #if V8_OS_AIX
2734 #undef CR_LT
2735 #undef CR_GT
2736 #undef CR_EQ
2737 #undef CR_SO
2738 #endif
2739
2740 enum CRBit { CR_LT = 0, CR_GT = 1, CR_EQ = 2, CR_SO = 3, CR_FU = 3 };
2741
2742 #define CRWIDTH 4
2743
2744 // These are the documented bit positions biased down by 32
2745 enum FPSCRBit {
2746 VXSOFT = 21, // 53: Software-Defined Condition
2747 VXSQRT = 22, // 54: Invalid Square Root
2748 VXCVI = 23 // 55: Invalid Integer Convert
2749 };
2750
2751 // -----------------------------------------------------------------------------
2752 // Supervisor Call (svc) specific support.
2753
2754 // Special Software Interrupt codes when used in the presence of the PPC
2755 // simulator.
2756 // svc (formerly swi) provides a 24bit immediate value. Use bits 22:0 for
2757 // standard SoftwareInterrupCode. Bit 23 is reserved for the stop feature.
2758 enum SoftwareInterruptCodes {
2759 // transition to C code
2760 kCallRtRedirected = 0x10,
2761 // break point
2762 kBreakpoint = 0x821008, // bits23-0 of 0x7d821008 = twge r2, r2
2763 // stop
2764 kStopCode = 1 << 23
2765 };
2766 const uint32_t kStopCodeMask = kStopCode - 1;
2767 const uint32_t kMaxStopCode = kStopCode - 1;
2768 const int32_t kDefaultStopCode = -1;
2769
2770 // FP rounding modes.
2771 enum FPRoundingMode {
2772 RN = 0, // Round to Nearest.
2773 RZ = 1, // Round towards zero.
2774 RP = 2, // Round towards Plus Infinity.
2775 RM = 3, // Round towards Minus Infinity.
2776
2777 // Aliases.
2778 kRoundToNearest = RN,
2779 kRoundToZero = RZ,
2780 kRoundToPlusInf = RP,
2781 kRoundToMinusInf = RM
2782 };
2783
2784 const uint32_t kFPRoundingModeMask = 3;
2785
2786 enum CheckForInexactConversion {
2787 kCheckForInexactConversion,
2788 kDontCheckForInexactConversion
2789 };
2790
2791 // -----------------------------------------------------------------------------
2792 // Specific instructions, constants, and masks.
2793 // These constants are declared in assembler-arm.cc, as they use named registers
2794 // and other constants.
2795
2796 // add(sp, sp, 4) instruction (aka Pop())
2797 extern const Instr kPopInstruction;
2798
2799 // str(r, MemOperand(sp, 4, NegPreIndex), al) instruction (aka push(r))
2800 // register r is not encoded.
2801 extern const Instr kPushRegPattern;
2802
2803 // ldr(r, MemOperand(sp, 4, PostIndex), al) instruction (aka pop(r))
2804 // register r is not encoded.
2805 extern const Instr kPopRegPattern;
2806
2807 // use TWI to indicate redirection call for simulation mode
2808 const Instr rtCallRedirInstr = TWI;
2809
2810 // -----------------------------------------------------------------------------
2811 // Instruction abstraction.
2812
2813 // The class Instruction enables access to individual fields defined in the PPC
2814 // architecture instruction set encoding.
2815 // Note that the Assembler uses typedef int32_t Instr.
2816 //
2817 // Example: Test whether the instruction at ptr does set the condition code
2818 // bits.
2819 //
2820 // bool InstructionSetsConditionCodes(byte* ptr) {
2821 // Instruction* instr = Instruction::At(ptr);
2822 // int type = instr->TypeValue();
2823 // return ((type == 0) || (type == 1)) && instr->HasS();
2824 // }
2825 //
2826
2827 constexpr uint8_t kInstrSize = 4;
2828 constexpr uint8_t kInstrSizeLog2 = 2;
2829 constexpr uint8_t kPcLoadDelta = 8;
2830
2831 class Instruction {
2832 public:
2833 // Helper macro to define static accessors.
2834 // We use the cast to char* trick to bypass the strict anti-aliasing rules.
2835 #define DECLARE_STATIC_TYPED_ACCESSOR(return_type, Name) \
2836 static inline return_type Name(Instr instr) { \
2837 char* temp = reinterpret_cast<char*>(&instr); \
2838 return reinterpret_cast<Instruction*>(temp)->Name(); \
2839 }
2840
2841 #define DECLARE_STATIC_ACCESSOR(Name) DECLARE_STATIC_TYPED_ACCESSOR(int, Name)
2842
2843 // Get the raw instruction bits.
InstructionBits()2844 inline Instr InstructionBits() const {
2845 return *reinterpret_cast<const Instr*>(this);
2846 }
2847
2848 // Set the raw instruction bits to value.
SetInstructionBits(Instr value)2849 inline void SetInstructionBits(Instr value) {
2850 *reinterpret_cast<Instr*>(this) = value;
2851 }
2852
2853 // Read one particular bit out of the instruction bits.
Bit(int nr)2854 inline int Bit(int nr) const { return (InstructionBits() >> nr) & 1; }
2855
2856 // Read a bit field's value out of the instruction bits.
Bits(int hi,int lo)2857 inline int Bits(int hi, int lo) const {
2858 return (InstructionBits() >> lo) & ((2 << (hi - lo)) - 1);
2859 }
2860
2861 // Read a bit field out of the instruction bits.
BitField(int hi,int lo)2862 inline uint32_t BitField(int hi, int lo) const {
2863 return InstructionBits() & (((2 << (hi - lo)) - 1) << lo);
2864 }
2865
2866 // Static support.
2867
2868 // Read one particular bit out of the instruction bits.
Bit(Instr instr,int nr)2869 static inline int Bit(Instr instr, int nr) { return (instr >> nr) & 1; }
2870
2871 // Read the value of a bit field out of the instruction bits.
Bits(Instr instr,int hi,int lo)2872 static inline int Bits(Instr instr, int hi, int lo) {
2873 return (instr >> lo) & ((2 << (hi - lo)) - 1);
2874 }
2875
2876 // Read a bit field out of the instruction bits.
BitField(Instr instr,int hi,int lo)2877 static inline uint32_t BitField(Instr instr, int hi, int lo) {
2878 return instr & (((2 << (hi - lo)) - 1) << lo);
2879 }
2880
RSValue()2881 inline int RSValue() const { return Bits(25, 21); }
RTValue()2882 inline int RTValue() const { return Bits(25, 21); }
RAValue()2883 inline int RAValue() const { return Bits(20, 16); }
DECLARE_STATIC_ACCESSOR(RAValue)2884 DECLARE_STATIC_ACCESSOR(RAValue)
2885 inline int RBValue() const { return Bits(15, 11); }
DECLARE_STATIC_ACCESSOR(RBValue)2886 DECLARE_STATIC_ACCESSOR(RBValue)
2887 inline int RCValue() const { return Bits(10, 6); }
DECLARE_STATIC_ACCESSOR(RCValue)2888 DECLARE_STATIC_ACCESSOR(RCValue)
2889
2890 inline int OpcodeValue() const { return static_cast<Opcode>(Bits(31, 26)); }
OpcodeField()2891 inline uint32_t OpcodeField() const {
2892 return static_cast<Opcode>(BitField(31, 26));
2893 }
2894
2895 #define OPCODE_CASES(name, opcode_name, opcode_value) case opcode_name:
2896
OpcodeBase()2897 inline Opcode OpcodeBase() const {
2898 uint32_t opcode = OpcodeField();
2899 uint32_t extcode = OpcodeField();
2900 switch (opcode) {
2901 PPC_D_OPCODE_LIST(OPCODE_CASES)
2902 PPC_I_OPCODE_LIST(OPCODE_CASES)
2903 PPC_B_OPCODE_LIST(OPCODE_CASES)
2904 PPC_M_OPCODE_LIST(OPCODE_CASES)
2905 return static_cast<Opcode>(opcode);
2906 }
2907
2908 opcode = extcode | BitField(10, 0);
2909 switch (opcode) {
2910 PPC_VX_OPCODE_LIST(OPCODE_CASES)
2911 PPC_X_OPCODE_EH_S_FORM_LIST(OPCODE_CASES)
2912 return static_cast<Opcode>(opcode);
2913 }
2914 opcode = extcode | BitField(9, 0);
2915 switch (opcode) {
2916 PPC_VC_OPCODE_LIST(OPCODE_CASES)
2917 return static_cast<Opcode>(opcode);
2918 }
2919 opcode = extcode | BitField(10, 1) | BitField(20, 20);
2920 switch (opcode) {
2921 PPC_XFX_OPCODE_LIST(OPCODE_CASES)
2922 return static_cast<Opcode>(opcode);
2923 }
2924 opcode = extcode | BitField(10, 1);
2925 switch (opcode) {
2926 PPC_X_OPCODE_LIST(OPCODE_CASES)
2927 PPC_XL_OPCODE_LIST(OPCODE_CASES)
2928 PPC_XFL_OPCODE_LIST(OPCODE_CASES)
2929 PPC_XX1_OPCODE_LIST(OPCODE_CASES)
2930 PPC_XX2_OPCODE_LIST(OPCODE_CASES)
2931 PPC_EVX_OPCODE_LIST(OPCODE_CASES)
2932 return static_cast<Opcode>(opcode);
2933 }
2934 opcode = extcode | BitField(9, 1);
2935 switch (opcode) {
2936 PPC_XO_OPCODE_LIST(OPCODE_CASES)
2937 PPC_Z22_OPCODE_LIST(OPCODE_CASES)
2938 return static_cast<Opcode>(opcode);
2939 }
2940 opcode = extcode | BitField(10, 2);
2941 switch (opcode) {
2942 PPC_XS_OPCODE_LIST(OPCODE_CASES)
2943 return static_cast<Opcode>(opcode);
2944 }
2945 opcode = extcode | BitField(10, 3);
2946 switch (opcode) {
2947 PPC_EVS_OPCODE_LIST(OPCODE_CASES)
2948 PPC_XX3_OPCODE_LIST(OPCODE_CASES)
2949 return static_cast<Opcode>(opcode);
2950 }
2951 opcode = extcode | BitField(8, 1);
2952 switch (opcode) {
2953 PPC_Z23_OPCODE_LIST(OPCODE_CASES)
2954 return static_cast<Opcode>(opcode);
2955 }
2956 opcode = extcode | BitField(5, 0);
2957 switch (opcode) {
2958 PPC_VA_OPCODE_LIST(OPCODE_CASES)
2959 return static_cast<Opcode>(opcode);
2960 }
2961 opcode = extcode | BitField(5, 1);
2962 switch (opcode) {
2963 PPC_A_OPCODE_LIST(OPCODE_CASES)
2964 return static_cast<Opcode>(opcode);
2965 }
2966 opcode = extcode | BitField(4, 1);
2967 switch (opcode) {
2968 PPC_MDS_OPCODE_LIST(OPCODE_CASES)
2969 return static_cast<Opcode>(opcode);
2970 }
2971 opcode = extcode | BitField(4, 2);
2972 switch (opcode) {
2973 PPC_MD_OPCODE_LIST(OPCODE_CASES)
2974 return static_cast<Opcode>(opcode);
2975 }
2976 opcode = extcode | BitField(5, 4);
2977 switch (opcode) {
2978 PPC_XX4_OPCODE_LIST(OPCODE_CASES)
2979 return static_cast<Opcode>(opcode);
2980 }
2981 opcode = extcode | BitField(2, 0);
2982 switch (opcode) {
2983 PPC_DQ_OPCODE_LIST(OPCODE_CASES)
2984 return static_cast<Opcode>(opcode);
2985 }
2986 opcode = extcode | BitField(1, 0);
2987 switch (opcode) {
2988 PPC_DS_OPCODE_LIST(OPCODE_CASES)
2989 return static_cast<Opcode>(opcode);
2990 }
2991 opcode = extcode | BitField(1, 1);
2992 switch (opcode) {
2993 PPC_SC_OPCODE_LIST(OPCODE_CASES)
2994 return static_cast<Opcode>(opcode);
2995 }
2996 UNIMPLEMENTED();
2997 return static_cast<Opcode>(0);
2998 }
2999
3000 #undef OPCODE_CASES
3001
3002 // Fields used in Software interrupt instructions
SvcValue()3003 inline SoftwareInterruptCodes SvcValue() const {
3004 return static_cast<SoftwareInterruptCodes>(Bits(23, 0));
3005 }
3006
3007 // Instructions are read of out a code stream. The only way to get a
3008 // reference to an instruction is to convert a pointer. There is no way
3009 // to allocate or create instances of class Instruction.
3010 // Use the At(pc) function to create references to Instruction.
At(byte * pc)3011 static Instruction* At(byte* pc) {
3012 return reinterpret_cast<Instruction*>(pc);
3013 }
3014
3015 private:
3016 // We need to prevent the creation of instances of class Instruction.
3017 DISALLOW_IMPLICIT_CONSTRUCTORS(Instruction);
3018 };
3019
3020 // Helper functions for converting between register numbers and names.
3021 class Registers {
3022 public:
3023 // Lookup the register number for the name provided.
3024 static int Number(const char* name);
3025
3026 private:
3027 static const char* names_[kNumRegisters];
3028 };
3029
3030 // Helper functions for converting between FP register numbers and names.
3031 class DoubleRegisters {
3032 public:
3033 // Lookup the register number for the name provided.
3034 static int Number(const char* name);
3035
3036 private:
3037 static const char* names_[kNumDoubleRegisters];
3038 };
3039 } // namespace internal
3040 } // namespace v8
3041
3042 static constexpr int kR0DwarfCode = 0;
3043 static constexpr int kFpDwarfCode = 31; // frame-pointer
3044 static constexpr int kLrDwarfCode = 65; // return-address(lr)
3045 static constexpr int kSpDwarfCode = 1; // stack-pointer (sp)
3046
3047 #endif // V8_CODEGEN_PPC_CONSTANTS_PPC_H_
3048