[2/2] ntdll: Implement missing 64 bit shifts (try 2)

Alexandre Julliard julliard at winehq.org
Thu Dec 9 06:51:35 CST 2010


Mike Gibson <mike.gibson at storagecraft.com> writes:

> @@ -144,8 +144,23 @@ LONGLONG WINAPI RtlLargeIntegerShiftRight( LONGLONG a, INT count )
>   */
>  LONGLONG WINAPI RtlLargeIntegerArithmeticShift( LONGLONG a, INT count )
>  {
> -    /* FIXME: gcc does arithmetic shift here, but it may not be true on all platforms */
> -    return a >> count;
> +#ifdef HAVE_SIMPLE_ARITHMETIC_RIGHT_SHIFT
> +	return a >> count;
> +#else
> +	/* create mask to extend the sign bit */
> +	LONGLONG mask;
> +	mask = ( LONGLONG ) 1 << 63;
> +	mask &= a;
> +	mask >>= count;

That's an arithmetic shift, you are only moving the problem.

Also your calling convention for the _allsh* functions isn't correct, as
a simple test case demonstrates. Do you really have an app that uses
this?

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list