7 Jul
2022
7 Jul
'22
2:46 a.m.
On 7/6/22 10:50, Jinoh Kang (@iamahuman) wrote:
Jinoh Kang (@iamahuman) commented about dlls/ntdll/large_int.c:
+LONGLONG __regs__allshl( LONGLONG a, unsigned char b ) +{ + const LARGE_INTEGER x = { .QuadPart = a }; + LARGE_INTEGER ret; + + if (b >= 64) + return 0; + + if (b >= 32) + { + ret.HighPart = x.LowPart << (b & 31); + ret.LowPart = 0; + } + else + { + ret.HighPart = (x.LowPart >> (32 - b)) | (x.HighPart << b); Shall we use intrinsics such as `__ll_lshift` (`shld` instruction)? Ditto for other functions.
I suppose we could, although ideally GCC would just recognize this pattern and generate shld.