2
; Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
4
; This file is part of the GNU MP Library.
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.
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.
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.
21
; Translation of AT&T syntax code by Brian Gladman
27
%define PARAM_SIZE esp+frame+8
28
%define PARAM_SRC esp+frame+4
30
; re-use parameter space
31
%define SAVE_EBX PARAM_SRC
33
global ___gmpn_mod_34lsub1
35
export ___gmpn_mod_34lsub1
49
shr eax,24 ; src[0] low
51
and edx,0xFFFFFF ; src[0] high
56
shr edx,16 ; src[1] high
59
shl ecx,8 ; src[1] low
73
mov [SAVE_EBX],ebx ; and arrange 16-byte loop alignment
78
xor eax,eax ; and clear carry flag
97
; ecx is -2,-1 or 0 representing 0,1 or 2 more limbs,respectively
119
shr eax,24 ; 0mod3 high
120
and ecx,edi ; carry masked
121
sub eax,ecx ; apply carry
123
shr ebx,16 ; 1mod3 high
124
and edx,0x00FFFFFF ; 0mod3 low
125
add eax,edx ; apply 0mod3 low
127
shl edi,8 ; 1mod3 low
128
add eax,ebx ; apply 1mod3 high
129
add eax,edi ; apply 1mod3 low
131
shr esi,8 ; 2mod3 high
132
and edx,0xFF ; 2mod3 low
133
shl edx,16 ; 2mod3 low
134
add eax,esi ; apply 2mod3 high
135
add eax,edx ; apply 2mod3 low