Sorry for the delayed response on this topic, things got busy.  To pick 
this back up, this is where we stand now:

- There's a bug in gcc's x86intrin.h.  They assume that under x64, longs 
are always 8 bytes.  For native Windows (ie not cygwin), that's not 
correct, and leads to incorrect results for the intrinsics _lrotr and 
_lrotl.  It's possible to do a work-around using undef + define.
- In addition to the bug in x86intrin, there are incorrect prototypes 
for _lrotr and _lrotl in intrin.h, stdlib.h and winnt.h.

I see 3 reasonable courses of action:

1) We could fix our prototypes plus add the work-around everywhere we 
include x86intrin.h.  This is what my previous patch did. However, as 
Kai (correctly) points out, this puts the same code in a multiple 
places.  That's both inefficient, and harder to maintain.

2) We could fix our prototypes plus put the work-around in a wrapper 
file (ie x86intrin-fix.h).  Then instead of including x86intrin.h, we'd 
include x86intrin-fix.h in our headers (winnt.h & intrin.h).  This fix 
(as well as any future fixes for x86intrin) could be done in one place.  
Also, when gcc fixes this problem in their code, we can put an #ifdef to 
see if the fix is still needed in a single place.

3) We could fix our prototypes, then open a ticket against gcc to fix 
their bug in x86intrin.h.

Neither #1 or #2 fix the problem if users include x86intrin.h directly.  
Also, this problem has been there a long time, and I haven't seen anyone 
(besides me) screaming for a fix.  If we needed an immediate fix, I 
could see going with #2, but the cleanest (and my current preference) is 
#3.

I'm prepared to write #2 or #3 (or #4 if someone has a better idea), but 
before I spend the time, I'd like to know which would get approved.

dw

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to