Hi, I am concerned about making out of function-prototypes instead macros. I admit that in most cases that won't cause any troubles, but by macros we pessimize some potential user-code overrides. Additional a macro has no implementation-address. So there are no pointer-references possible (well as builtin there isn't too).
Second remark is about the inline-function. Shouldn't we use here either also the check-guard for enabling macros, or shouldn't we use here instead FORCEINLINE? Thanks, Kai 2013/6/13 dw <[email protected]>: > This patch addresses the following issues: > > 1) The existing code for __faststorefence doesn't actually generate a fence. > It just generates a barrier. This patch maps __faststorefence to _mm_sfence > (instead of doing MS's trick with "lock or"). sfence appears to be faster > than MS's "fast" approach on modern processors. > > 2) MS's MemoryBarrier (which is supposed to be a full compiler barrier + > processor fence) maps to __faststorefence. This works for MS because their > __faststorefence trick ends up generating a full fence + full barrier. > Since our __faststorefence now uses sfence, this patch adjusts MemoryBarrier > to use _mm_mfence(). > > 3) While there is a prototype for _ReadWriteBarrier in winnt.h, there is no > implementation. Since _ReadWriteBarrier is -only- a compiler directive > (rather like #pragma), there is no way to place it in a library. As a > result, this patch implements it with a #define in both winnt.h & intrin.h. > > 4) Gcc doesn't actually support _ReadBarrier() and _WriteBarrier. This patch > defines them as being mapped to _ReadWriteBarrier() with a #define in both > winnt.h & intrin.h. > > 5) While there is a prototype for __int2c in winnt.h and intrin.h, there is > no implementation. Since MS docs say this is only available as an intrinsic > (what gcc calls builtin), this patch defines it with a macro in both winnt.h > and intrin.h. > > 6) The code for DbgRaiseAssertionFailure won't compile with -masm=intel. > Use __builtint from intrin-mac.h. > > 7) Add __buildint to intrin-mac.h for DbgRaiseAssertionFailure & __int2c. > > 8) On x86, if SSE2 is available, use _mm_pause for YieldProcessor and > _mm_mfence for MemoryBarrier. If SSE2 is not available, build the > appropriate asm ("rep nop" for pause and "xchg" for MemoryBarrier). > > dw > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Mingw-w64-public mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public > ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
