Debian Codegraph @

msvc/gmp/mpn/x86i/mul_1.asm

raw
1
2 ; Copyright 1992, 1994, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
3 ; Foundation, Inc.
4 ;
5 ; This file is part of the GNU MP Library.
6 ;
7 ; The GNU MP Library is free software; you can redistribute it and/or
8 ; modify it under the terms of the GNU Lesser General Public License as
9 ; published by the Free Software Foundation; either version 2.1 of the
10 ; License, or (at your option) any later version.
11 ;
12 ; The GNU MP Library is distributed in the hope that it will be useful,
13 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 ; Lesser General Public License for more details.
16 ;
17 ; You should have received a copy of the GNU Lesser General Public
18 ; License along with the GNU MP Library; see the file COPYING.LIB. If
19 ; not, write to the Free Software Foundation, Inc., 59 Temple Place -
20 ; Suite 330, Boston, MA 02111-1307, USA.
21 ;
22 ; Translation of AT&T syntax code by Brian Gladman
23
24 %include "x86i.inc"
25
26 %define PARAM_MULTIPLIER esp+frame+16
27 %define PARAM_SIZE esp+frame+12
28 %define PARAM_SRC esp+frame+8
29 %define PARAM_DST esp+frame+4
30 %assign frame 0
31
32 section .text
33
34 global ___gmpn_mul_1
35 %ifdef DLL
36 export ___gmpn_mul_1
37 %endif
38
39 align 8
40 ___gmpn_mul_1:
41 push edi
42 push esi
43 push ebx
44 push ebp
45 %assign frame frame+16
46 mov edi,[PARAM_DST]
47 mov esi,[PARAM_SRC]
48 mov ecx,[PARAM_SIZE]
49 xor ebx,ebx
50 and ecx,3
51 jz Lend0
52 Loop0:
53 mov eax,[esi]
54 mul dword [PARAM_MULTIPLIER]
55 lea esi,[4+esi]
56 add eax,ebx
57 mov ebx,0
58 adc edx,ebx
59 mov [edi],eax
60 mov ebx,edx ; propagate carry into cylimb
61 lea edi,[4+edi]
62 dec ecx
63 jnz Loop0
64 Lend0:
65 mov ecx,[PARAM_SIZE]
66 shr ecx,2
67 jz Lend
68
69 align 8
70 Lop:
71 mov eax,[esi]
72 mul dword [PARAM_MULTIPLIER]
73 add ebx,eax
74 mov ebp,0
75 adc ebp,edx
76 mov eax,[4+esi]
77 mul dword [PARAM_MULTIPLIER]
78 mov [edi],ebx
79 add ebp,eax ; new lo + cylimb
80 mov ebx,0
81 adc ebx,edx
82 mov eax,[8+esi]
83 mul dword [PARAM_MULTIPLIER]
84 mov [4+edi],ebp
85 add ebx,eax ; new lo + cylimb
86 mov ebp,0
87 adc ebp,edx
88 mov eax,[12+esi]
89 mul dword [PARAM_MULTIPLIER]
90 mov [8+edi],ebx
91 add ebp,eax ; new lo + cylimb
92 mov ebx,0
93 adc ebx,edx
94 mov [12+edi],ebp
95 lea esi,[16+esi]
96 lea edi,[16+edi]
97 dec ecx
98 jnz Lop
99 Lend:
100 mov eax,ebx
101 pop ebp
102 pop ebx
103 pop esi
104 pop edi
105 ret
106
107 end