So, no response here, other than a few (brief) comments on irc.
It's hard to know how to advocate for a patch when I'm not sure what the
objections are. But it seems likely that that biggest areas of concern
aren't the changes to the inline asm, but the files I'm deleting from
\intrinsc\.
With that in mind, let me try to clarify why I'm proposing deleting
these files.
RtlSecureZeroMemory.c - This function is NOT defined by MSDN as an
intrinsic. This means that it is NOT provided automatically by the
compiler as a builtin, and in fact is not available from any MS library
or DLL. The only place the function exists is as an inline in winnt.h.
The same as what mingw-w64 does.
UnsignedMultiplyExtract128.c & MultiplyExtract128.c: Likewise, these
are not intrinsics. Again, they are not available in libraries but only
exist in winnt.h, and mingw-64's winnt.h already has this.
_InterlockedAdd.c & _InterlockedAdd64.c: Perhaps the most interesting of
the 3, these *are* defined by MSDN as intrinsics. However, they are only
defined as intrinsics for Itanium processors. Does the inline assembler
code we have in the intrinsc directory even work on Itanium? I have no
idea. But I do see that it is not protected with an #ifdef to limit it
to that platform. Further, MS defines a non-intrinsic version (but still
FORCEINLINE) of these functions in winnt.h, which mingw-w64 also provides.
In general:
- These deletes bring mingw-w64 in line with MS.
- Mingw-64 provides no means to access these functions from the
library. All the declarations provided are for the inlines in winnt.
- People who program to mingw-w64 and (somehow) use these functions from
the library will have problems if they try to move back to Windows where
they won't exist.
I accept that there may be reasons not to do these deletes. And whether
I agree with the reasons or not, I do agree that someone needs to have a
vision for what mingw-w64 includes and what it doesn't, and that person
isn't me. So if these files must remain, just let me know, and I'll
re-submit the patch with the deletes deleted.
dw
On 8/6/2013 4:23 PM, dw wrote:
I think this is about it for intrinsics work for v3. This patch is
(mostly) for the files in intrinsc\*.c that weren't changed by any
previous work. It's possible that not everything in this patch will
get approved, but I figure it's easier to ask forgiveness than permission.
__movsb, __movsd, __movsq, __movsw: Moved to intrin-impl.
__rdtsc: Change to use builtin, moved to intrin-impl, resolved
conflict with ia32intrin.
_umul128 & _mul128: Moved to intrin-impl.
__shiftright128 & __shiftleft128: Re-written as asm, moved to
intrin-impl.h.
_lrotr, _lrotl: Fix bug caused by ia32intrin.h when longs are 4 bytes
long.
RtlSecureZeroMemory - According to msdn, this is not an intrinsic and
should only be defined in winnt.h. *File deleted from intrincs.*
UnsignedMultiplyExtract128 & MultiplyExtract128: According to msdn,
these are not intrinsics. Also, MultiplyExtract128 doesn't work
right. *Files deleted from intrincs* and code fixed in winnt.h.
_InterlockedAdd & _InterlockedAdd64: According to msdn, these
intrinsics are only available for itanium. I'm not sure the inline
asm we have will run properly there, and there are no #if's around it
to limit it to that platform. Note that winnt.h has inlines for
x86/x64 for these. *Files deleted from intrincs*.
dw
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public