blob: 7ed912bd9f1b0a3c1c17a2ee378a94c185b4f217 [file] [log] [blame]
Chris Lattner5da8e802003-08-03 15:47:49 +00001//===- X86.td - Target definition file for the Intel X86 arch ---*- C++ -*-===//
John Criswell29265fe2003-10-21 15:17:13 +00002//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by the LLVM research group and is distributed under
6// the University of Illinois Open Source License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
Chris Lattner5da8e802003-08-03 15:47:49 +00009//
10// This is a target description file for the Intel i386 architecture, refered to
11// here as the "X86" architecture.
12//
13//===----------------------------------------------------------------------===//
14
Chris Lattner25510802003-08-04 04:59:56 +000015// Get the target-independent interfaces which we are implementing...
Chris Lattner5da8e802003-08-03 15:47:49 +000016//
17include "../Target.td"
18
19//===----------------------------------------------------------------------===//
20// Register File Description
21//===----------------------------------------------------------------------===//
22
23include "X86RegisterInfo.td"
24
Chris Lattnera8c3cff2003-08-03 18:19:37 +000025//===----------------------------------------------------------------------===//
26// Instruction Descriptions
27//===----------------------------------------------------------------------===//
28
Chris Lattner59a4a912003-08-03 21:54:21 +000029include "X86InstrInfo.td"
30
Chris Lattnera8c3cff2003-08-03 18:19:37 +000031def X86InstrInfo : InstrInfo {
Chris Lattner59a4a912003-08-03 21:54:21 +000032
33 // Define how we want to layout our TargetSpecific information field... This
34 // should be kept up-to-date with the fields in the X86InstrInfo.h file.
John Criswell10db0622004-04-08 20:31:47 +000035 let TSFlagsFields = ["FormBits",
36 "hasOpSizePrefix",
Evan Cheng11b0a5d2006-09-08 06:48:29 +000037 "hasAdSizePrefix",
John Criswell10db0622004-04-08 20:31:47 +000038 "Prefix",
Evan Cheng11b0a5d2006-09-08 06:48:29 +000039 "hasREX_WPrefix",
John Criswell10db0622004-04-08 20:31:47 +000040 "ImmTypeBits",
41 "FPFormBits",
John Criswell10db0622004-04-08 20:31:47 +000042 "Opcode"];
43 let TSFlagsShifts = [0,
John Criswell10db0622004-04-08 20:31:47 +000044 6,
Evan Cheng9e350cd2006-02-01 06:13:50 +000045 7,
Evan Cheng11b0a5d2006-09-08 06:48:29 +000046 8,
47 12,
Evan Cheng9e350cd2006-02-01 06:13:50 +000048 13,
Evan Cheng11b0a5d2006-09-08 06:48:29 +000049 16,
50 24];
Chris Lattnera8c3cff2003-08-03 18:19:37 +000051}
52
Chris Lattner56832602004-10-03 20:36:57 +000053// The X86 target supports two different syntaxes for emitting machine code.
54// This is controlled by the -x86-asm-syntax={att|intel}
55def ATTAsmWriter : AsmWriter {
56 string AsmWriterClassName = "ATTAsmPrinter";
57 int Variant = 0;
58}
59def IntelAsmWriter : AsmWriter {
60 string AsmWriterClassName = "IntelAsmPrinter";
61 int Variant = 1;
62}
63
64
Chris Lattnera8c3cff2003-08-03 18:19:37 +000065def X86 : Target {
Chris Lattnera8c3cff2003-08-03 18:19:37 +000066 // Information about the instructions...
Chris Lattner25510802003-08-04 04:59:56 +000067 let InstructionSet = X86InstrInfo;
Chris Lattner56832602004-10-03 20:36:57 +000068
69 let AssemblyWriters = [ATTAsmWriter, IntelAsmWriter];
Chris Lattnera8c3cff2003-08-03 18:19:37 +000070}