Debian Codegraph @

msvc/gmp/mpn/x86i/pentium4/sse2/add_n.asm

raw
1
2 ; Copyright 2001, 2002 Free Software Foundation, Inc.
3 ;
4 ; This file is part of the GNU MP Library.
5 ;
6 ; The GNU MP Library is free software; you can redistribute it and/or
7 ; modify it under the terms of the GNU Lesser General Public License as
8 ; published by the Free Software Foundation; either version 2.1 of the
9 ; License, or (at your option) any later version.
10 ;
11 ; The GNU MP Library is distributed in the hope that it will be useful,
12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 ; Lesser General Public License for more details.
15 ;
16 ; You should have received a copy of the GNU Lesser General Public
17 ; License along with the GNU MP Library; see the file COPYING.LIB. If
18 ; not, write to the Free Software Foundation, Inc., 59 Temple Place -
19 ; Suite 330, Boston, MA 02111-1307, USA.
20 ;
21 ; Translation of AT&T syntax code by Brian Gladman
22
23 %include "..\..\x86i.inc"
24
25 section .text
26
27 global ___gmpn_add_nc
28 %ifdef DLL
29 export ___gmpn_add_nc
30 %endif
31
32 align 8
33 ___gmpn_add_nc:
34 movd mm0,[20+esp]
35 mov eax,[8+esp]
36 mov [8+esp],ebx
37 mov ebx,[12+esp]
38 mov edx,[4+esp]
39 mov ecx,[16+esp]
40 lea eax,[eax+ecx*4]
41 lea ebx,[ebx+ecx*4]
42 lea edx,[edx+ecx*4]
43 neg ecx
44 t1: movd mm1,[eax+ecx*4]
45 movd mm2,[ebx+ecx*4]
46 paddq mm1,mm2
47 paddq mm0,mm1
48 movd [edx+ecx*4],mm0
49 psrlq mm0,32
50 add ecx,1
51 jnz t1
52 movd eax,mm0
53 mov ebx,[8+esp]
54 emms
55 ret
56
57 global ___gmpn_add_n
58 %ifdef DLL
59 export ___gmpn_add_n
60 %endif
61
62 align 8
63 ___gmpn_add_n:
64 pxor mm0,mm0
65 mov eax,[8+esp]
66 mov [8+esp],ebx
67 mov ebx,[12+esp]
68 mov edx,[4+esp]
69 mov ecx,[16+esp]
70 lea eax,[eax+ecx*4]
71 lea ebx,[ebx+ecx*4]
72 lea edx,[edx+ecx*4]
73 neg ecx
74 t2: movd mm1,[eax+ecx*4]
75 movd mm2,[ebx+ecx*4]
76 paddq mm1,mm2
77 paddq mm0,mm1
78 movd [edx+ecx*4],mm0
79 psrlq mm0,32
80 add ecx,1
81 jnz t2
82 movd eax,mm0
83 mov ebx,[8+esp]
84 emms
85 ret
86
87 end