blob: feff9307be9345859cc904fd2d747155e6f6ceea [file] [log] [blame]
Jim Laskey8e8de8f2006-09-07 22:05:02 +00001//===-- X86TargetAsmInfo.cpp - X86 asm properties ---------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Jim Laskey8e8de8f2006-09-07 22:05:02 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file contains the declarations of the X86TargetAsmInfo properties.
11//
12//===----------------------------------------------------------------------===//
13
14#include "X86TargetAsmInfo.h"
15#include "X86TargetMachine.h"
16#include "X86Subtarget.h"
Reid Spencer7aa8a452007-01-12 23:22:14 +000017#include "llvm/DerivedTypes.h"
Chris Lattner625bd052006-11-29 01:14:06 +000018#include "llvm/InlineAsm.h"
19#include "llvm/Instructions.h"
Chris Lattner3e9f1d02007-04-01 20:49:36 +000020#include "llvm/Intrinsics.h"
Chris Lattner625bd052006-11-29 01:14:06 +000021#include "llvm/Module.h"
22#include "llvm/ADT/StringExtras.h"
Anton Korobeynikovcee750f2008-02-27 23:33:50 +000023#include "llvm/Support/Dwarf.h"
24
Jim Laskey8e8de8f2006-09-07 22:05:02 +000025using namespace llvm;
Anton Korobeynikovcee750f2008-02-27 23:33:50 +000026using namespace llvm::dwarf;
Jim Laskey8e8de8f2006-09-07 22:05:02 +000027
Anton Korobeynikov32b952a2008-09-25 21:00:33 +000028const char *const llvm::x86_asm_table[] = {
29 "{si}", "S",
30 "{di}", "D",
31 "{ax}", "a",
32 "{cx}", "c",
33 "{memory}", "memory",
34 "{flags}", "",
35 "{dirflag}", "",
36 "{fpsr}", "",
37 "{cc}", "cc",
38 0,0};
Andrew Lenharth6c0695f2006-11-28 19:52:49 +000039
Anton Korobeynikov4468b7a2008-07-09 13:20:48 +000040X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM):
Anton Korobeynikov32b952a2008-09-25 21:00:33 +000041 X86TargetAsmInfo<DarwinTargetAsmInfo>(TM) {
Dan Gohman8f092252008-11-03 18:22:42 +000042 const X86Subtarget* Subtarget = &TM.getSubtarget<X86Subtarget>();
Anton Korobeynikov16b7f512008-08-08 18:25:52 +000043 bool is64Bit = Subtarget->is64Bit();
Anton Korobeynikov4468b7a2008-07-09 13:20:48 +000044
45 AlignmentIsInBytes = false;
46 TextAlignFillValue = 0x90;
47 GlobalPrefix = "_";
48 if (!is64Bit)
49 Data64bitsDirective = 0; // we can't emit a 64-bit unit
50 ZeroDirective = "\t.space\t"; // ".space N" emits N zeros.
51 PrivateGlobalPrefix = "L"; // Marker for constant pool idxs
Dale Johannesenb2dfb892008-09-09 01:21:22 +000052 LessPrivateGlobalPrefix = "l"; // Marker for some ObjC metadata
Anton Korobeynikov4468b7a2008-07-09 13:20:48 +000053 BSSSection = 0; // no BSS section.
54 ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill
Dan Gohman8f092252008-11-03 18:22:42 +000055 if (TM.getRelocationModel() != Reloc::Static)
Anton Korobeynikov7705ea32008-07-09 21:54:26 +000056 ConstantPoolSection = "\t.const_data";
57 else
58 ConstantPoolSection = "\t.const\n";
Anton Korobeynikov4468b7a2008-07-09 13:20:48 +000059 JumpTableDataSection = "\t.const\n";
60 CStringSection = "\t.cstring";
Anton Korobeynikov4468b7a2008-07-09 13:20:48 +000061 // FIXME: Why don't always use this section?
Anton Korobeynikov0d44ba82008-07-09 13:28:49 +000062 if (is64Bit) {
Anton Korobeynikov64818732008-09-24 22:18:54 +000063 SixteenByteConstantSection = getUnnamedSection("\t.literal16\n",
64 SectionFlags::Mergeable);
Anton Korobeynikov0d44ba82008-07-09 13:28:49 +000065 }
Anton Korobeynikov4468b7a2008-07-09 13:20:48 +000066 LCOMMDirective = "\t.lcomm\t";
67 SwitchToSectionDirective = "\t.section ";
68 StringConstantPrefix = "\1LC";
Anton Korobeynikov16b7f512008-08-08 18:25:52 +000069 // Leopard and above support aligned common symbols.
70 COMMDirectiveTakesAlignment = (Subtarget->getDarwinVers() >= 9);
Anton Korobeynikov4468b7a2008-07-09 13:20:48 +000071 HasDotTypeDotSizeDirective = false;
Rafael Espindola952b8392008-12-03 11:01:37 +000072 HasSingleParameterDotFile = false;
Anton Korobeynikov4468b7a2008-07-09 13:20:48 +000073 if (TM.getRelocationModel() == Reloc::Static) {
74 StaticCtorsSection = ".constructor";
75 StaticDtorsSection = ".destructor";
76 } else {
77 StaticCtorsSection = ".mod_init_func";
78 StaticDtorsSection = ".mod_term_func";
79 }
80 if (is64Bit) {
81 PersonalityPrefix = "";
82 PersonalitySuffix = "+4@GOTPCREL";
83 } else {
84 PersonalityPrefix = "L";
85 PersonalitySuffix = "$non_lazy_ptr";
86 }
87 NeedsIndirectEncoding = true;
88 InlineAsmStart = "## InlineAsm Start";
89 InlineAsmEnd = "## InlineAsm End";
90 CommentString = "##";
91 SetDirective = "\t.set";
92 PCSymbol = ".";
93 UsedDirective = "\t.no_dead_strip\t";
94 WeakDefDirective = "\t.weak_definition ";
95 WeakRefDirective = "\t.weak_reference ";
96 HiddenDirective = "\t.private_extern ";
97 ProtectedDirective = "\t.globl\t";
98
99 // In non-PIC modes, emit a special label before jump tables so that the
100 // linker can perform more accurate dead code stripping.
101 if (TM.getRelocationModel() != Reloc::PIC_) {
102 // Emit a local label that is preserved until the linker runs.
103 JumpTableSpecialLabelPrefix = "l";
104 }
105
106 SupportsDebugInformation = true;
107 NeedsSet = true;
108 DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug";
109 DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug";
110 DwarfLineSection = ".section __DWARF,__debug_line,regular,debug";
111 DwarfFrameSection = ".section __DWARF,__debug_frame,regular,debug";
112 DwarfPubNamesSection = ".section __DWARF,__debug_pubnames,regular,debug";
113 DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes,regular,debug";
114 DwarfStrSection = ".section __DWARF,__debug_str,regular,debug";
115 DwarfLocSection = ".section __DWARF,__debug_loc,regular,debug";
116 DwarfARangesSection = ".section __DWARF,__debug_aranges,regular,debug";
117 DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug";
118 DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
119
120 // Exceptions handling
121 SupportsExceptionHandling = true;
122 GlobalEHDirective = "\t.globl\t";
123 SupportsWeakOmittedEHFrame = false;
124 AbsoluteEHSectionOffsets = false;
125 DwarfEHFrameSection =
126 ".section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support";
127 DwarfExceptionSection = ".section __DATA,__gcc_except_tab";
128}
129
Anton Korobeynikovb9e58ef2008-07-09 13:21:08 +0000130unsigned
131X86DarwinTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason,
132 bool Global) const {
133 if (Reason == DwarfEncoding::Functions && Global)
134 return (DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4);
135 else if (Reason == DwarfEncoding::CodeLabels || !Global)
136 return DW_EH_PE_pcrel;
137 else
138 return DW_EH_PE_absptr;
139}
140
Anton Korobeynikov4468b7a2008-07-09 13:20:48 +0000141X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const X86TargetMachine &TM):
Anton Korobeynikov32b952a2008-09-25 21:00:33 +0000142 X86TargetAsmInfo<ELFTargetAsmInfo>(TM) {
Anton Korobeynikov0d44ba82008-07-09 13:28:49 +0000143
Anton Korobeynikovb20015b2008-07-09 13:25:26 +0000144 CStringSection = ".rodata.str";
Anton Korobeynikov4468b7a2008-07-09 13:20:48 +0000145 PrivateGlobalPrefix = ".L";
146 WeakRefDirective = "\t.weak\t";
147 SetDirective = "\t.set\t";
148 PCSymbol = ".";
149
150 // Set up DWARF directives
151 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
152
153 // Debug Information
154 AbsoluteDebugSectionOffsets = true;
155 SupportsDebugInformation = true;
156 DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"\",@progbits";
157 DwarfInfoSection = "\t.section\t.debug_info,\"\",@progbits";
158 DwarfLineSection = "\t.section\t.debug_line,\"\",@progbits";
159 DwarfFrameSection = "\t.section\t.debug_frame,\"\",@progbits";
160 DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"\",@progbits";
161 DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"\",@progbits";
162 DwarfStrSection = "\t.section\t.debug_str,\"\",@progbits";
163 DwarfLocSection = "\t.section\t.debug_loc,\"\",@progbits";
164 DwarfARangesSection = "\t.section\t.debug_aranges,\"\",@progbits";
165 DwarfRangesSection = "\t.section\t.debug_ranges,\"\",@progbits";
166 DwarfMacInfoSection = "\t.section\t.debug_macinfo,\"\",@progbits";
167
168 // Exceptions handling
Anton Korobeynikovc4da15a2008-09-08 21:13:08 +0000169 SupportsExceptionHandling = true;
Anton Korobeynikov4468b7a2008-07-09 13:20:48 +0000170 AbsoluteEHSectionOffsets = false;
171 DwarfEHFrameSection = "\t.section\t.eh_frame,\"aw\",@progbits";
172 DwarfExceptionSection = "\t.section\t.gcc_except_table,\"a\",@progbits";
173
174 // On Linux we must declare when we can use a non-executable stack.
Dan Gohman8f092252008-11-03 18:22:42 +0000175 if (TM.getSubtarget<X86Subtarget>().isLinux())
Anton Korobeynikov4468b7a2008-07-09 13:20:48 +0000176 NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\",@progbits";
177}
178
Anton Korobeynikovb9e58ef2008-07-09 13:21:08 +0000179unsigned
180X86ELFTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason,
181 bool Global) const {
Dan Gohman8f092252008-11-03 18:22:42 +0000182 CodeModel::Model CM = TM.getCodeModel();
183 bool is64Bit = TM.getSubtarget<X86Subtarget>().is64Bit();
Anton Korobeynikovb9e58ef2008-07-09 13:21:08 +0000184
Dan Gohman8f092252008-11-03 18:22:42 +0000185 if (TM.getRelocationModel() == Reloc::PIC_) {
Anton Korobeynikovb9e58ef2008-07-09 13:21:08 +0000186 unsigned Format = 0;
187
188 if (!is64Bit)
189 // 32 bit targets always encode pointers as 4 bytes
190 Format = DW_EH_PE_sdata4;
191 else {
192 // 64 bit targets encode pointers in 4 bytes iff:
193 // - code model is small OR
194 // - code model is medium and we're emitting externally visible symbols
195 // or any code symbols
196 if (CM == CodeModel::Small ||
197 (CM == CodeModel::Medium && (Global ||
198 Reason != DwarfEncoding::Data)))
199 Format = DW_EH_PE_sdata4;
200 else
201 Format = DW_EH_PE_sdata8;
202 }
203
204 if (Global)
205 Format |= DW_EH_PE_indirect;
206
207 return (Format | DW_EH_PE_pcrel);
208 } else {
209 if (is64Bit &&
210 (CM == CodeModel::Small ||
211 (CM == CodeModel::Medium && Reason != DwarfEncoding::Data)))
212 return DW_EH_PE_udata4;
213 else
214 return DW_EH_PE_absptr;
215 }
216}
217
Anton Korobeynikov4468b7a2008-07-09 13:20:48 +0000218X86COFFTargetAsmInfo::X86COFFTargetAsmInfo(const X86TargetMachine &TM):
Anton Korobeynikov32b952a2008-09-25 21:00:33 +0000219 X86GenericTargetAsmInfo(TM) {
Anton Korobeynikov18f6ed92008-07-19 13:15:21 +0000220
Anton Korobeynikov4468b7a2008-07-09 13:20:48 +0000221 GlobalPrefix = "_";
222 LCOMMDirective = "\t.lcomm\t";
223 COMMDirectiveTakesAlignment = false;
224 HasDotTypeDotSizeDirective = false;
Rafael Espindola952b8392008-12-03 11:01:37 +0000225 HasSingleParameterDotFile = false;
Anton Korobeynikov4468b7a2008-07-09 13:20:48 +0000226 StaticCtorsSection = "\t.section .ctors,\"aw\"";
227 StaticDtorsSection = "\t.section .dtors,\"aw\"";
228 HiddenDirective = NULL;
229 PrivateGlobalPrefix = "L"; // Prefix for private global symbols
230 WeakRefDirective = "\t.weak\t";
231 SetDirective = "\t.set\t";
232
233 // Set up DWARF directives
234 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
235 AbsoluteDebugSectionOffsets = true;
236 AbsoluteEHSectionOffsets = false;
237 SupportsDebugInformation = true;
238 DwarfSectionOffsetDirective = "\t.secrel32\t";
239 DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"dr\"";
240 DwarfInfoSection = "\t.section\t.debug_info,\"dr\"";
241 DwarfLineSection = "\t.section\t.debug_line,\"dr\"";
242 DwarfFrameSection = "\t.section\t.debug_frame,\"dr\"";
243 DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"dr\"";
244 DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"dr\"";
245 DwarfStrSection = "\t.section\t.debug_str,\"dr\"";
246 DwarfLocSection = "\t.section\t.debug_loc,\"dr\"";
247 DwarfARangesSection = "\t.section\t.debug_aranges,\"dr\"";
248 DwarfRangesSection = "\t.section\t.debug_ranges,\"dr\"";
249 DwarfMacInfoSection = "\t.section\t.debug_macinfo,\"dr\"";
250}
251
Anton Korobeynikovb9e58ef2008-07-09 13:21:08 +0000252unsigned
253X86COFFTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason,
254 bool Global) const {
Dan Gohman8f092252008-11-03 18:22:42 +0000255 CodeModel::Model CM = TM.getCodeModel();
256 bool is64Bit = TM.getSubtarget<X86Subtarget>().is64Bit();
Anton Korobeynikovcee750f2008-02-27 23:33:50 +0000257
Dan Gohman8f092252008-11-03 18:22:42 +0000258 if (TM.getRelocationModel() == Reloc::PIC_) {
Anton Korobeynikovb9e58ef2008-07-09 13:21:08 +0000259 unsigned Format = 0;
Anton Korobeynikovcee750f2008-02-27 23:33:50 +0000260
Anton Korobeynikovb9e58ef2008-07-09 13:21:08 +0000261 if (!is64Bit)
262 // 32 bit targets always encode pointers as 4 bytes
263 Format = DW_EH_PE_sdata4;
264 else {
265 // 64 bit targets encode pointers in 4 bytes iff:
266 // - code model is small OR
267 // - code model is medium and we're emitting externally visible symbols
268 // or any code symbols
269 if (CM == CodeModel::Small ||
270 (CM == CodeModel::Medium && (Global ||
271 Reason != DwarfEncoding::Data)))
Anton Korobeynikovcee750f2008-02-27 23:33:50 +0000272 Format = DW_EH_PE_sdata4;
Anton Korobeynikovcee750f2008-02-27 23:33:50 +0000273 else
Anton Korobeynikovb9e58ef2008-07-09 13:21:08 +0000274 Format = DW_EH_PE_sdata8;
Anton Korobeynikovcee750f2008-02-27 23:33:50 +0000275 }
Anton Korobeynikovcee750f2008-02-27 23:33:50 +0000276
Anton Korobeynikovb9e58ef2008-07-09 13:21:08 +0000277 if (Global)
278 Format |= DW_EH_PE_indirect;
279
280 return (Format | DW_EH_PE_pcrel);
281 } else {
282 if (is64Bit &&
283 (CM == CodeModel::Small ||
284 (CM == CodeModel::Medium && Reason != DwarfEncoding::Data)))
285 return DW_EH_PE_udata4;
286 else
287 return DW_EH_PE_absptr;
Anton Korobeynikovcee750f2008-02-27 23:33:50 +0000288 }
289}
290
Anton Korobeynikovb9a02fc2008-07-09 13:21:29 +0000291std::string
292X86COFFTargetAsmInfo::UniqueSectionForGlobal(const GlobalValue* GV,
293 SectionKind::Kind kind) const {
294 switch (kind) {
295 case SectionKind::Text:
296 return ".text$linkonce" + GV->getName();
297 case SectionKind::Data:
298 case SectionKind::BSS:
299 case SectionKind::ThreadData:
300 case SectionKind::ThreadBSS:
301 return ".data$linkonce" + GV->getName();
302 case SectionKind::ROData:
303 case SectionKind::RODataMergeConst:
304 case SectionKind::RODataMergeStr:
305 return ".rdata$linkonce" + GV->getName();
Anton Korobeynikov29b03f72008-07-09 13:19:38 +0000306 default:
Anton Korobeynikovb9a02fc2008-07-09 13:21:29 +0000307 assert(0 && "Unknown section kind");
Anton Korobeynikov29b03f72008-07-09 13:19:38 +0000308 }
309}
310
Anton Korobeynikovd0c1e292008-08-16 12:57:07 +0000311std::string X86COFFTargetAsmInfo::printSectionFlags(unsigned flags) const {
Anton Korobeynikovf447e3d2008-07-09 13:21:49 +0000312 std::string Flags = ",\"";
313
314 if (flags & SectionFlags::Code)
315 Flags += 'x';
316 if (flags & SectionFlags::Writeable)
317 Flags += 'w';
318
319 Flags += "\"";
320
321 return Flags;
322}
323
324X86WinTargetAsmInfo::X86WinTargetAsmInfo(const X86TargetMachine &TM):
Anton Korobeynikov32b952a2008-09-25 21:00:33 +0000325 X86GenericTargetAsmInfo(TM) {
Anton Korobeynikovf447e3d2008-07-09 13:21:49 +0000326 GlobalPrefix = "_";
327 CommentString = ";";
328
329 PrivateGlobalPrefix = "$";
330 AlignDirective = "\talign\t";
331 ZeroDirective = "\tdb\t";
332 ZeroDirectiveSuffix = " dup(0)";
333 AsciiDirective = "\tdb\t";
334 AscizDirective = 0;
335 Data8bitsDirective = "\tdb\t";
336 Data16bitsDirective = "\tdw\t";
337 Data32bitsDirective = "\tdd\t";
338 Data64bitsDirective = "\tdq\t";
339 HasDotTypeDotSizeDirective = false;
Rafael Espindola952b8392008-12-03 11:01:37 +0000340 HasSingleParameterDotFile = false;
Anton Korobeynikovf447e3d2008-07-09 13:21:49 +0000341
Anton Korobeynikovd7ca4162008-09-24 22:15:21 +0000342 TextSection = getUnnamedSection("_text", SectionFlags::Code);
Anton Korobeynikov315690e2008-09-24 22:16:16 +0000343 DataSection = getUnnamedSection("_data", SectionFlags::Writeable);
344
Anton Korobeynikovf447e3d2008-07-09 13:21:49 +0000345 JumpTableDataSection = NULL;
346 SwitchToSectionDirective = "";
347 TextSectionStartSuffix = "\tsegment 'CODE'";
348 DataSectionStartSuffix = "\tsegment 'DATA'";
349 SectionEndDirectiveSuffix = "\tends\n";
350}
Anton Korobeynikov6381a132008-10-05 08:53:29 +0000351
352template <class BaseTAI>
353bool X86TargetAsmInfo<BaseTAI>::LowerToBSwap(CallInst *CI) const {
354 // FIXME: this should verify that we are targetting a 486 or better. If not,
355 // we will turn this bswap into something that will be lowered to logical ops
356 // instead of emitting the bswap asm. For now, we don't support 486 or lower
357 // so don't worry about this.
358
359 // Verify this is a simple bswap.
360 if (CI->getNumOperands() != 2 ||
361 CI->getType() != CI->getOperand(1)->getType() ||
362 !CI->getType()->isInteger())
363 return false;
364
365 const IntegerType *Ty = dyn_cast<IntegerType>(CI->getType());
366 if (!Ty || Ty->getBitWidth() % 16 != 0)
367 return false;
368
369 // Okay, we can do this xform, do so now.
370 const Type *Tys[] = { Ty };
371 Module *M = CI->getParent()->getParent()->getParent();
372 Constant *Int = Intrinsic::getDeclaration(M, Intrinsic::bswap, Tys, 1);
373
374 Value *Op = CI->getOperand(1);
375 Op = CallInst::Create(Int, Op, CI->getName(), CI);
376
377 CI->replaceAllUsesWith(Op);
378 CI->eraseFromParent();
379 return true;
380}
381
382template <class BaseTAI>
383bool X86TargetAsmInfo<BaseTAI>::ExpandInlineAsm(CallInst *CI) const {
384 InlineAsm *IA = cast<InlineAsm>(CI->getCalledValue());
385 std::vector<InlineAsm::ConstraintInfo> Constraints = IA->ParseConstraints();
386
387 std::string AsmStr = IA->getAsmString();
388
389 // TODO: should remove alternatives from the asmstring: "foo {a|b}" -> "foo a"
390 std::vector<std::string> AsmPieces;
391 SplitString(AsmStr, AsmPieces, "\n"); // ; as separator?
392
393 switch (AsmPieces.size()) {
394 default: return false;
395 case 1:
396 AsmStr = AsmPieces[0];
397 AsmPieces.clear();
398 SplitString(AsmStr, AsmPieces, " \t"); // Split with whitespace.
399
400 // bswap $0
401 if (AsmPieces.size() == 2 &&
402 AsmPieces[0] == "bswap" && AsmPieces[1] == "$0") {
403 // No need to check constraints, nothing other than the equivalent of
404 // "=r,0" would be valid here.
405 return LowerToBSwap(CI);
406 }
407 break;
408 case 3:
409 if (CI->getType() == Type::Int64Ty && Constraints.size() >= 2 &&
410 Constraints[0].Codes.size() == 1 && Constraints[0].Codes[0] == "A" &&
411 Constraints[1].Codes.size() == 1 && Constraints[1].Codes[0] == "0") {
412 // bswap %eax / bswap %edx / xchgl %eax, %edx -> llvm.bswap.i64
413 std::vector<std::string> Words;
414 SplitString(AsmPieces[0], Words, " \t");
415 if (Words.size() == 2 && Words[0] == "bswap" && Words[1] == "%eax") {
416 Words.clear();
417 SplitString(AsmPieces[1], Words, " \t");
418 if (Words.size() == 2 && Words[0] == "bswap" && Words[1] == "%edx") {
419 Words.clear();
420 SplitString(AsmPieces[2], Words, " \t,");
421 if (Words.size() == 3 && Words[0] == "xchgl" && Words[1] == "%eax" &&
422 Words[2] == "%edx") {
423 return LowerToBSwap(CI);
424 }
425 }
426 }
427 }
428 break;
429 }
430 return false;
431}
432
433// Instantiate default implementation.
434TEMPLATE_INSTANTIATION(class X86TargetAsmInfo<TargetAsmInfo>);