[PATCH][X86] __builtin_ctz/clz sometimed defined for zero input

Robinson, Paul Paul_Robinson at playstation.sony.com
Mon Oct 27 20:05:39 PDT 2014


| Why do they do that?

On Windows, our Intrin.h should declare/define the same things as the Windows Intrin.h, but in a Clang-ish way.
Not on Windows, our Intrin.h should not conceal some other Intrin.h that we don't know what it is.
--paulr

From: Sean Silva [mailto:chisophugis at gmail.com]
Sent: Monday, October 27, 2014 7:54 PM
To: Richard Smith
Cc: Robinson, Paul; cfe-commits at cs.uiuc.edu
Subject: Re: [PATCH][X86] __builtin_ctz/clz sometimed defined for zero input



On Mon, Oct 27, 2014 at 7:40 PM, Richard Smith <richard at metafoo.co.uk<mailto:richard at metafoo.co.uk>> wrote:
On Mon, Oct 27, 2014 at 7:09 PM, Sean Silva <chisophugis at gmail.com<mailto:chisophugis at gmail.com>> wrote:


On Mon, Oct 27, 2014 at 6:16 PM, Robinson, Paul <Paul_Robinson at playstation.sony.com<mailto:Paul_Robinson at playstation.sony.com>> wrote:
I don't know about Mac, but on my Ubuntu, Intrin.h shows up in the expected place:

~/projects/upstream/writeable/obj$ find . -name Intrin.h
./Debug+Asserts/lib/clang/3.6.0/include/Intrin.h
./Debug+Asserts/lib/clang/3.5.0/include/Intrin.h
./Debug+Asserts/lib/clang/3.4/include/Intrin.h
./Debug+Asserts/lib/clang/3.5/include/Intrin.h

I presume that isn't where existing software for those platforms looks for them.

It is, but they do nothing but #include_next the next Intrin.h if you're not targeting win32, so they act as if they don't exist.

Why do they do that?

-- Sean Silva


-- Sean Silva


From: Chandler Carruth [mailto:chandlerc at google.com<mailto:chandlerc at google.com>]
Sent: Monday, October 27, 2014 5:17 PM
To: Robinson, Paul
Cc: Sean Silva; cfe-commits at cs.uiuc.edu<mailto:cfe-commits at cs.uiuc.edu>
Subject: Re: [PATCH][X86] __builtin_ctz/clz sometimed defined for zero input


On Mon, Oct 27, 2014 at 5:02 PM, Robinson, Paul <Paul_Robinson at playstation.sony.com<mailto:Paul_Robinson at playstation.sony.com>> wrote:
That makes lzcntintrin.h completely pointless.  They'd just be alternate names for the functions in Intrin.h.

If those names need to be supported for compatibility and portability then it still seems to have a point.

Note that Intrin.h doesn't exist on Linux or Mac.


_______________________________________________
cfe-commits mailing list
cfe-commits at cs.uiuc.edu<mailto:cfe-commits at cs.uiuc.edu>
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141028/c7b437ce/attachment.html>


More information about the cfe-commits mailing list