Annotation of OpenXM_contrib/gmp/mpn/x86/pentium/aorsmul_1.asm, Revision 1.1.1.2
1.1 maekawa 1: dnl Intel Pentium mpn_addmul_1 -- mpn by limb multiplication.
2:
1.1.1.2 ! ohara 3: dnl Copyright 1992, 1994, 1996, 1999, 2000, 2002 Free Software Foundation,
1.1 maekawa 4: dnl Inc.
5: dnl
6: dnl This file is part of the GNU MP Library.
7: dnl
8: dnl The GNU MP Library is free software; you can redistribute it and/or
9: dnl modify it under the terms of the GNU Lesser General Public License as
10: dnl published by the Free Software Foundation; either version 2.1 of the
11: dnl License, or (at your option) any later version.
12: dnl
13: dnl The GNU MP Library is distributed in the hope that it will be useful,
14: dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
15: dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16: dnl Lesser General Public License for more details.
17: dnl
18: dnl You should have received a copy of the GNU Lesser General Public
19: dnl License along with the GNU MP Library; see the file COPYING.LIB. If
20: dnl not, write to the Free Software Foundation, Inc., 59 Temple Place -
21: dnl Suite 330, Boston, MA 02111-1307, USA. */
22:
23: include(`../config.m4')
24:
25:
1.1.1.2 ! ohara 26: C P5: 14.0 cycles/limb
! 27:
! 28:
1.1 maekawa 29: ifdef(`OPERATION_addmul_1', `
30: define(M4_inst, addl)
31: define(M4_function_1, mpn_addmul_1)
1.1.1.2 ! ohara 32: define(M4_function_1c, mpn_addmul_1c)
1.1 maekawa 33:
34: ',`ifdef(`OPERATION_submul_1', `
35: define(M4_inst, subl)
36: define(M4_function_1, mpn_submul_1)
1.1.1.2 ! ohara 37: define(M4_function_1c, mpn_submul_1c)
1.1 maekawa 38:
39: ',`m4_error(`Need OPERATION_addmul_1 or OPERATION_submul_1
40: ')')')
41:
1.1.1.2 ! ohara 42: MULFUNC_PROLOGUE(mpn_addmul_1 mpn_addmul_1c mpn_submul_1 mpn_submul_1c)
1.1 maekawa 43:
44:
1.1.1.2 ! ohara 45: C mp_limb_t mpn_addmul_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
! 46: C mp_limb_t mult);
! 47: C mp_limb_t mpn_addmul_1c (mp_ptr dst, mp_srcptr src, mp_size_t size,
! 48: C mp_limb_t mult, mp_limb_t carry);
! 49: C
! 50: C mp_limb_t mpn_submul_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
! 51: C mp_limb_t mult);
! 52: C mp_limb_t mpn_submul_1c (mp_ptr dst, mp_srcptr src, mp_size_t size,
! 53: C mp_limb_t mult, mp_limb_t carry);
! 54: C
1.1 maekawa 55:
1.1.1.2 ! ohara 56: defframe(PARAM_CARRY, 20)
1.1 maekawa 57: defframe(PARAM_MULTIPLIER,16)
58: defframe(PARAM_SIZE, 12)
59: defframe(PARAM_SRC, 8)
60: defframe(PARAM_DST, 4)
61:
1.1.1.2 ! ohara 62: TEXT
! 63:
1.1 maekawa 64: ALIGN(8)
1.1.1.2 ! ohara 65: PROLOGUE(M4_function_1c)
! 66: deflit(`FRAME',0)
1.1 maekawa 67:
1.1.1.2 ! ohara 68: movl PARAM_CARRY, %ecx
! 69: pushl %esi FRAME_pushl()
! 70:
! 71: jmp L(start_1c)
! 72:
! 73: EPILOGUE()
! 74:
! 75:
! 76: ALIGN(8)
1.1 maekawa 77: PROLOGUE(M4_function_1)
1.1.1.2 ! ohara 78: deflit(`FRAME',0)
1.1 maekawa 79:
1.1.1.2 ! ohara 80: xorl %ecx, %ecx
! 81: pushl %esi FRAME_pushl()
1.1 maekawa 82:
1.1.1.2 ! ohara 83: L(start_1c):
1.1 maekawa 84: movl PARAM_SRC, %esi
1.1.1.2 ! ohara 85: movl PARAM_SIZE, %eax
1.1 maekawa 86:
1.1.1.2 ! ohara 87: pushl %edi FRAME_pushl()
! 88: pushl %ebx FRAME_pushl()
! 89:
! 90: movl PARAM_DST, %edi
! 91: leal -1(%eax), %ebx C size-1
! 92:
! 93: leal (%esi,%eax,4), %esi
! 94: xorl $-1, %ebx C -size, and clear carry
! 95:
! 96: leal (%edi,%eax,4), %edi
! 97:
! 98: L(top):
! 99: C eax
! 100: C ebx counter, negative
! 101: C ecx carry
! 102: C edx
! 103: C esi src end
! 104: C edi dst end
! 105: C ebp
1.1 maekawa 106:
1.1.1.2 ! ohara 107: adcl $0, %ecx
! 108: movl (%esi,%ebx,4), %eax
1.1 maekawa 109:
1.1.1.2 ! ohara 110: mull PARAM_MULTIPLIER
1.1 maekawa 111:
1.1.1.2 ! ohara 112: addl %ecx, %eax
! 113: movl (%edi,%ebx,4), %ecx
1.1 maekawa 114:
115: adcl $0, %edx
1.1.1.2 ! ohara 116: M4_inst %eax, %ecx
1.1 maekawa 117:
1.1.1.2 ! ohara 118: movl %ecx, (%edi,%ebx,4)
! 119: incl %ebx
1.1 maekawa 120:
1.1.1.2 ! ohara 121: movl %edx, %ecx
! 122: jnz L(top)
1.1 maekawa 123:
1.1.1.2 ! ohara 124:
! 125: adcl $0, %ecx
1.1 maekawa 126: popl %ebx
1.1.1.2 ! ohara 127:
! 128: movl %ecx, %eax
1.1 maekawa 129: popl %edi
1.1.1.2 ! ohara 130:
! 131: popl %esi
! 132:
1.1 maekawa 133: ret
134:
135: EPILOGUE()
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>