I have some (non-asm) questions about _lrotr (long rotate right).

1. Looking at intrin.h, it uses a #ifdef __x86_64__ to change the
parameters between LONG32 and LONG64. But that doesn't seem right. Shouldn't it be looking at __LP64__? Since this is mapped to
   msvcr*.dll in the .def files, will this even work correctly?
2. If we play this game with the #ifdef, that leaves no methods for 32
   bit rotations under LP64.  There will be 8, 16, and 2 different
   functions for 64bit (_lrotr and _rotr64). Are we sure that's what we
   want?
3. Also in intrin.h, it uses #pragma push_macro ("_lrotr") and #undef
   _lrotr.  As I understand it, these both only apply to macros, and
   _lrotr is not a macro. I think this should be deleted.

I realize that the "l" in _lrotr is supposed to stand for long. However, I believe it should still perform a 32bit rotation, even under LP64. That would give us:

unsigned char     _rotr8 (unsigned char     _val, int _Shift);
unsigned short    _rotr16(unsigned short    _val, int _Shift);
unsigned __LONG32 _lrotr (unsigned __LONG32_val, int _Shift);
unsigned __int64  _rotr64(unsigned __int64  _val, int _Shift);

Note that mingw-w64-headers\crt\stdlib.h and mingw-w64-headers\include\winnt.h do the same thing.

dw
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&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