2
* Generate .byte code for some instructions not supported by old
10
.macro XMM_NUM opd xmm
65
.macro PFX_REX opd1 opd2
66
.if (\opd1 | \opd2) & 8
67
.byte 0x40 | ((\opd1 & 8) >> 3) | ((\opd2 & 8) >> 1)
71
.macro MODRM mod opd1 opd2
72
.byte \mod | (\opd1 & 7) | ((\opd2 & 7) << 3)
75
.macro PSHUFB_XMM xmm1 xmm2
76
XMM_NUM pshufb_opd1 \xmm1
77
XMM_NUM pshufb_opd2 \xmm2
79
PFX_REX pshufb_opd1 pshufb_opd2
80
.byte 0x0f, 0x38, 0x00
81
MODRM 0xc0 pshufb_opd1 pshufb_opd2
84
.macro PCLMULQDQ imm8 xmm1 xmm2
85
XMM_NUM clmul_opd1 \xmm1
86
XMM_NUM clmul_opd2 \xmm2
88
PFX_REX clmul_opd1 clmul_opd2
89
.byte 0x0f, 0x3a, 0x44
90
MODRM 0xc0 clmul_opd1 clmul_opd2
94
.macro AESKEYGENASSIST rcon xmm1 xmm2
95
XMM_NUM aeskeygen_opd1 \xmm1
96
XMM_NUM aeskeygen_opd2 \xmm2
98
PFX_REX aeskeygen_opd1 aeskeygen_opd2
99
.byte 0x0f, 0x3a, 0xdf
100
MODRM 0xc0 aeskeygen_opd1 aeskeygen_opd2
104
.macro AESIMC xmm1 xmm2
105
XMM_NUM aesimc_opd1 \xmm1
106
XMM_NUM aesimc_opd2 \xmm2
108
PFX_REX aesimc_opd1 aesimc_opd2
109
.byte 0x0f, 0x38, 0xdb
110
MODRM 0xc0 aesimc_opd1 aesimc_opd2
113
.macro AESENC xmm1 xmm2
114
XMM_NUM aesenc_opd1 \xmm1
115
XMM_NUM aesenc_opd2 \xmm2
117
PFX_REX aesenc_opd1 aesenc_opd2
118
.byte 0x0f, 0x38, 0xdc
119
MODRM 0xc0 aesenc_opd1 aesenc_opd2
122
.macro AESENCLAST xmm1 xmm2
123
XMM_NUM aesenclast_opd1 \xmm1
124
XMM_NUM aesenclast_opd2 \xmm2
126
PFX_REX aesenclast_opd1 aesenclast_opd2
127
.byte 0x0f, 0x38, 0xdd
128
MODRM 0xc0 aesenclast_opd1 aesenclast_opd2
131
.macro AESDEC xmm1 xmm2
132
XMM_NUM aesdec_opd1 \xmm1
133
XMM_NUM aesdec_opd2 \xmm2
135
PFX_REX aesdec_opd1 aesdec_opd2
136
.byte 0x0f, 0x38, 0xde
137
MODRM 0xc0 aesdec_opd1 aesdec_opd2
140
.macro AESDECLAST xmm1 xmm2
141
XMM_NUM aesdeclast_opd1 \xmm1
142
XMM_NUM aesdeclast_opd2 \xmm2
144
PFX_REX aesdeclast_opd1 aesdeclast_opd2
145
.byte 0x0f, 0x38, 0xdf
146
MODRM 0xc0 aesdeclast_opd1 aesdeclast_opd2