[llvm-commits] [llvm] r134641 - in /llvm/trunk: lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h lib/Target/X86/X86.td lib/Target/X86/X86Subtarget.cpp lib/Target/X86/X86Subtarget.h lib/Target/X86/X86Ta

Evan Cheng evan.cheng at apple.com
Fri Jul 8 15:05:23 PDT 2011


On Jul 8, 2011, at 3:03 PM, Eli Friedman wrote:

> On Fri, Jul 8, 2011 at 2:57 PM, Evan Cheng <evan.cheng at apple.com> wrote:
>> 
>> On Jul 8, 2011, at 2:55 PM, Eli Friedman wrote:
>> 
>>> On Fri, Jul 8, 2011 at 2:54 PM, Evan Cheng <evan.cheng at apple.com> wrote:
>>>> 
>>>> On Jul 8, 2011, at 2:35 PM, Eli Friedman wrote:
>>>> 
>>>>> On Fri, Jul 8, 2011 at 2:15 PM, Evan Cheng <evan.cheng at apple.com> wrote:
>>>>>> r134741 should handle the non-x86 hosts. For the other cases, we should either fix tests or add specific CPUs to X86.td.
>>>>> 
>>>>> r134741 does't help at all.  Consider the case where we're compiling
>>>>> for a triple like x86_64-apple-macosx10.7.0, no CPU is specified, and
>>>>> we're on ARM.  We end up in 64-bit mode, but with cmov and SSE
>>>>> disabled.  Stuff explodes.
>>>> 
>>>> That's why this hack is in X86Subtarget.cpp:
>>>> 
>>>>  // If requesting codegen for X86-64, make sure that 64-bit features
>>>>  // are enabled.
>>>>  // FIXME: Remove this feature since it's not actually being used.
>>>>  if (In64BitMode) {
>>>>    HasX86_64 = true;
>>>> 
>>>>    // All 64-bit cpus have cmov support.
>>>>    HasCMov = true;
>>>>  }
>>> 
>>> In64BitMode is unconditionally false.
>> 
>> No ParseSubtargetFeatures can set it:
>>  if ((Bits & X86::Mode64Bit) != 0) In64BitMode = true;
> 
> Oh, right... but the hack doesn't handle SSE.

That's because of this:
// All x86-64 hardware has SSE2, but we don't mark SSE2 as an implied                                                                                                                                    
// feature, because SSE2 can be disabled (e.g. for compiling OS kernels)                                                                                                                                 
// without disabling 64-bit mode.

Evan

> 
> -Eli




More information about the llvm-commits mailing list