2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | (c) Copyright IBM Corporation 2015-2016 |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
17 #ifndef incl_HPHP_PPC64_ASM_ISA_PPC64_H_
18 #define incl_HPHP_PPC64_ASM_ISA_PPC64_H_
22 typedef uint32_t PPC64Instr
;
24 // How many bytes a PPC64 instruction length is.
25 constexpr uint8_t instr_size_in_bytes
= sizeof(PPC64Instr
);
59 * Instruction Format encoders
61 typedef union XO_format
{
71 PPC64Instr instruction
;
73 static_assert(sizeof(XO_format
) == sizeof(uint32_t), "XO_form_t size != 4");
75 typedef union X_format
{
84 PPC64Instr instruction
;
86 static_assert(sizeof(X_format
) == sizeof(uint32_t), "X_form_t size != 4");
88 typedef union D_format
{
95 PPC64Instr instruction
;
97 static_assert(sizeof(D_format
) == sizeof(uint32_t), "D_form_t size != 4");
99 typedef union I_format
{
106 PPC64Instr instruction
;
108 static_assert(sizeof(I_format
) == sizeof(uint32_t), "I_form_t size != 4");
110 typedef union B_format
{
119 PPC64Instr instruction
;
121 static_assert(sizeof(B_format
) == sizeof(uint32_t), "B_form_t size != 4");
123 typedef union SC_format
{
133 PPC64Instr instruction
;
135 static_assert(sizeof(SC_format
) == sizeof(uint32_t), "SC_form_t size != 4");
137 typedef union DS_format
{
145 PPC64Instr instruction
;
147 static_assert(sizeof(DS_format
) == sizeof(uint32_t), "DS_form_t size != 4");
149 typedef union DQ_format
{
157 PPC64Instr instruction
;
159 static_assert(sizeof(DQ_format
) == sizeof(uint32_t), "DQ_form_t size != 4");
161 typedef union XL_form
{
170 PPC64Instr instruction
;
172 static_assert(sizeof(XL_form
) == sizeof(uint32_t), "XL_form size != 4");
174 typedef union XFX_format
{
178 uint32_t SPRlo
:5; // see note 1: the order of the two 5-bit halves
179 uint32_t SPRhi
:5; // of the SPR number is reversed
183 PPC64Instr instruction
;
185 static_assert(sizeof(XFX_format
) == sizeof(uint32_t), "XFX_form_t size != 4");
187 typedef union XFL_format
{
197 PPC64Instr instruction
;
199 static_assert(sizeof(XFL_format
) == sizeof(uint32_t), "XFL_form_t size != 4");
201 typedef union XX1_format
{
210 PPC64Instr instruction
;
212 static_assert(sizeof(XX1_format
) == sizeof(uint32_t), "XX1_form_t size != 4");
214 typedef union XX2_format
{
224 PPC64Instr instruction
;
226 static_assert(sizeof(XX2_format
) == sizeof(uint32_t), "XX2_form_t size != 4");
228 typedef union XX3_format
{
239 PPC64Instr instruction
;
241 static_assert(sizeof(XX3_format
) == sizeof(uint32_t), "XX3_form_t size != 4");
243 typedef union XX4_format
{
256 PPC64Instr instruction
;
258 static_assert(sizeof(XX4_format
) == sizeof(uint32_t), "XX4_form_t size != 4");
260 typedef union XS_format
{
270 PPC64Instr instruction
;
272 static_assert(sizeof(XS_format
) == sizeof(uint32_t), "XS_form_t size != 4");
274 typedef union A_format
{
284 PPC64Instr instruction
;
286 static_assert(sizeof(A_format
) == sizeof(uint32_t), "A_form_t size != 4");
288 typedef union M_format
{
298 PPC64Instr instruction
;
300 static_assert(sizeof(M_format
) == sizeof(uint32_t), "M_form_t size != 4");
302 typedef union MD_format
{
313 PPC64Instr instruction
;
315 static_assert(sizeof(MD_format
) == sizeof(uint32_t), "MD_form_t size != 4");
317 typedef union MDS_format
{
327 PPC64Instr instruction
;
329 static_assert(sizeof(MDS_format
) == sizeof(uint32_t), "MDS_form_t size != 4");
331 typedef union VA_format
{
340 PPC64Instr instruction
;
342 static_assert(sizeof(VA_format
) == sizeof(uint32_t), "VA_form_t size != 4");
344 typedef union VC_format
{
353 PPC64Instr instruction
;
355 static_assert(sizeof(VC_format
) == sizeof(uint32_t), "VC_form_t size != 4");
357 typedef union VX_format
{
365 PPC64Instr instruction
;
367 static_assert(sizeof(VX_format
) == sizeof(uint32_t), "VX_form_t size != 4");
369 typedef union EVX_format
{
377 PPC64Instr instruction
;
379 static_assert(sizeof(EVX_format
) == sizeof(uint32_t), "EVX_form_t size != 4");
381 typedef union EVS_format
{
390 PPC64Instr instruction
;
392 static_assert(sizeof(EVS_format
) == sizeof(uint32_t), "EVS_form_t size != 4");
394 typedef union Z22_format
{
399 PPC64Instr instruction
;
401 static_assert(sizeof(Z22_format
) == sizeof(uint32_t), "Z22_form_t size != 4");
403 typedef union Z23_format
{
408 PPC64Instr instruction
;
410 static_assert(sizeof(Z23_format
) == sizeof(uint32_t), "Z23_form_t size != 4");
412 } // namespace ppc64_asm