Jinoh Kang (@iamahuman) commented about dlls/ntdll/large_int.c:
+__ASM_GLOBAL_FUNC( _allshl,
"xchgl (%esp),%ecx\n\t"
"pushl %edx\n\t"
"pushl %eax\n\t"
"pushl %ecx\n\t"
"jmp " __ASM_NAME("__regs__allshl") )
+LONGLONG __regs__allshr( LONGLONG a, unsigned char b ) {
- return a << b;
- const LARGE_INTEGER x = { .QuadPart = a };
- LARGE_INTEGER ret;
- if (b >= 64)
return (LONGLONG)(x.HighPart >> 31);
Suggest using `x.HighPart >> (b >= 64 ? 31 : b & 31)` or its equivalent, as per the same reason for `_allshl`.
Compare:
- https://godbolt.org/z/sEd8Th56M (original)
With:
- https://godbolt.org/z/9WxTnbfax (64-bit return ellided).