diff options
author | bxing <bxing@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-07-21 08:47:38 +0000 |
---|---|---|
committer | bxing <bxing@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-07-21 08:47:38 +0000 |
commit | 3f566587aea64bb986866c7f69a6b82891bf59db (patch) | |
tree | 406fa713c2baaa46f9c357f49bcef7d710e7f044 /MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.S | |
parent | 31a9215c3223d3818d1709f39d06774e18df103f (diff) | |
download | edk2-platforms-3f566587aea64bb986866c7f69a6b82891bf59db.tar.xz |
1. Updated function headers in all assembly files.
2. Split x86LowLevel.c into a bunch of C files to make images linked with BaseLib smaller.
3. Fixed a few minor bugs.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1066 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.S')
-rw-r--r-- | MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.S | 89 |
1 files changed, 45 insertions, 44 deletions
diff --git a/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.S b/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.S index df1e6ad495..90ccc56a70 100644 --- a/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.S +++ b/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.S @@ -20,69 +20,70 @@ #
#------------------------------------------------------------------------------
+.global _InternalMathDivRemU64x32, _InternalMathDivRemU64x64
-
-
-
-.extern _InternalMathDivRemU64x32
-
-.global _InternalMathDivRemU64x64
-_InternalMathDivRemU64x64:
- movl 16(%esp),%ecx
- testl %ecx,%ecx
- jnz _DivRemU64x64
- movl 20(%esp),%ecx
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# InternalMathDivRemU64x64 (
+# IN UINT64 Dividend,
+# IN UINT64 Divisor,
+# OUT UINT64 *Remainder OPTIONAL
+# );
+#------------------------------------------------------------------------------
+_InternalMathDivRemU64x64:
+ movl 16(%esp), %ecx
+ testl %ecx, %ecx
+ jnz Hard
+ movl 20(%esp), %ecx
jecxz L1
- and $0,4(%ecx)
- movl %ecx,16(%esp)
-L1:
+ and $0, 4(%ecx)
+ movl %ecx, 16(%esp)
+L1:
jmp _InternalMathDivRemU64x32
-
-
-.global _DivRemU64x64
-_DivRemU64x64:
- push %ebx
- push %esi
- push %edi
+Hard:
+ push %ebx
+ push %esi
+ push %edi
mov 20(%esp), %edx
mov 16(%esp), %eax
- movl %edx,%edi
- movl %eax,%esi
+ movl %edx, %edi
+ movl %eax, %esi
mov 24(%esp), %ebx
-L2:
+L2:
shrl %edx
- rcrl $1,%eax
- shrdl $1,%ecx,%ebx
+ rcrl $1, %eax
+ shrdl $1, %ecx, %ebx
shrl %ecx
jnz L2
divl %ebx
- movl %eax,%ebx
- movl 28(%esp),%ecx
+ movl %eax, %ebx
+ movl 28(%esp), %ecx
mull 24(%esp)
- imull %ebx,%ecx
- addl %ecx,%edx
+ imull %ebx, %ecx
+ addl %ecx, %edx
mov 32(%esp), %ecx
jc TooLarge
- cmpl %edx,%edi
+ cmpl %edx, %edi
ja Correct
jb TooLarge
- cmpl %eax,%esi
+ cmpl %eax, %esi
jae Correct
-TooLarge:
+TooLarge:
decl %ebx
jecxz Return
sub 24(%esp), %eax
sbb 28(%esp), %edx
-Correct:
+Correct:
jecxz Return
- subl %eax,%esi
- sbbl %edx,%edi
- movl %esi,(%ecx)
- movl %edi,4(%ecx)
-Return:
- movl %ebx,%eax
- xorl %edx,%edx
- push %edi
- push %esi
- push %ebx
+ subl %eax, %esi
+ sbbl %edx, %edi
+ movl %esi, (%ecx)
+ movl %edi, 4(%ecx)
+Return:
+ movl %ebx, %eax
+ xorl %edx, %edx
+ pop %edi
+ pop %esi
+ pop %ebx
ret
|