ntdll: Fix the calling convention for runtime 64-bit shift functions.

Based on a patch by Zhao Yi.
This commit is contained in:
Zebediah Figura 2022-07-03 20:20:21 -05:00 committed by Alexandre Julliard
parent ebcb18d418
commit 15320277f8
3 changed files with 45 additions and 47 deletions

View file

@ -809,40 +809,55 @@ ULONGLONG WINAPI _aulldiv( ULONGLONG a, ULONGLONG b )
return udivmod(a, b, NULL);
}
/******************************************************************************
* _allshl (NTDLL.@)
*
* Shift a 64 bit integer to the left.
*
* PARAMS
* a [I] Initial number.
* b [I] Number to shift a by to the left.
*
* RETURNS
* The left-shifted value.
*/
LONGLONG WINAPI _allshl( LONGLONG a, LONG b )
LONGLONG __stdcall __regs__allshl( LONGLONG a, unsigned char b )
{
return a << b;
}
/******************************************************************************
* _allshr (NTDLL.@)
*
* Shift a 64 bit integer to the right.
*
* PARAMS
* a [I] Initial number.
* b [I] Number to shift a by to the right.
*
* RETURNS
* The right-shifted value.
* _allshl (NTDLL.@)
*/
LONGLONG WINAPI _allshr( LONGLONG a, LONG b )
__ASM_GLOBAL_FUNC( _allshl,
"xchgl (%esp),%ecx\n\t"
"pushl %edx\n\t"
"pushl %eax\n\t"
"pushl %ecx\n\t"
"jmp " __ASM_STDCALL("__regs__allshl", 12) )
LONGLONG __stdcall __regs__allshr( LONGLONG a, unsigned char b )
{
return a >> b;
}
/******************************************************************************
* _allshr (NTDLL.@)
*/
__ASM_GLOBAL_FUNC( _allshr,
"xchgl (%esp),%ecx\n\t"
"pushl %edx\n\t"
"pushl %eax\n\t"
"pushl %ecx\n\t"
"jmp " __ASM_STDCALL("__regs__allshr", 12) )
ULONGLONG __stdcall __regs__aullshr( ULONGLONG a, unsigned char b )
{
return a >> b;
}
/******************************************************************************
* _allshr (NTDLL.@)
*/
__ASM_GLOBAL_FUNC( _aullshr,
"xchgl (%esp),%ecx\n\t"
"pushl %edx\n\t"
"pushl %eax\n\t"
"pushl %ecx\n\t"
"jmp " __ASM_STDCALL("__regs__aullshr", 12) )
/******************************************************************************
* _alldvrm (NTDLL.@)
*
@ -899,23 +914,6 @@ ULONGLONG WINAPI _aullrem( ULONGLONG a, ULONGLONG b )
return r;
}
/******************************************************************************
* _aullshr (NTDLL.@)
*
* Shift a 64 bit unsigned integer to the right.
*
* PARAMS
* a [I] Initial number.
* b [I] Number to shift a by to the right.
*
* RETURNS
* The right-shifted value.
*/
ULONGLONG WINAPI _aullshr( ULONGLONG a, LONG b )
{
return a >> b;
}
/******************************************************************************
* _aulldvrm (NTDLL.@)
*

View file

@ -1492,13 +1492,13 @@
@ cdecl -norelay -arch=i386 -ret64 _allmul(int64 int64)
@ cdecl -arch=i386 -norelay _alloca_probe()
@ cdecl -norelay -arch=i386 -ret64 _allrem(int64 int64)
@ stdcall -arch=i386 -ret64 _allshl(int64 long)
@ stdcall -arch=i386 -ret64 _allshr(int64 long)
@ cdecl -norelay -arch=i386 -ret64 _allshl(int64 long)
@ cdecl -norelay -arch=i386 -ret64 _allshr(int64 long)
@ cdecl -ret64 _atoi64(str)
@ cdecl -norelay -arch=i386 -ret64 _aulldiv(int64 int64)
@ cdecl -arch=i386 -norelay _aulldvrm(int64 int64)
@ cdecl -norelay -arch=i386 -ret64 _aullrem(int64 int64)
@ stdcall -arch=i386 -ret64 _aullshr(int64 long)
@ cdecl -norelay -arch=i386 -ret64 _aullshr(int64 long)
@ cdecl -arch=i386 -norelay _chkstk()
@ stub _fltused
@ cdecl -arch=i386 -ret64 _ftol()

View file

@ -1540,12 +1540,12 @@
@ cdecl -arch=i386 -norelay -ret64 _allmul(int64 int64)
@ cdecl -arch=i386 -norelay _alloca_probe()
@ cdecl -arch=i386 -norelay -ret64 _allrem(int64 int64)
@ stdcall -arch=i386 -ret64 _allshl(int64 long)
@ stdcall -arch=i386 -ret64 _allshr(int64 long)
@ cdecl -arch=i386 -norelay -ret64 _allshl(int64 long)
@ cdecl -arch=i386 -norelay -ret64 _allshr(int64 long)
@ cdecl -arch=i386 -norelay -ret64 _aulldiv(int64 int64)
@ cdecl -arch=i386 -norelay _aulldvrm(int64 int64)
@ cdecl -arch=i386 -norelay -ret64 _aullrem(int64 int64)
@ stdcall -arch=i386 -ret64 _aullshr(int64 long)
@ cdecl -arch=i386 -norelay -ret64 _aullshr(int64 long)
@ cdecl -arch=i386 -norelay _chkstk()
@ cdecl -arch=i386 _except_handler2(ptr ptr ptr ptr)
@ cdecl -arch=i386 _except_handler3(ptr ptr ptr ptr)