[PATCH] Do not define the gcc style target specific pre-defined preprocessor macros in clang-cl

Nico Weber thakis at chromium.org
Wed Jul 9 10:31:23 PDT 2014


On Wed, Jul 9, 2014 at 10:25 AM, Ehsan Akhgari <ehsan.akhgari at gmail.com>
wrote:

> On Wed, Jul 9, 2014 at 1:22 PM, Nico Weber <thakis at chromium.org> wrote:
>
>> On Wed, Jul 9, 2014 at 10:18 AM, Ehsan Akhgari <ehsan.akhgari at gmail.com>
>> wrote:
>>
>>> On Wed, Jul 9, 2014 at 12:00 PM, Nico Weber <thakis at chromium.org> wrote:
>>>
>>>> On Wed, Jul 9, 2014 at 8:53 AM, Ehsan Akhgari <ehsan.akhgari at gmail.com>
>>>> wrote:
>>>>
>>>>> That's OK, the main intention behind this patch is to unbreak code
>>>>> that assumes gcc specific things based on #ifdef __i386__ and friends...
>>>>>
>>>>> With that in mind, does this look good to land?
>>>>>
>>>>
>>>> This patch also removes the #error lines from all the intrinsics
>>>> headers. Did you intend that to be part of this patch? It's a good idea,
>>>> but the backend actually asserts when they are used, like David said.
>>>>
>>>
>>> Those are actually the changes I had to make to make the tests pass with
>>> my patch.  These headers currently use the gcc style target dependent
>>> macros in order to decide whether or not to #error and we have tests that
>>> hit the #error situation (or hit unknown types because we don't include
>>> some headers based on these macros if you #include "immintrin.h" for
>>> example).  If there is a better way to fix these issues, I'd be happy to do
>>> that instead.
>>>
>>
>> I think it's a reasonable change (fwiw), but the backend code should
>> probably be changed to not assert when using the intrinsics before this
>> change goes in. I don't know how involved it is to do this; I don't know if
>> LLVM supports a "it's fine to use SSE from intrinsics, but not for any
>> other codegen" mode.
>>
>
> Do you mind pointing me to the code in the backend for this please?  I'd
> be happy to take a stab at it.
>

I don't know where it is (David might know), but you could just compile a
short sample program calling an avx2 intrinsic without -mavx2 and look at
the stack of the assertion :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140709/e4225050/attachment.html>


More information about the cfe-commits mailing list