[PATCH v2 0/4] MR375: ntdll: Fixes for runtime 64-bit shift functions.

Jinoh Kang (@iamahuman) wine at gitlab.winehq.org
Wed Jul 6 10:50:54 CDT 2022


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.

-- 
https://gitlab.winehq.org/wine/wine/-/merge_requests/375#note_3466



More information about the wine-devel mailing list