1// i386 register table.
2// Copyright (C) 2007-2016 Free Software Foundation, Inc.
3//
4// This file is part of the GNU opcodes library.
5//
6// This library is free software; you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation; either version 3, or (at your option)
9// any later version.
10//
11// It is distributed in the hope that it will be useful, but WITHOUT
12// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
14// License for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with GAS; see the file COPYING.  If not, write to the Free
18// Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
19// 02110-1301, USA.
20
21// Make %st first as we test for it.
22st, FloatReg|FloatAcc, 0, 0, 11, 33
23// 8 bit regs
24al, Reg8|Acc|Byte, 0, 0, Dw2Inval, Dw2Inval
25cl, Reg8|ShiftCount, 0, 1, Dw2Inval, Dw2Inval
26dl, Reg8, 0, 2, Dw2Inval, Dw2Inval
27bl, Reg8, 0, 3, Dw2Inval, Dw2Inval
28ah, Reg8, 0, 4, Dw2Inval, Dw2Inval
29ch, Reg8, 0, 5, Dw2Inval, Dw2Inval
30dh, Reg8, 0, 6, Dw2Inval, Dw2Inval
31bh, Reg8, 0, 7, Dw2Inval, Dw2Inval
32axl, Reg8|Acc|Byte, RegRex64, 0, Dw2Inval, Dw2Inval
33cxl, Reg8, RegRex64, 1, Dw2Inval, Dw2Inval
34dxl, Reg8, RegRex64, 2, Dw2Inval, Dw2Inval
35bxl, Reg8, RegRex64, 3, Dw2Inval, Dw2Inval
36spl, Reg8, RegRex64, 4, Dw2Inval, Dw2Inval
37bpl, Reg8, RegRex64, 5, Dw2Inval, Dw2Inval
38sil, Reg8, RegRex64, 6, Dw2Inval, Dw2Inval
39dil, Reg8, RegRex64, 7, Dw2Inval, Dw2Inval
40r8b, Reg8, RegRex|RegRex64, 0, Dw2Inval, Dw2Inval
41r9b, Reg8, RegRex|RegRex64, 1, Dw2Inval, Dw2Inval
42r10b, Reg8, RegRex|RegRex64, 2, Dw2Inval, Dw2Inval
43r11b, Reg8, RegRex|RegRex64, 3, Dw2Inval, Dw2Inval
44r12b, Reg8, RegRex|RegRex64, 4, Dw2Inval, Dw2Inval
45r13b, Reg8, RegRex|RegRex64, 5, Dw2Inval, Dw2Inval
46r14b, Reg8, RegRex|RegRex64, 6, Dw2Inval, Dw2Inval
47r15b, Reg8, RegRex|RegRex64, 7, Dw2Inval, Dw2Inval
48// 16 bit regs
49ax, Reg16|Acc|Word, 0, 0, Dw2Inval, Dw2Inval
50cx, Reg16, 0, 1, Dw2Inval, Dw2Inval
51dx, Reg16|InOutPortReg, 0, 2, Dw2Inval, Dw2Inval
52bx, Reg16|BaseIndex, 0, 3, Dw2Inval, Dw2Inval
53sp, Reg16, 0, 4, Dw2Inval, Dw2Inval
54bp, Reg16|BaseIndex, 0, 5, Dw2Inval, Dw2Inval
55si, Reg16|BaseIndex, 0, 6, Dw2Inval, Dw2Inval
56di, Reg16|BaseIndex, 0, 7, Dw2Inval, Dw2Inval
57r8w, Reg16, RegRex, 0, Dw2Inval, Dw2Inval
58r9w, Reg16, RegRex, 1, Dw2Inval, Dw2Inval
59r10w, Reg16, RegRex, 2, Dw2Inval, Dw2Inval
60r11w, Reg16, RegRex, 3, Dw2Inval, Dw2Inval
61r12w, Reg16, RegRex, 4, Dw2Inval, Dw2Inval
62r13w, Reg16, RegRex, 5, Dw2Inval, Dw2Inval
63r14w, Reg16, RegRex, 6, Dw2Inval, Dw2Inval
64r15w, Reg16, RegRex, 7, Dw2Inval, Dw2Inval
65// 32 bit regs
66eax, Reg32|BaseIndex|Acc|Dword, 0, 0, 0, Dw2Inval
67ecx, Reg32|BaseIndex, 0, 1, 1, Dw2Inval
68edx, Reg32|BaseIndex, 0, 2, 2, Dw2Inval
69ebx, Reg32|BaseIndex, 0, 3, 3, Dw2Inval
70esp, Reg32, 0, 4, 4, Dw2Inval
71ebp, Reg32|BaseIndex, 0, 5, 5, Dw2Inval
72esi, Reg32|BaseIndex, 0, 6, 6, Dw2Inval
73edi, Reg32|BaseIndex, 0, 7, 7, Dw2Inval
74r8d, Reg32|BaseIndex, RegRex, 0, Dw2Inval, Dw2Inval
75r9d, Reg32|BaseIndex, RegRex, 1, Dw2Inval, Dw2Inval
76r10d, Reg32|BaseIndex, RegRex, 2, Dw2Inval, Dw2Inval
77r11d, Reg32|BaseIndex, RegRex, 3, Dw2Inval, Dw2Inval
78r12d, Reg32|BaseIndex, RegRex, 4, Dw2Inval, Dw2Inval
79r13d, Reg32|BaseIndex, RegRex, 5, Dw2Inval, Dw2Inval
80r14d, Reg32|BaseIndex, RegRex, 6, Dw2Inval, Dw2Inval
81r15d, Reg32|BaseIndex, RegRex, 7, Dw2Inval, Dw2Inval
82rax, Reg64|BaseIndex|Acc|Qword, 0, 0, Dw2Inval, 0
83rcx, Reg64|BaseIndex, 0, 1, Dw2Inval, 2
84rdx, Reg64|BaseIndex, 0, 2, Dw2Inval, 1
85rbx, Reg64|BaseIndex, 0, 3, Dw2Inval, 3
86rsp, Reg64, 0, 4, Dw2Inval, 7
87rbp, Reg64|BaseIndex, 0, 5, Dw2Inval, 6
88rsi, Reg64|BaseIndex, 0, 6, Dw2Inval, 4
89rdi, Reg64|BaseIndex, 0, 7, Dw2Inval, 5
90r8, Reg64|BaseIndex, RegRex, 0, Dw2Inval, 8
91r9, Reg64|BaseIndex, RegRex, 1, Dw2Inval, 9
92r10, Reg64|BaseIndex, RegRex, 2, Dw2Inval, 10
93r11, Reg64|BaseIndex, RegRex, 3, Dw2Inval, 11
94r12, Reg64|BaseIndex, RegRex, 4, Dw2Inval, 12
95r13, Reg64|BaseIndex, RegRex, 5, Dw2Inval, 13
96r14, Reg64|BaseIndex, RegRex, 6, Dw2Inval, 14
97r15, Reg64|BaseIndex, RegRex, 7, Dw2Inval, 15
98// Vector mask registers.
99k0, RegMask, 0, 0, 93, 118
100k1, RegMask, 0, 1, 94, 119
101k2, RegMask, 0, 2, 95, 120
102k3, RegMask, 0, 3, 96, 121
103k4, RegMask, 0, 4, 97, 122
104k5, RegMask, 0, 5, 98, 123
105k6, RegMask, 0, 6, 99, 124
106k7, RegMask, 0, 7, 100, 125
107// Segment registers.
108es, SReg2, 0, 0, 40, 50
109cs, SReg2, 0, 1, 41, 51
110ss, SReg2, 0, 2, 42, 52
111ds, SReg2, 0, 3, 43, 53
112fs, SReg3, 0, 4, 44, 54
113gs, SReg3, 0, 5, 45, 55
114flat, SReg3, 0, RegFlat, Dw2Inval, Dw2Inval
115// Control registers.
116cr0, Control, 0, 0, Dw2Inval, Dw2Inval
117cr1, Control, 0, 1, Dw2Inval, Dw2Inval
118cr2, Control, 0, 2, Dw2Inval, Dw2Inval
119cr3, Control, 0, 3, Dw2Inval, Dw2Inval
120cr4, Control, 0, 4, Dw2Inval, Dw2Inval
121cr5, Control, 0, 5, Dw2Inval, Dw2Inval
122cr6, Control, 0, 6, Dw2Inval, Dw2Inval
123cr7, Control, 0, 7, Dw2Inval, Dw2Inval
124cr8, Control, RegRex, 0, Dw2Inval, Dw2Inval
125cr9, Control, RegRex, 1, Dw2Inval, Dw2Inval
126cr10, Control, RegRex, 2, Dw2Inval, Dw2Inval
127cr11, Control, RegRex, 3, Dw2Inval, Dw2Inval
128cr12, Control, RegRex, 4, Dw2Inval, Dw2Inval
129cr13, Control, RegRex, 5, Dw2Inval, Dw2Inval
130cr14, Control, RegRex, 6, Dw2Inval, Dw2Inval
131cr15, Control, RegRex, 7, Dw2Inval, Dw2Inval
132// Debug registers.
133db0, Debug, 0, 0, Dw2Inval, Dw2Inval
134db1, Debug, 0, 1, Dw2Inval, Dw2Inval
135db2, Debug, 0, 2, Dw2Inval, Dw2Inval
136db3, Debug, 0, 3, Dw2Inval, Dw2Inval
137db4, Debug, 0, 4, Dw2Inval, Dw2Inval
138db5, Debug, 0, 5, Dw2Inval, Dw2Inval
139db6, Debug, 0, 6, Dw2Inval, Dw2Inval
140db7, Debug, 0, 7, Dw2Inval, Dw2Inval
141db8, Debug, RegRex, 0, Dw2Inval, Dw2Inval
142db9, Debug, RegRex, 1, Dw2Inval, Dw2Inval
143db10, Debug, RegRex, 2, Dw2Inval, Dw2Inval
144db11, Debug, RegRex, 3, Dw2Inval, Dw2Inval
145db12, Debug, RegRex, 4, Dw2Inval, Dw2Inval
146db13, Debug, RegRex, 5, Dw2Inval, Dw2Inval
147db14, Debug, RegRex, 6, Dw2Inval, Dw2Inval
148db15, Debug, RegRex, 7, Dw2Inval, Dw2Inval
149dr0, Debug, 0, 0, Dw2Inval, Dw2Inval
150dr1, Debug, 0, 1, Dw2Inval, Dw2Inval
151dr2, Debug, 0, 2, Dw2Inval, Dw2Inval
152dr3, Debug, 0, 3, Dw2Inval, Dw2Inval
153dr4, Debug, 0, 4, Dw2Inval, Dw2Inval
154dr5, Debug, 0, 5, Dw2Inval, Dw2Inval
155dr6, Debug, 0, 6, Dw2Inval, Dw2Inval
156dr7, Debug, 0, 7, Dw2Inval, Dw2Inval
157dr8, Debug, RegRex, 0, Dw2Inval, Dw2Inval
158dr9, Debug, RegRex, 1, Dw2Inval, Dw2Inval
159dr10, Debug, RegRex, 2, Dw2Inval, Dw2Inval
160dr11, Debug, RegRex, 3, Dw2Inval, Dw2Inval
161dr12, Debug, RegRex, 4, Dw2Inval, Dw2Inval
162dr13, Debug, RegRex, 5, Dw2Inval, Dw2Inval
163dr14, Debug, RegRex, 6, Dw2Inval, Dw2Inval
164dr15, Debug, RegRex, 7, Dw2Inval, Dw2Inval
165// Test registers.
166tr0, Test, 0, 0, Dw2Inval, Dw2Inval
167tr1, Test, 0, 1, Dw2Inval, Dw2Inval
168tr2, Test, 0, 2, Dw2Inval, Dw2Inval
169tr3, Test, 0, 3, Dw2Inval, Dw2Inval
170tr4, Test, 0, 4, Dw2Inval, Dw2Inval
171tr5, Test, 0, 5, Dw2Inval, Dw2Inval
172tr6, Test, 0, 6, Dw2Inval, Dw2Inval
173tr7, Test, 0, 7, Dw2Inval, Dw2Inval
174// MMX and simd registers.
175mm0, RegMMX, 0, 0, 29, 41
176mm1, RegMMX, 0, 1, 30, 42
177mm2, RegMMX, 0, 2, 31, 43
178mm3, RegMMX, 0, 3, 32, 44
179mm4, RegMMX, 0, 4, 33, 45
180mm5, RegMMX, 0, 5, 34, 46
181mm6, RegMMX, 0, 6, 35, 47
182mm7, RegMMX, 0, 7, 36, 48
183xmm0, RegXMM, 0, 0, 21, 17
184xmm1, RegXMM, 0, 1, 22, 18
185xmm2, RegXMM, 0, 2, 23, 19
186xmm3, RegXMM, 0, 3, 24, 20
187xmm4, RegXMM, 0, 4, 25, 21
188xmm5, RegXMM, 0, 5, 26, 22
189xmm6, RegXMM, 0, 6, 27, 23
190xmm7, RegXMM, 0, 7, 28, 24
191xmm8, RegXMM, RegRex, 0, Dw2Inval, 25
192xmm9, RegXMM, RegRex, 1, Dw2Inval, 26
193xmm10, RegXMM, RegRex, 2, Dw2Inval, 27
194xmm11, RegXMM, RegRex, 3, Dw2Inval, 28
195xmm12, RegXMM, RegRex, 4, Dw2Inval, 29
196xmm13, RegXMM, RegRex, 5, Dw2Inval, 30
197xmm14, RegXMM, RegRex, 6, Dw2Inval, 31
198xmm15, RegXMM, RegRex, 7, Dw2Inval, 32
199xmm16, RegXMM, RegVRex, 0, Dw2Inval, 67
200xmm17, RegXMM, RegVRex, 1, Dw2Inval, 68
201xmm18, RegXMM, RegVRex, 2, Dw2Inval, 69
202xmm19, RegXMM, RegVRex, 3, Dw2Inval, 70
203xmm20, RegXMM, RegVRex, 4, Dw2Inval, 71
204xmm21, RegXMM, RegVRex, 5, Dw2Inval, 72
205xmm22, RegXMM, RegVRex, 6, Dw2Inval, 73
206xmm23, RegXMM, RegVRex, 7, Dw2Inval, 74
207xmm24, RegXMM, RegVRex|RegRex, 0, Dw2Inval, 75
208xmm25, RegXMM, RegVRex|RegRex, 1, Dw2Inval, 76
209xmm26, RegXMM, RegVRex|RegRex, 2, Dw2Inval, 77
210xmm27, RegXMM, RegVRex|RegRex, 3, Dw2Inval, 78
211xmm28, RegXMM, RegVRex|RegRex, 4, Dw2Inval, 79
212xmm29, RegXMM, RegVRex|RegRex, 5, Dw2Inval, 80
213xmm30, RegXMM, RegVRex|RegRex, 6, Dw2Inval, 81
214xmm31, RegXMM, RegVRex|RegRex, 7, Dw2Inval, 82
215// AVX registers.
216ymm0, RegYMM, 0, 0, Dw2Inval, Dw2Inval
217ymm1, RegYMM, 0, 1, Dw2Inval, Dw2Inval
218ymm2, RegYMM, 0, 2, Dw2Inval, Dw2Inval
219ymm3, RegYMM, 0, 3, Dw2Inval, Dw2Inval
220ymm4, RegYMM, 0, 4, Dw2Inval, Dw2Inval
221ymm5, RegYMM, 0, 5, Dw2Inval, Dw2Inval
222ymm6, RegYMM, 0, 6, Dw2Inval, Dw2Inval
223ymm7, RegYMM, 0, 7, Dw2Inval, Dw2Inval
224ymm8, RegYMM, RegRex, 0, Dw2Inval, Dw2Inval
225ymm9, RegYMM, RegRex, 1, Dw2Inval, Dw2Inval
226ymm10, RegYMM, RegRex, 2, Dw2Inval, Dw2Inval
227ymm11, RegYMM, RegRex, 3, Dw2Inval, Dw2Inval
228ymm12, RegYMM, RegRex, 4, Dw2Inval, Dw2Inval
229ymm13, RegYMM, RegRex, 5, Dw2Inval, Dw2Inval
230ymm14, RegYMM, RegRex, 6, Dw2Inval, Dw2Inval
231ymm15, RegYMM, RegRex, 7, Dw2Inval, Dw2Inval
232ymm16, RegYMM, RegVRex, 0, Dw2Inval, Dw2Inval
233ymm17, RegYMM, RegVRex, 1, Dw2Inval, Dw2Inval
234ymm18, RegYMM, RegVRex, 2, Dw2Inval, Dw2Inval
235ymm19, RegYMM, RegVRex, 3, Dw2Inval, Dw2Inval
236ymm20, RegYMM, RegVRex, 4, Dw2Inval, Dw2Inval
237ymm21, RegYMM, RegVRex, 5, Dw2Inval, Dw2Inval
238ymm22, RegYMM, RegVRex, 6, Dw2Inval, Dw2Inval
239ymm23, RegYMM, RegVRex, 7, Dw2Inval, Dw2Inval
240ymm24, RegYMM, RegVRex|RegRex, 0, Dw2Inval, Dw2Inval
241ymm25, RegYMM, RegVRex|RegRex, 1, Dw2Inval, Dw2Inval
242ymm26, RegYMM, RegVRex|RegRex, 2, Dw2Inval, Dw2Inval
243ymm27, RegYMM, RegVRex|RegRex, 3, Dw2Inval, Dw2Inval
244ymm28, RegYMM, RegVRex|RegRex, 4, Dw2Inval, Dw2Inval
245ymm29, RegYMM, RegVRex|RegRex, 5, Dw2Inval, Dw2Inval
246ymm30, RegYMM, RegVRex|RegRex, 6, Dw2Inval, Dw2Inval
247ymm31, RegYMM, RegVRex|RegRex, 7, Dw2Inval, Dw2Inval
248// AVX512 registers.
249zmm0, RegZMM, 0, 0, Dw2Inval, Dw2Inval
250zmm1, RegZMM, 0, 1, Dw2Inval, Dw2Inval
251zmm2, RegZMM, 0, 2, Dw2Inval, Dw2Inval
252zmm3, RegZMM, 0, 3, Dw2Inval, Dw2Inval
253zmm4, RegZMM, 0, 4, Dw2Inval, Dw2Inval
254zmm5, RegZMM, 0, 5, Dw2Inval, Dw2Inval
255zmm6, RegZMM, 0, 6, Dw2Inval, Dw2Inval
256zmm7, RegZMM, 0, 7, Dw2Inval, Dw2Inval
257zmm8, RegZMM, RegRex, 0, Dw2Inval, Dw2Inval
258zmm9, RegZMM, RegRex, 1, Dw2Inval, Dw2Inval
259zmm10, RegZMM, RegRex, 2, Dw2Inval, Dw2Inval
260zmm11, RegZMM, RegRex, 3, Dw2Inval, Dw2Inval
261zmm12, RegZMM, RegRex, 4, Dw2Inval, Dw2Inval
262zmm13, RegZMM, RegRex, 5, Dw2Inval, Dw2Inval
263zmm14, RegZMM, RegRex, 6, Dw2Inval, Dw2Inval
264zmm15, RegZMM, RegRex, 7, Dw2Inval, Dw2Inval
265zmm16, RegZMM, RegVRex, 0, Dw2Inval, Dw2Inval
266zmm17, RegZMM, RegVRex, 1, Dw2Inval, Dw2Inval
267zmm18, RegZMM, RegVRex, 2, Dw2Inval, Dw2Inval
268zmm19, RegZMM, RegVRex, 3, Dw2Inval, Dw2Inval
269zmm20, RegZMM, RegVRex, 4, Dw2Inval, Dw2Inval
270zmm21, RegZMM, RegVRex, 5, Dw2Inval, Dw2Inval
271zmm22, RegZMM, RegVRex, 6, Dw2Inval, Dw2Inval
272zmm23, RegZMM, RegVRex, 7, Dw2Inval, Dw2Inval
273zmm24, RegZMM, RegVRex|RegRex, 0, Dw2Inval, Dw2Inval
274zmm25, RegZMM, RegVRex|RegRex, 1, Dw2Inval, Dw2Inval
275zmm26, RegZMM, RegVRex|RegRex, 2, Dw2Inval, Dw2Inval
276zmm27, RegZMM, RegVRex|RegRex, 3, Dw2Inval, Dw2Inval
277zmm28, RegZMM, RegVRex|RegRex, 4, Dw2Inval, Dw2Inval
278zmm29, RegZMM, RegVRex|RegRex, 5, Dw2Inval, Dw2Inval
279zmm30, RegZMM, RegVRex|RegRex, 6, Dw2Inval, Dw2Inval
280zmm31, RegZMM, RegVRex|RegRex, 7, Dw2Inval, Dw2Inval
281// Bound registers for MPX
282bnd0, RegBND, 0, 0, Dw2Inval, Dw2Inval
283bnd1, RegBND, 0, 1, Dw2Inval, Dw2Inval
284bnd2, RegBND, 0, 2, Dw2Inval, Dw2Inval
285bnd3, RegBND, 0, 3, Dw2Inval, Dw2Inval
286// No type will make these registers rejected for all purposes except
287// for addressing.  This saves creating one extra type for RIP/EIP.
288rip, BaseIndex, RegRex64, RegRip, Dw2Inval, 16
289eip, BaseIndex, RegRex64, RegEip, 8, Dw2Inval
290// No type will make these registers rejected for all purposes except
291// for addressing.
292riz, BaseIndex, RegRex64, RegRiz, Dw2Inval, Dw2Inval
293eiz, BaseIndex, 0, RegEiz, Dw2Inval, Dw2Inval
294// fp regs.
295st(0), FloatReg|FloatAcc, 0, 0, 11, 33
296st(1), FloatReg, 0, 1, 12, 34
297st(2), FloatReg, 0, 2, 13, 35
298st(3), FloatReg, 0, 3, 14, 36
299st(4), FloatReg, 0, 4, 15, 37
300st(5), FloatReg, 0, 5, 16, 38
301st(6), FloatReg, 0, 6, 17, 39
302st(7), FloatReg, 0, 7, 18, 40
303// Pseudo-register names only used in .cfi_* directives
304eflags, 0, 0, 0, 9, 49
305rflags, 0, 0, 0, Dw2Inval, 49
306fs.base, 0, 0, 0, Dw2Inval, 58
307gs.base, 0, 0, 0, Dw2Inval, 59
308tr, 0, 0, 0, 48, 62
309ldtr, 0, 0, 0, 49, 63
310// st0...7 for backward compatibility
311st0, 0, 0, 0, 11, 33
312st1, 0, 0, 1, 12, 34
313st2, 0, 0, 2, 13, 35
314st3, 0, 0, 3, 14, 36
315st4, 0, 0, 4, 15, 37
316st5, 0, 0, 5, 16, 38
317st6, 0, 0, 6, 17, 39
318st7, 0, 0, 7, 18, 40
319fcw, 0, 0, 0, 37, 65
320fsw, 0, 0, 0, 38, 66
321mxcsr, 0, 0, 0, 39, 64
322