OLD | NEW |
1 //===-- X86Subtarget.cpp - X86 Subtarget Information ----------------------===// | 1 //===-- X86Subtarget.cpp - X86 Subtarget Information ----------------------===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file implements the X86 specific subclass of TargetSubtargetInfo. | 10 // This file implements the X86 specific subclass of TargetSubtargetInfo. |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 // For NaCl dynamic linking we do not want to generate a text relocation to | 172 // For NaCl dynamic linking we do not want to generate a text relocation to |
173 // an absolute address in PIC mode. Such a situation arises from | 173 // an absolute address in PIC mode. Such a situation arises from |
174 // test/CodeGen/X86/call-imm.ll with the default implementation. | 174 // test/CodeGen/X86/call-imm.ll with the default implementation. |
175 // For other platforms we retain the default behavior. | 175 // For other platforms we retain the default behavior. |
176 return (isTargetELF() && !isTargetNaCl()) || | 176 return (isTargetELF() && !isTargetNaCl()) || |
177 TM.getRelocationModel() == Reloc::Static; | 177 TM.getRelocationModel() == Reloc::Static; |
178 // @LOCALMOD-END | 178 // @LOCALMOD-END |
179 } | 179 } |
180 | 180 |
181 static bool OSHasAVXSupport() { | 181 static bool OSHasAVXSupport() { |
182 #if defined(i386) || defined(__i386__) || defined(__x86__) || defined(_M_IX86)\ | 182 #if defined(i386) || defined(__i386__) || defined(__x86__) || defined(_M_IX86) |
183 || defined(__x86_64__) || defined(_M_AMD64) || defined (_M_X64) | |
184 #if defined(__GNUC__) | 183 #if defined(__GNUC__) |
185 // Check xgetbv; this uses a .byte sequence instead of the instruction | 184 // Check xgetbv; this uses a .byte sequence instead of the instruction |
186 // directly because older assemblers do not include support for xgetbv and | 185 // directly because older assemblers do not include support for xgetbv and |
187 // there is no easy way to conditionally compile based on the assembler used. | 186 // there is no easy way to conditionally compile based on the assembler used. |
188 int rEAX, rEDX; | 187 int rEAX, rEDX; |
189 __asm__ (".byte 0x0f, 0x01, 0xd0" : "=a" (rEAX), "=d" (rEDX) : "c" (0)); | 188 __asm__ (".byte 0x0f, 0x01, 0xd0" : "=a" (rEAX), "=d" (rEDX) : "c" (0)); |
190 #elif defined(_MSC_FULL_VER) && defined(_XCR_XFEATURE_ENABLED_MASK) | 189 #elif defined(_MSC_FULL_VER) && defined(_XCR_XFEATURE_ENABLED_MASK) |
191 unsigned long long rEAX = _xgetbv(_XCR_XFEATURE_ENABLED_MASK); | 190 unsigned long long rEAX = _xgetbv(_XCR_XFEATURE_ENABLED_MASK); |
192 #else | 191 #else |
193 int rEAX = 0; // Ensures we return false | 192 int rEAX = 0; // Ensures we return false |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 } | 517 } |
519 | 518 |
520 bool X86Subtarget::enablePostRAScheduler( | 519 bool X86Subtarget::enablePostRAScheduler( |
521 CodeGenOpt::Level OptLevel, | 520 CodeGenOpt::Level OptLevel, |
522 TargetSubtargetInfo::AntiDepBreakMode& Mode, | 521 TargetSubtargetInfo::AntiDepBreakMode& Mode, |
523 RegClassVector& CriticalPathRCs) const { | 522 RegClassVector& CriticalPathRCs) const { |
524 Mode = TargetSubtargetInfo::ANTIDEP_CRITICAL; | 523 Mode = TargetSubtargetInfo::ANTIDEP_CRITICAL; |
525 CriticalPathRCs.clear(); | 524 CriticalPathRCs.clear(); |
526 return PostRAScheduler && OptLevel >= CodeGenOpt::Default; | 525 return PostRAScheduler && OptLevel >= CodeGenOpt::Default; |
527 } | 526 } |
OLD | NEW |