2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * PURPOSE: Run-Time Library
5 * FILE: lib/rtl/i386/math.S
6 * PROGRAMER: Alex Ionescu (alex@relsoft.net)
7 * Eric Kohl (ekohl@rz-online.de)
8 * REVISION HISTORY: 27/07/2005 Created
11 /* GLOBALS ****************************************************************/
23 /* FUNCTIONS ***************************************************************/
27 * __alldiv(long long Dividend, long long Divisor);
30 * [ESP+04h] - long long Dividend
31 * [ESP+0Ch] - long long Divisor
35 * EDX:EAX - long long quotient (Dividend/Divisor)
37 * Routine removes the arguments from the stack.
45 * __allmul(long long Multiplier, long long Multiplicand);
48 * [ESP+04h] - long long Multiplier
49 * [ESP+0Ch] - long long Multiplicand
53 * EDX:EAX - long long product (Multiplier*Multiplicand)
55 * Routine removes the arguments from the stack.
75 leal (%ebx,%esi), %eax
88 * __aullrem(unsigned long long Dividend, unsigned long long Divisor);
91 * [ESP+04h] - unsigned long long Dividend
92 * [ESP+0Ch] - unsigned long long Divisor
96 * EDX:EAX - unsigned long long remainder (Dividend%Divisor)
98 * Routine removes the arguments from the stack.
106 * __allshl(long long Value, unsigned char Shift);
109 * EDX:EAX - signed long long value to be shifted left
110 * CL - number of bits to shift by
114 * EDX:EAX - shifted value
117 shldl %cl, %eax, %edx
128 * __allshr(long long Value, unsigned char Shift);
131 * EDX:EAX - signed long long value to be shifted right
132 * CL - number of bits to shift by
136 * EDX:EAX - shifted value
139 shrdl %cl, %edx, %eax
150 * __aulldiv(unsigned long long Dividend, unsigned long long Divisor);
153 * [ESP+04h] - unsigned long long Dividend
154 * [ESP+0Ch] - unsigned long long Divisor
158 * EDX:EAX - unsigned long long quotient (Dividend/Divisor)
160 * Routine removes the arguments from the stack.
168 * __aullshr(unsigned long long Value, unsigned char Shift);
171 * EDX:EAX - unsigned long long value to be shifted right
172 * CL - number of bits to shift by
176 * EDX:EAX - shifted value
179 shrdl %cl, %edx, %eax
189 * __allrem(long long Dividend, long long Divisor);
192 * [ESP+04h] - long long Dividend
193 * [ESP+0Ch] - long long Divisor
197 * EDX:EAX - long long remainder (Dividend/Divisor)
199 * Routine removes the arguments from the stack.
205 .intel_syntax noprefix
208 /* Set up stack frame */
212 /* Set "round towards zero" mode */
219 /* Do the conversion */
220 fistp qword ptr [ebp-8]
222 /* Restore rounding mode */
229 /* Remove stack frame and return*/