1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Generate .byte code for some instructions not supported by old
11 #define REG_NUM_INVALID 100
13 #define REG_TYPE_R32 0
14 #define REG_TYPE_R64 1
15 #define REG_TYPE_INVALID 100
17 .macro R32_NUM opd r32
18 \opd
= REG_NUM_INVALID
71 .macro R64_NUM opd r64
72 \opd
= REG_NUM_INVALID
125 .macro REG_TYPE type reg
126 R32_NUM reg_type_r32
\reg
127 R64_NUM reg_type_r64
\reg
128 .if reg_type_r64
<> REG_NUM_INVALID
130 .elseif reg_type_r32
<> REG_NUM_INVALID
133 \type
= REG_TYPE_INVALID
137 .macro PFX_REX opd1 opd2 W
=0
138 .if ((\opd1
| \opd2
) & 8) || \W
139 .byte
0x40 | ((\opd1
& 8) >> 3) | ((\opd2
& 8) >> 1) | (\W
<< 3)
143 .macro MODRM mod opd1 opd2
144 .byte \mod
| (\opd1
& 7) | ((\opd2
& 7) << 3)