Debian Codegraph @

internal/opcodesextra/vaes.go

raw symbols SCIP
1 package opcodesextra
2
3 import "github.com/mmcloughlin/avo/internal/inst"
4
5 // vaes is the "Vector Advanced Encryption Standard" instruction set.
6 var vaes = []*inst.Instruction{
7 // Reference: https://github.com/golang/go/blob/go1.19.3/src/cmd/internal/obj/x86/avx_optabs.go#L1217-L1244
8 //
9 // {as: AVAESDEC, ytab: _yvaesdec, prefix: Pavx, op: opBytes{
10 // avxEscape | vex128 | vex66 | vex0F38 | vexW0, 0xDE,
11 // avxEscape | vex256 | vex66 | vex0F38 | vexW0, 0xDE,
12 // avxEscape | evex128 | evex66 | evex0F38 | evexW0, evexN16, 0xDE,
13 // avxEscape | evex256 | evex66 | evex0F38 | evexW0, evexN32, 0xDE,
14 // avxEscape | evex512 | evex66 | evex0F38 | evexW0, evexN64, 0xDE,
15 // }},
16 // {as: AVAESDECLAST, ytab: _yvaesdec, prefix: Pavx, op: opBytes{
17 // avxEscape | vex128 | vex66 | vex0F38 | vexW0, 0xDF,
18 // avxEscape | vex256 | vex66 | vex0F38 | vexW0, 0xDF,
19 // avxEscape | evex128 | evex66 | evex0F38 | evexW0, evexN16, 0xDF,
20 // avxEscape | evex256 | evex66 | evex0F38 | evexW0, evexN32, 0xDF,
21 // avxEscape | evex512 | evex66 | evex0F38 | evexW0, evexN64, 0xDF,
22 // }},
23 // {as: AVAESENC, ytab: _yvaesdec, prefix: Pavx, op: opBytes{
24 // avxEscape | vex128 | vex66 | vex0F38 | vexW0, 0xDC,
25 // avxEscape | vex256 | vex66 | vex0F38 | vexW0, 0xDC,
26 // avxEscape | evex128 | evex66 | evex0F38 | evexW0, evexN16, 0xDC,
27 // avxEscape | evex256 | evex66 | evex0F38 | evexW0, evexN32, 0xDC,
28 // avxEscape | evex512 | evex66 | evex0F38 | evexW0, evexN64, 0xDC,
29 // }},
30 // {as: AVAESENCLAST, ytab: _yvaesdec, prefix: Pavx, op: opBytes{
31 // avxEscape | vex128 | vex66 | vex0F38 | vexW0, 0xDD,
32 // avxEscape | vex256 | vex66 | vex0F38 | vexW0, 0xDD,
33 // avxEscape | evex128 | evex66 | evex0F38 | evexW0, evexN16, 0xDD,
34 // avxEscape | evex256 | evex66 | evex0F38 | evexW0, evexN32, 0xDD,
35 // avxEscape | evex512 | evex66 | evex0F38 | evexW0, evexN64, 0xDD,
36 // }},
37 //
38 {
39 Opcode: "VAESDEC",
40 Summary: "Perform One Round of an AES Decryption Flow",
41 Forms: vaesforms,
42 },
43 {
44 Opcode: "VAESDECLAST",
45 Summary: "Perform Last Round of an AES Decryption Flow",
46 Forms: vaesforms,
47 },
48 {
49 Opcode: "VAESENC",
50 Summary: "Perform One Round of an AES Encryption Flow",
51 Forms: vaesforms,
52 },
53 {
54 Opcode: "VAESENCLAST",
55 Summary: "Perform Last Round of an AES Encryption Flow",
56 Forms: vaesforms,
57 },
58 }
59
60 // VAESDEC, VAESDECLAST, VAESENC and VAESENCLAST forms.
61 //
62 // See: https://software.intel.com/en-us/download/intel-64-and-ia-32-architectures-sdm-combined-volumes-1-2a-2b-2c-2d-3a-3b-3c-3d-and-4
63 //
64 // Reference: https://github.com/golang/go/blob/go1.19.3/src/cmd/internal/obj/x86/avx_optabs.go#L111-L117
65 //
66 // var _yvaesdec = []ytab{
67 // {zcase: Zvex_rm_v_r, zoffset: 2, args: argList{Yxm, Yxr, Yxr}},
68 // {zcase: Zvex_rm_v_r, zoffset: 2, args: argList{Yym, Yyr, Yyr}},
69 // {zcase: Zevex_rm_v_r, zoffset: 3, args: argList{YxmEvex, YxrEvex, YxrEvex}},
70 // {zcase: Zevex_rm_v_r, zoffset: 3, args: argList{YymEvex, YyrEvex, YyrEvex}},
71 // {zcase: Zevex_rm_v_r, zoffset: 3, args: argList{Yzm, Yzr, Yzr}},
72 // }
73 var vaesforms = inst.Forms{
74 // VEX.128.66.0F38.WIG DE /r VAESDEC xmm1, xmm2, xmm3/m128 AVX + AES
75 // VEX.128.66.0F38.WIG DF /r VAESDECLAST xmm1, xmm2, xmm3/m128 AVX + AES
76 // VEX.128.66.0F38.WIG DC /r VAESENC xmm1, xmm2, xmm3/m128 AVX + AES
77 // VEX.128.66.0F38.WIG DD /r VAESENCLAST xmm1, xmm2, xmm3/m128 AVX + AES
78 {
79 ISA: []string{"AES", "AVX"},
80 Operands: []inst.Operand{
81 {Type: "m128", Action: inst.R},
82 {Type: "xmm", Action: inst.R},
83 {Type: "xmm", Action: inst.W},
84 },
85 EncodingType: inst.EncodingTypeVEX,
86 },
87 {
88 ISA: []string{"AES", "AVX"},
89 Operands: []inst.Operand{
90 {Type: "xmm", Action: inst.R},
91 {Type: "xmm", Action: inst.R},
92 {Type: "xmm", Action: inst.W},
93 },
94 EncodingType: inst.EncodingTypeVEX,
95 },
96 // VEX.256.66.0F38.WIG DE /r VAESDEC ymm1, ymm2, ymm3/m256 VAES
97 // VEX.256.66.0F38.WIG DF /r VAESDECLAST ymm1, ymm2, ymm3/m256 VAES
98 // VEX.256.66.0F38.WIG DC /r VAESENC ymm1, ymm2, ymm3/m256 VAES
99 // VEX.256.66.0F38.WIG DD /r VAESENCLAST ymm1, ymm2, ymm3/m256 VAES
100 {
101 ISA: []string{"VAES"},
102 Operands: []inst.Operand{
103 {Type: "m256", Action: inst.R},
104 {Type: "ymm", Action: inst.R},
105 {Type: "ymm", Action: inst.W},
106 },
107 EncodingType: inst.EncodingTypeVEX,
108 },
109 {
110 ISA: []string{"VAES"},
111 Operands: []inst.Operand{
112 {Type: "ymm", Action: inst.R},
113 {Type: "ymm", Action: inst.R},
114 {Type: "ymm", Action: inst.W},
115 },
116 EncodingType: inst.EncodingTypeVEX,
117 },
118 // EVEX.128.66.0F38.WIG DE /r VAESDEC xmm1, xmm2, xmm3/m128 AVX512VL + VAES
119 // EVEX.128.66.0F38.WIG DF /r VAESDECLAST xmm1, xmm2, xmm3/m128 AVX512VL + VAES
120 // EVEX.128.66.0F38.WIG DC /r VAESENC xmm1, xmm2, xmm3/m128 AVX512VL + VAES
121 // EVEX.128.66.0F38.WIG DD /r VAESENCLAST xmm1, xmm2, xmm3/m128 AVX512VL + VAES
122 {
123 ISA: []string{"AVX512VL", "VAES"},
124 Operands: []inst.Operand{
125 {Type: "m128", Action: inst.R},
126 {Type: "xmm", Action: inst.R},
127 {Type: "xmm", Action: inst.W},
128 },
129 EncodingType: inst.EncodingTypeEVEX,
130 },
131 {
132 ISA: []string{"AVX512VL", "VAES"},
133 Operands: []inst.Operand{
134 {Type: "xmm", Action: inst.R},
135 {Type: "xmm", Action: inst.R},
136 {Type: "xmm", Action: inst.W},
137 },
138 EncodingType: inst.EncodingTypeEVEX,
139 },
140 // EVEX.256.66.0F38.WIG DE /r VAESDEC ymm1, ymm2, ymm3/m256 AVX512VL + VAES
141 // EVEX.256.66.0F38.WIG DF /r VAESDECLAST ymm1, ymm2, ymm3/m256 AVX512VL + VAES
142 // EVEX.256.66.0F38.WIG DC /r VAESENC ymm1, ymm2, ymm3/m256 AVX512VL + VAES
143 // EVEX.256.66.0F38.WIG DD /r VAESENCLAST ymm1, ymm2, ymm3/m256 AVX512VL + VAES
144 {
145 ISA: []string{"AVX512VL", "VAES"},
146 Operands: []inst.Operand{
147 {Type: "m256", Action: inst.R},
148 {Type: "ymm", Action: inst.R},
149 {Type: "ymm", Action: inst.W},
150 },
151 EncodingType: inst.EncodingTypeEVEX,
152 },
153 {
154 ISA: []string{"AVX512VL", "VAES"},
155 Operands: []inst.Operand{
156 {Type: "ymm", Action: inst.R},
157 {Type: "ymm", Action: inst.R},
158 {Type: "ymm", Action: inst.W},
159 },
160 EncodingType: inst.EncodingTypeEVEX,
161 },
162 // EVEX.512.66.0F38.WIG DE /r VAESDEC zmm1, zmm2, zmm3/m512 AVX512F + VAES
163 // EVEX.512.66.0F38.WIG DF /r VAESDECLAST zmm1, zmm2, zmm3/m512 AVX512F + VAES
164 // EVEX.512.66.0F38.WIG DC /r VAESENC zmm1, zmm2, zmm3/m512 AVX512F + VAES
165 // EVEX.512.66.0F38.WIG DD /r VAESENCLAST zmm1, zmm2, zmm3/m512 AVX512F + VAES
166 {
167 ISA: []string{"AVX512F", "VAES"},
168 Operands: []inst.Operand{
169 {Type: "m512", Action: inst.R},
170 {Type: "zmm", Action: inst.R},
171 {Type: "zmm", Action: inst.W},
172 },
173 EncodingType: inst.EncodingTypeEVEX,
174 },
175 {
176 ISA: []string{"AVX512F", "VAES"},
177 Operands: []inst.Operand{
178 {Type: "zmm", Action: inst.R},
179 {Type: "zmm", Action: inst.R},
180 {Type: "zmm", Action: inst.W},
181 },
182 EncodingType: inst.EncodingTypeEVEX,
183 },
184 }