Annotation of OpenXM_contrib/gmp/mpn/powerpc32/submul_1.s, Revision 1.1
1.1 ! maekawa 1: # PowerPC-32 __mpn_submul_1 -- Multiply a limb vector with a limb and subtract
! 2: # the result from a second limb vector.
! 3:
! 4: # Copyright (C) 1995 Free Software Foundation, Inc.
! 5:
! 6: # This file is part of the GNU MP Library.
! 7:
! 8: # The GNU MP Library is free software; you can redistribute it and/or modify
! 9: # it under the terms of the GNU Library General Public License as published by
! 10: # the Free Software Foundation; either version 2 of the License, or (at your
! 11: # option) any later version.
! 12:
! 13: # The GNU MP Library is distributed in the hope that it will be useful, but
! 14: # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
! 15: # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
! 16: # License for more details.
! 17:
! 18: # You should have received a copy of the GNU Library General Public License
! 19: # along with the GNU MP Library; see the file COPYING.LIB. If not, write to
! 20: # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
! 21: # MA 02111-1307, USA.
! 22:
! 23:
! 24: # INPUT PARAMETERS
! 25: # res_ptr r3
! 26: # s1_ptr r4
! 27: # size r5
! 28: # s2_limb r6
! 29:
! 30: # This is a fairly straightforward implementation. The timing of the PC601
! 31: # is hard to understand, so I will wait to optimize this until I have some
! 32: # hardware to play with.
! 33:
! 34: # The code trivially generalizes to 64 bit limbs for the PC620.
! 35:
! 36: .toc
! 37: .csect .__mpn_submul_1[PR]
! 38: .align 2
! 39: .globl __mpn_submul_1
! 40: .globl .__mpn_submul_1
! 41: .csect __mpn_submul_1[DS]
! 42: __mpn_submul_1:
! 43: .long .__mpn_submul_1[PR], TOC[tc0], 0
! 44: .csect .__mpn_submul_1[PR]
! 45: .__mpn_submul_1:
! 46: mtctr 5
! 47:
! 48: lwz 0,0(4)
! 49: mullw 7,0,6
! 50: mulhwu 10,0,6
! 51: lwz 9,0(3)
! 52: subfc 8,7,9
! 53: addc 7,7,8 # invert cy (r7 is junk)
! 54: addi 3,3,-4
! 55: bdz Lend
! 56:
! 57: Loop: lwzu 0,4(4)
! 58: stwu 8,4(3)
! 59: mullw 8,0,6
! 60: adde 7,8,10
! 61: mulhwu 10,0,6
! 62: lwz 9,4(3)
! 63: addze 10,10
! 64: subfc 8,7,9
! 65: addc 7,7,8 # invert cy (r7 is junk)
! 66: bdnz Loop
! 67:
! 68: Lend: stw 8,4(3)
! 69: addze 3,10
! 70: blr
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>