> the idea to put all intrinsics within one new header, I don't like 
> either. 
Sorry, my fault.  I wasn't clear.  This isn't what I was proposing.

I'm suggesting intrnmac.h only contains the macro definitions.  So we 
would move this code from winnt.h (which is where it is now) to intrnmac.h:

#define __buildstos(x, y) void x(y *Dest, y Data, size_t Count) \
{ \
    __asm__ __volatile__ ("rep stos%z0" \
       :  /* no outputs */ \
       : "D" (Dest), "c" (Count), "a" (Data) \
       : "memory"); \
}

Then, in winnt.h we would put (or rather "leave" since it is already there):

__CRT_INLINE __buildstos(__stosb, BYTE)
__CRT_INLINE __buildstos(__stosw, WORD)
__CRT_INLINE __buildstos(__stosd, DWORD)
__CRT_INLINE __buildstos(__stosq, DWORD64)

In __stosb.c, the entire contents of the file would be:

#include <intrin.h>
#include <intrnmac.h>

__buildstos(__stosb, unsigned char)

Done this way, the guts of the code is in one place (the macro in 
intrnmac.h) and a single modification affects both.  At the same time, 
the code still exists right where it did before I started (winnt.h & 
__stosb.c).  It seems like this gets us the best of both worlds.

> So my 5 cent vote for maintaining header plus implementation-file in
> crt as separate implementations.
I respect your vision of how this should be laid out.  I just wanted to 
make sure I was clear about what I was proposing.  If this is still the 
way you prefer, that's what I'll do.

dw

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to