]>
Commit | Line | Data |
---|---|---|
97f98500 HT |
1 | #------------------------------------------------------------------------------\r |
2 | #\r | |
3 | # Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r | |
4 | # This program and the accompanying materials\r | |
5 | # are licensed and made available under the terms and conditions of the BSD License\r | |
6 | # which accompanies this distribution. The full text of the license may be found at\r | |
7 | # http://opensource.org/licenses/bsd-license.php.\r | |
8 | #\r | |
9 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | #\r | |
12 | # Module Name:\r | |
13 | #\r | |
14 | # MathDivU64x64.S\r | |
15 | #\r | |
16 | # Abstract:\r | |
17 | #\r | |
18 | # 64-bit Math Worker Function.\r | |
19 | # Divides a 64-bit unsigned value with a 64-bit unsigned value and returns\r | |
20 | # a 64-bit unsigned result.\r | |
21 | #\r | |
22 | #------------------------------------------------------------------------------\r | |
23 | \r | |
24 | .686:\r | |
25 | .code:\r | |
26 | \r | |
27 | ASM_GLOBAL ASM_PFX(__udivdi3), ASM_PFX(DivU64x64Remainder)\r | |
28 | \r | |
29 | #------------------------------------------------------------------------------\r | |
30 | #\r | |
31 | # void __cdecl __udivdi3 (void)\r | |
32 | #\r | |
33 | #------------------------------------------------------------------------------\r | |
34 | ASM_PFX(__udivdi3):\r | |
35 | # Original local stack when calling __udivdi3\r | |
36 | # -----------------\r | |
37 | # | |\r | |
38 | # |---------------|\r | |
39 | # | |\r | |
40 | # |-- Divisor --|\r | |
41 | # | |\r | |
42 | # |---------------|\r | |
43 | # | |\r | |
44 | # |-- Dividend --|\r | |
45 | # | |\r | |
46 | # |---------------|\r | |
47 | # | ReturnAddr** |\r | |
48 | # ESP---->|---------------|\r | |
49 | #\r | |
50 | \r | |
51 | #\r | |
52 | # Set up the local stack for NULL Reminder pointer\r | |
53 | #\r | |
54 | xorl %eax, %eax\r | |
55 | push %eax\r | |
56 | \r | |
57 | #\r | |
58 | # Set up the local stack for Divisor parameter\r | |
59 | #\r | |
60 | movl 20(%esp), %eax\r | |
61 | push %eax\r | |
62 | movl 20(%esp), %eax\r | |
63 | push %eax\r | |
64 | \r | |
65 | #\r | |
66 | # Set up the local stack for Dividend parameter\r | |
67 | #\r | |
68 | movl 20(%esp), %eax\r | |
69 | push %eax\r | |
70 | movl 20(%esp), %eax\r | |
71 | push %eax\r | |
72 | \r | |
73 | #\r | |
74 | # Call native DivU64x64Remainder of BaseLib\r | |
75 | #\r | |
76 | jmp ASM_PFX(DivU64x64Remainder)\r | |
77 | \r | |
78 | #\r | |
79 | # Adjust stack\r | |
80 | #\r | |
81 | addl $20, %esp\r | |
82 | \r | |
83 | ret $16\r |