X86RegisterInfo.td revision bed23081860275c79137f65d592920e7991b8198
1//===- X86RegisterInfo.td - Describe the X86 Register File --*- tablegen -*-==//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file describes the X86 Register file, defining the registers themselves,
11// aliases between the registers, and the register classes built out of the
12// registers.
13//
14//===----------------------------------------------------------------------===//
15
16class X86Reg<string n, bits<16> Enc, list<Register> subregs = []> : Register<n> {
17  let Namespace = "X86";
18  let HWEncoding = Enc;
19  let SubRegs = subregs;
20}
21
22// Subregister indices.
23let Namespace = "X86" in {
24  def sub_8bit    : SubRegIndex<8>;
25  def sub_8bit_hi : SubRegIndex<8, 8>;
26  def sub_16bit   : SubRegIndex<16>;
27  def sub_32bit   : SubRegIndex<32>;
28  def sub_xmm     : SubRegIndex<64>;
29}
30
31//===----------------------------------------------------------------------===//
32//  Register definitions...
33//
34
35// In the register alias definitions below, we define which registers alias
36// which others.  We only specify which registers the small registers alias,
37// because the register file generator is smart enough to figure out that
38// AL aliases AX if we tell it that AX aliased AL (for example).
39
40// Dwarf numbering is different for 32-bit and 64-bit, and there are
41// variations by target as well. Currently the first entry is for X86-64,
42// second - for EH on X86-32/Darwin and third is 'generic' one (X86-32/Linux
43// and debug information on X86-32/Darwin)
44
45// 8-bit registers
46// Low registers
47def AL : X86Reg<"al", 0>;
48def DL : X86Reg<"dl", 2>;
49def CL : X86Reg<"cl", 1>;
50def BL : X86Reg<"bl", 3>;
51
52// High registers. On x86-64, these cannot be used in any instruction
53// with a REX prefix.
54def AH : X86Reg<"ah", 4>;
55def DH : X86Reg<"dh", 6>;
56def CH : X86Reg<"ch", 5>;
57def BH : X86Reg<"bh", 7>;
58
59// X86-64 only, requires REX.
60let CostPerUse = 1 in {
61def SIL  : X86Reg<"sil",   6>;
62def DIL  : X86Reg<"dil",   7>;
63def BPL  : X86Reg<"bpl",   5>;
64def SPL  : X86Reg<"spl",   4>;
65def R8B  : X86Reg<"r8b",   8>;
66def R9B  : X86Reg<"r9b",   9>;
67def R10B : X86Reg<"r10b", 10>;
68def R11B : X86Reg<"r11b", 11>;
69def R12B : X86Reg<"r12b", 12>;
70def R13B : X86Reg<"r13b", 13>;
71def R14B : X86Reg<"r14b", 14>;
72def R15B : X86Reg<"r15b", 15>;
73}
74
75// 16-bit registers
76let SubRegIndices = [sub_8bit, sub_8bit_hi], CoveredBySubRegs = 1 in {
77def AX : X86Reg<"ax", 0, [AL,AH]>;
78def DX : X86Reg<"dx", 2, [DL,DH]>;
79def CX : X86Reg<"cx", 1, [CL,CH]>;
80def BX : X86Reg<"bx", 3, [BL,BH]>;
81}
82let SubRegIndices = [sub_8bit] in {
83def SI : X86Reg<"si", 6, [SIL]>;
84def DI : X86Reg<"di", 7, [DIL]>;
85def BP : X86Reg<"bp", 5, [BPL]>;
86def SP : X86Reg<"sp", 4, [SPL]>;
87}
88def IP : X86Reg<"ip", 0>;
89
90// X86-64 only, requires REX.
91let SubRegIndices = [sub_8bit], CostPerUse = 1 in {
92def R8W  : X86Reg<"r8w",   8, [R8B]>;
93def R9W  : X86Reg<"r9w",   9, [R9B]>;
94def R10W : X86Reg<"r10w", 10, [R10B]>;
95def R11W : X86Reg<"r11w", 11, [R11B]>;
96def R12W : X86Reg<"r12w", 12, [R12B]>;
97def R13W : X86Reg<"r13w", 13, [R13B]>;
98def R14W : X86Reg<"r14w", 14, [R14B]>;
99def R15W : X86Reg<"r15w", 15, [R15B]>;
100}
101
102// 32-bit registers
103let SubRegIndices = [sub_16bit] in {
104def EAX : X86Reg<"eax", 0, [AX]>, DwarfRegNum<[-2, 0, 0]>;
105def EDX : X86Reg<"edx", 2, [DX]>, DwarfRegNum<[-2, 2, 2]>;
106def ECX : X86Reg<"ecx", 1, [CX]>, DwarfRegNum<[-2, 1, 1]>;
107def EBX : X86Reg<"ebx", 3, [BX]>, DwarfRegNum<[-2, 3, 3]>;
108def ESI : X86Reg<"esi", 6, [SI]>, DwarfRegNum<[-2, 6, 6]>;
109def EDI : X86Reg<"edi", 7, [DI]>, DwarfRegNum<[-2, 7, 7]>;
110def EBP : X86Reg<"ebp", 5, [BP]>, DwarfRegNum<[-2, 4, 5]>;
111def ESP : X86Reg<"esp", 4, [SP]>, DwarfRegNum<[-2, 5, 4]>;
112def EIP : X86Reg<"eip", 0, [IP]>, DwarfRegNum<[-2, 8, 8]>;
113
114// X86-64 only, requires REX
115let CostPerUse = 1 in {
116def R8D  : X86Reg<"r8d",   8, [R8W]>;
117def R9D  : X86Reg<"r9d",   9, [R9W]>;
118def R10D : X86Reg<"r10d", 10, [R10W]>;
119def R11D : X86Reg<"r11d", 11, [R11W]>;
120def R12D : X86Reg<"r12d", 12, [R12W]>;
121def R13D : X86Reg<"r13d", 13, [R13W]>;
122def R14D : X86Reg<"r14d", 14, [R14W]>;
123def R15D : X86Reg<"r15d", 15, [R15W]>;
124}}
125
126// 64-bit registers, X86-64 only
127let SubRegIndices = [sub_32bit] in {
128def RAX : X86Reg<"rax", 0, [EAX]>, DwarfRegNum<[0, -2, -2]>;
129def RDX : X86Reg<"rdx", 2, [EDX]>, DwarfRegNum<[1, -2, -2]>;
130def RCX : X86Reg<"rcx", 1, [ECX]>, DwarfRegNum<[2, -2, -2]>;
131def RBX : X86Reg<"rbx", 3, [EBX]>, DwarfRegNum<[3, -2, -2]>;
132def RSI : X86Reg<"rsi", 6, [ESI]>, DwarfRegNum<[4, -2, -2]>;
133def RDI : X86Reg<"rdi", 7, [EDI]>, DwarfRegNum<[5, -2, -2]>;
134def RBP : X86Reg<"rbp", 5, [EBP]>, DwarfRegNum<[6, -2, -2]>;
135def RSP : X86Reg<"rsp", 4, [ESP]>, DwarfRegNum<[7, -2, -2]>;
136
137// These also require REX.
138let CostPerUse = 1 in {
139def R8  : X86Reg<"r8",   8, [R8D]>,  DwarfRegNum<[ 8, -2, -2]>;
140def R9  : X86Reg<"r9",   9, [R9D]>,  DwarfRegNum<[ 9, -2, -2]>;
141def R10 : X86Reg<"r10", 10, [R10D]>, DwarfRegNum<[10, -2, -2]>;
142def R11 : X86Reg<"r11", 11, [R11D]>, DwarfRegNum<[11, -2, -2]>;
143def R12 : X86Reg<"r12", 12, [R12D]>, DwarfRegNum<[12, -2, -2]>;
144def R13 : X86Reg<"r13", 13, [R13D]>, DwarfRegNum<[13, -2, -2]>;
145def R14 : X86Reg<"r14", 14, [R14D]>, DwarfRegNum<[14, -2, -2]>;
146def R15 : X86Reg<"r15", 15, [R15D]>, DwarfRegNum<[15, -2, -2]>;
147def RIP : X86Reg<"rip",  0, [EIP]>,  DwarfRegNum<[16, -2, -2]>;
148}}
149
150// MMX Registers. These are actually aliased to ST0 .. ST7
151def MM0 : X86Reg<"mm0", 0>, DwarfRegNum<[41, 29, 29]>;
152def MM1 : X86Reg<"mm1", 1>, DwarfRegNum<[42, 30, 30]>;
153def MM2 : X86Reg<"mm2", 2>, DwarfRegNum<[43, 31, 31]>;
154def MM3 : X86Reg<"mm3", 3>, DwarfRegNum<[44, 32, 32]>;
155def MM4 : X86Reg<"mm4", 4>, DwarfRegNum<[45, 33, 33]>;
156def MM5 : X86Reg<"mm5", 5>, DwarfRegNum<[46, 34, 34]>;
157def MM6 : X86Reg<"mm6", 6>, DwarfRegNum<[47, 35, 35]>;
158def MM7 : X86Reg<"mm7", 7>, DwarfRegNum<[48, 36, 36]>;
159
160// Pseudo Floating Point registers
161def FP0 : X86Reg<"fp0", 0>;
162def FP1 : X86Reg<"fp1", 0>;
163def FP2 : X86Reg<"fp2", 0>;
164def FP3 : X86Reg<"fp3", 0>;
165def FP4 : X86Reg<"fp4", 0>;
166def FP5 : X86Reg<"fp5", 0>;
167def FP6 : X86Reg<"fp6", 0>;
168
169// XMM Registers, used by the various SSE instruction set extensions.
170def XMM0: X86Reg<"xmm0", 0>, DwarfRegNum<[17, 21, 21]>;
171def XMM1: X86Reg<"xmm1", 1>, DwarfRegNum<[18, 22, 22]>;
172def XMM2: X86Reg<"xmm2", 2>, DwarfRegNum<[19, 23, 23]>;
173def XMM3: X86Reg<"xmm3", 3>, DwarfRegNum<[20, 24, 24]>;
174def XMM4: X86Reg<"xmm4", 4>, DwarfRegNum<[21, 25, 25]>;
175def XMM5: X86Reg<"xmm5", 5>, DwarfRegNum<[22, 26, 26]>;
176def XMM6: X86Reg<"xmm6", 6>, DwarfRegNum<[23, 27, 27]>;
177def XMM7: X86Reg<"xmm7", 7>, DwarfRegNum<[24, 28, 28]>;
178
179// X86-64 only
180let CostPerUse = 1 in {
181def XMM8:  X86Reg<"xmm8",   8>, DwarfRegNum<[25, -2, -2]>;
182def XMM9:  X86Reg<"xmm9",   9>, DwarfRegNum<[26, -2, -2]>;
183def XMM10: X86Reg<"xmm10", 10>, DwarfRegNum<[27, -2, -2]>;
184def XMM11: X86Reg<"xmm11", 11>, DwarfRegNum<[28, -2, -2]>;
185def XMM12: X86Reg<"xmm12", 12>, DwarfRegNum<[29, -2, -2]>;
186def XMM13: X86Reg<"xmm13", 13>, DwarfRegNum<[30, -2, -2]>;
187def XMM14: X86Reg<"xmm14", 14>, DwarfRegNum<[31, -2, -2]>;
188def XMM15: X86Reg<"xmm15", 15>, DwarfRegNum<[32, -2, -2]>;
189} // CostPerUse
190
191// YMM Registers, used by AVX instructions
192let SubRegIndices = [sub_xmm] in {
193def YMM0:  X86Reg<"ymm0",   0, [XMM0]>,  DwarfRegAlias<XMM0>;
194def YMM1:  X86Reg<"ymm1",   1, [XMM1]>,  DwarfRegAlias<XMM1>;
195def YMM2:  X86Reg<"ymm2",   2, [XMM2]>,  DwarfRegAlias<XMM2>;
196def YMM3:  X86Reg<"ymm3",   3, [XMM3]>,  DwarfRegAlias<XMM3>;
197def YMM4:  X86Reg<"ymm4",   4, [XMM4]>,  DwarfRegAlias<XMM4>;
198def YMM5:  X86Reg<"ymm5",   5, [XMM5]>,  DwarfRegAlias<XMM5>;
199def YMM6:  X86Reg<"ymm6",   6, [XMM6]>,  DwarfRegAlias<XMM6>;
200def YMM7:  X86Reg<"ymm7",   7, [XMM7]>,  DwarfRegAlias<XMM7>;
201def YMM8:  X86Reg<"ymm8",   8, [XMM8]>,  DwarfRegAlias<XMM8>;
202def YMM9:  X86Reg<"ymm9",   9, [XMM9]>,  DwarfRegAlias<XMM9>;
203def YMM10: X86Reg<"ymm10", 10, [XMM10]>, DwarfRegAlias<XMM10>;
204def YMM11: X86Reg<"ymm11", 11, [XMM11]>, DwarfRegAlias<XMM11>;
205def YMM12: X86Reg<"ymm12", 12, [XMM12]>, DwarfRegAlias<XMM12>;
206def YMM13: X86Reg<"ymm13", 13, [XMM13]>, DwarfRegAlias<XMM13>;
207def YMM14: X86Reg<"ymm14", 14, [XMM14]>, DwarfRegAlias<XMM14>;
208def YMM15: X86Reg<"ymm15", 15, [XMM15]>, DwarfRegAlias<XMM15>;
209}
210
211class STRegister<string n, bits<16> Enc, list<Register> A> : X86Reg<n, Enc> {
212  let Aliases = A;
213}
214
215// Floating point stack registers. These don't map one-to-one to the FP
216// pseudo registers, but we still mark them as aliasing FP registers. That
217// way both kinds can be live without exceeding the stack depth. ST registers
218// are only live around inline assembly.
219def ST0 : STRegister<"st(0)", 0, []>,    DwarfRegNum<[33, 12, 11]>;
220def ST1 : STRegister<"st(1)", 1, [FP6]>, DwarfRegNum<[34, 13, 12]>;
221def ST2 : STRegister<"st(2)", 2, [FP5]>, DwarfRegNum<[35, 14, 13]>;
222def ST3 : STRegister<"st(3)", 3, [FP4]>, DwarfRegNum<[36, 15, 14]>;
223def ST4 : STRegister<"st(4)", 4, [FP3]>, DwarfRegNum<[37, 16, 15]>;
224def ST5 : STRegister<"st(5)", 5, [FP2]>, DwarfRegNum<[38, 17, 16]>;
225def ST6 : STRegister<"st(6)", 6, [FP1]>, DwarfRegNum<[39, 18, 17]>;
226def ST7 : STRegister<"st(7)", 7, [FP0]>, DwarfRegNum<[40, 19, 18]>;
227
228// Floating-point status word
229def FPSW : X86Reg<"fpsw", 0>;
230
231// Status flags register
232def EFLAGS : X86Reg<"flags", 0>;
233
234// Segment registers
235def CS : X86Reg<"cs", 1>;
236def DS : X86Reg<"ds", 3>;
237def SS : X86Reg<"ss", 2>;
238def ES : X86Reg<"es", 0>;
239def FS : X86Reg<"fs", 4>;
240def GS : X86Reg<"gs", 5>;
241
242// Debug registers
243def DR0 : X86Reg<"dr0", 0>;
244def DR1 : X86Reg<"dr1", 1>;
245def DR2 : X86Reg<"dr2", 2>;
246def DR3 : X86Reg<"dr3", 3>;
247def DR4 : X86Reg<"dr4", 4>;
248def DR5 : X86Reg<"dr5", 5>;
249def DR6 : X86Reg<"dr6", 6>;
250def DR7 : X86Reg<"dr7", 7>;
251
252// Control registers
253def CR0  : X86Reg<"cr0",   0>;
254def CR1  : X86Reg<"cr1",   1>;
255def CR2  : X86Reg<"cr2",   2>;
256def CR3  : X86Reg<"cr3",   3>;
257def CR4  : X86Reg<"cr4",   4>;
258def CR5  : X86Reg<"cr5",   5>;
259def CR6  : X86Reg<"cr6",   6>;
260def CR7  : X86Reg<"cr7",   7>;
261def CR8  : X86Reg<"cr8",   8>;
262def CR9  : X86Reg<"cr9",   9>;
263def CR10 : X86Reg<"cr10", 10>;
264def CR11 : X86Reg<"cr11", 11>;
265def CR12 : X86Reg<"cr12", 12>;
266def CR13 : X86Reg<"cr13", 13>;
267def CR14 : X86Reg<"cr14", 14>;
268def CR15 : X86Reg<"cr15", 15>;
269
270// Pseudo index registers
271def EIZ : X86Reg<"eiz", 4>;
272def RIZ : X86Reg<"riz", 4>;
273
274
275//===----------------------------------------------------------------------===//
276// Register Class Definitions... now that we have all of the pieces, define the
277// top-level register classes.  The order specified in the register list is
278// implicitly defined to be the register allocation order.
279//
280
281// List call-clobbered registers before callee-save registers. RBX, RBP, (and
282// R12, R13, R14, and R15 for X86-64) are callee-save registers.
283// In 64-mode, there are 12 additional i8 registers, SIL, DIL, BPL, SPL, and
284// R8B, ... R15B.
285// Allocate R12 and R13 last, as these require an extra byte when
286// encoded in x86_64 instructions.
287// FIXME: Allow AH, CH, DH, BH to be used as general-purpose registers in
288// 64-bit mode. The main complication is that they cannot be encoded in an
289// instruction requiring a REX prefix, while SIL, DIL, BPL, R8D, etc.
290// require a REX prefix. For example, "addb %ah, %dil" and "movzbl %ah, %r8d"
291// cannot be encoded.
292def GR8 : RegisterClass<"X86", [i8],  8,
293                        (add AL, CL, DL, AH, CH, DH, BL, BH, SIL, DIL, BPL, SPL,
294                             R8B, R9B, R10B, R11B, R14B, R15B, R12B, R13B)> {
295  let AltOrders = [(sub GR8, AH, BH, CH, DH)];
296  let AltOrderSelect = [{
297    return MF.getTarget().getSubtarget<X86Subtarget>().is64Bit();
298  }];
299}
300
301def GR16 : RegisterClass<"X86", [i16], 16,
302                         (add AX, CX, DX, SI, DI, BX, BP, SP,
303                              R8W, R9W, R10W, R11W, R14W, R15W, R12W, R13W)>;
304
305def GR32 : RegisterClass<"X86", [i32], 32,
306                         (add EAX, ECX, EDX, ESI, EDI, EBX, EBP, ESP,
307                              R8D, R9D, R10D, R11D, R14D, R15D, R12D, R13D)>;
308
309// GR64 - 64-bit GPRs. This oddly includes RIP, which isn't accurate, since
310// RIP isn't really a register and it can't be used anywhere except in an
311// address, but it doesn't cause trouble.
312def GR64 : RegisterClass<"X86", [i64], 64,
313                         (add RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11,
314                              RBX, R14, R15, R12, R13, RBP, RSP, RIP)>;
315
316// Segment registers for use by MOV instructions (and others) that have a
317//   segment register as one operand.  Always contain a 16-bit segment
318//   descriptor.
319def SEGMENT_REG : RegisterClass<"X86", [i16], 16, (add CS, DS, SS, ES, FS, GS)>;
320
321// Debug registers.
322def DEBUG_REG : RegisterClass<"X86", [i32], 32, (sequence "DR%u", 0, 7)>;
323
324// Control registers.
325def CONTROL_REG : RegisterClass<"X86", [i64], 64, (sequence "CR%u", 0, 15)>;
326
327// GR8_ABCD_L, GR8_ABCD_H, GR16_ABCD, GR32_ABCD, GR64_ABCD - Subclasses of
328// GR8, GR16, GR32, and GR64 which contain just the "a" "b", "c", and "d"
329// registers. On x86-32, GR16_ABCD and GR32_ABCD are classes for registers
330// that support 8-bit subreg operations. On x86-64, GR16_ABCD, GR32_ABCD,
331// and GR64_ABCD are classes for registers that support 8-bit h-register
332// operations.
333def GR8_ABCD_L : RegisterClass<"X86", [i8], 8, (add AL, CL, DL, BL)>;
334def GR8_ABCD_H : RegisterClass<"X86", [i8], 8, (add AH, CH, DH, BH)>;
335def GR16_ABCD : RegisterClass<"X86", [i16], 16, (add AX, CX, DX, BX)>;
336def GR32_ABCD : RegisterClass<"X86", [i32], 32, (add EAX, ECX, EDX, EBX)>;
337def GR64_ABCD : RegisterClass<"X86", [i64], 64, (add RAX, RCX, RDX, RBX)>;
338def GR32_TC   : RegisterClass<"X86", [i32], 32, (add EAX, ECX, EDX)>;
339def GR64_TC   : RegisterClass<"X86", [i64], 64, (add RAX, RCX, RDX, RSI, RDI,
340                                                     R8, R9, R11, RIP)>;
341def GR64_TCW64 : RegisterClass<"X86", [i64], 64, (add RAX, RCX, RDX,
342                                                      R8, R9, R11)>;
343
344// GR8_NOREX - GR8 registers which do not require a REX prefix.
345def GR8_NOREX : RegisterClass<"X86", [i8], 8,
346                              (add AL, CL, DL, AH, CH, DH, BL, BH)> {
347  let AltOrders = [(sub GR8_NOREX, AH, BH, CH, DH)];
348  let AltOrderSelect = [{
349    return MF.getTarget().getSubtarget<X86Subtarget>().is64Bit();
350  }];
351}
352// GR16_NOREX - GR16 registers which do not require a REX prefix.
353def GR16_NOREX : RegisterClass<"X86", [i16], 16,
354                               (add AX, CX, DX, SI, DI, BX, BP, SP)>;
355// GR32_NOREX - GR32 registers which do not require a REX prefix.
356def GR32_NOREX : RegisterClass<"X86", [i32], 32,
357                               (add EAX, ECX, EDX, ESI, EDI, EBX, EBP, ESP)>;
358// GR64_NOREX - GR64 registers which do not require a REX prefix.
359def GR64_NOREX : RegisterClass<"X86", [i64], 64,
360                            (add RAX, RCX, RDX, RSI, RDI, RBX, RBP, RSP, RIP)>;
361
362// GR32_NOAX - GR32 registers except EAX. Used by AddRegFrm of XCHG32 in 64-bit
363// mode to prevent encoding using the 0x90 NOP encoding. xchg %eax, %eax needs
364// to clear upper 32-bits of RAX so is not a NOP.
365def GR32_NOAX : RegisterClass<"X86", [i32], 32, (sub GR32, EAX)>;
366
367// GR32_NOSP - GR32 registers except ESP.
368def GR32_NOSP : RegisterClass<"X86", [i32], 32, (sub GR32, ESP)>;
369
370// GR64_NOSP - GR64 registers except RSP (and RIP).
371def GR64_NOSP : RegisterClass<"X86", [i64], 64, (sub GR64, RSP, RIP)>;
372
373// GR32_NOREX_NOSP - GR32 registers which do not require a REX prefix except
374// ESP.
375def GR32_NOREX_NOSP : RegisterClass<"X86", [i32], 32,
376                                    (and GR32_NOREX, GR32_NOSP)>;
377
378// GR64_NOREX_NOSP - GR64_NOREX registers except RSP.
379def GR64_NOREX_NOSP : RegisterClass<"X86", [i64], 64,
380                                    (and GR64_NOREX, GR64_NOSP)>;
381
382// A class to support the 'A' assembler constraint: EAX then EDX.
383def GR32_AD : RegisterClass<"X86", [i32], 32, (add EAX, EDX)>;
384
385// Scalar SSE2 floating point registers.
386def FR32 : RegisterClass<"X86", [f32], 32, (sequence "XMM%u", 0, 15)>;
387
388def FR64 : RegisterClass<"X86", [f64], 64, (add FR32)>;
389
390
391// FIXME: This sets up the floating point register files as though they are f64
392// values, though they really are f80 values.  This will cause us to spill
393// values as 64-bit quantities instead of 80-bit quantities, which is much much
394// faster on common hardware.  In reality, this should be controlled by a
395// command line option or something.
396
397def RFP32 : RegisterClass<"X86",[f32], 32, (sequence "FP%u", 0, 6)>;
398def RFP64 : RegisterClass<"X86",[f64], 32, (add RFP32)>;
399def RFP80 : RegisterClass<"X86",[f80], 32, (add RFP32)>;
400
401// Floating point stack registers (these are not allocatable by the
402// register allocator - the floating point stackifier is responsible
403// for transforming FPn allocations to STn registers)
404def RST : RegisterClass<"X86", [f80, f64, f32], 32, (sequence "ST%u", 0, 7)> {
405  let isAllocatable = 0;
406}
407
408// Generic vector registers: VR64 and VR128.
409def VR64: RegisterClass<"X86", [x86mmx], 64, (sequence "MM%u", 0, 7)>;
410def VR128 : RegisterClass<"X86", [v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
411                          128, (add FR32)>;
412def VR256 : RegisterClass<"X86", [v32i8, v16i16, v8i32, v4i64, v8f32, v4f64],
413                          256, (sequence "YMM%u", 0, 15)>;
414
415// Status flags registers.
416def CCR : RegisterClass<"X86", [i32], 32, (add EFLAGS)> {
417  let CopyCost = -1;  // Don't allow copying of status registers.
418  let isAllocatable = 0;
419}
420def FPCCR : RegisterClass<"X86", [i16], 16, (add FPSW)> {
421  let CopyCost = -1;  // Don't allow copying of status registers.
422  let isAllocatable = 0;
423}
424