1 /* i80386 __mpn_lshift --
2 Copyright (C) 1992, 1994, 1997 Free Software Foundation, Inc.
3 This file is part of the GNU MP Library.
5 The GNU MP Library is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Library General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or (at your
8 option) any later version.
10 The GNU MP Library is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with the GNU MP Library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18 MA 02111-1307, USA. */
29 #include "asm-syntax.h"
33 .globl C_SYMBOL_NAME(__mpn_lshift)
34 C_SYMBOL_NAME(__mpn_lshift:)
39 movl 16(%esp),%edi /* res_ptr */
40 movl 20(%esp),%esi /* s_ptr */
41 movl 24(%esp),%edx /* size */
42 movl 28(%esp),%ecx /* cnt */
44 subl $4,%esi /* adjust s_ptr */
46 movl (%esi,%edx,4),%ebx /* read most significant limb */
48 shldl %cl,%ebx,%eax /* compute carry limb */
51 pushl %eax /* push carry limb onto stack */
53 jnz L(1) /* enter loop in the middle */
57 L(oop): movl (%esi,%edx,4),%ebx /* load next lower limb */
58 shldl %cl,%ebx,%eax /* compute result limb */
59 movl %eax,(%edi,%edx,4) /* store it */
61 L(1): movl (%esi,%edx,4),%eax
63 movl %ebx,(%edi,%edx,4)
67 shll %cl,%eax /* compute least significant limb */
68 movl %eax,(%edi) /* store it */
70 popl %eax /* pop carry limb */
77 L(end): shll %cl,%ebx /* compute least significant limb */
78 movl %ebx,(%edi) /* store it */