; mc88110 __gmpn_add_n -- Add two limb vectors of the same length > 0 and store
; sum in a third limb vector.
; Copyright 1995, 1996, 2000 Free Software Foundation, Inc.
; This file is part of the GNU MP Library.
;
; The GNU MP Library is free software; you can redistribute it and/or modify
; it under the terms of either:
;
; * the GNU Lesser General Public License as published by the Free
; Software Foundation; either version 3 of the License, or (at your
; option) any later version.
;
; or
;
; * the GNU General Public License as published by the Free Software
; Foundation; either version 2 of the License, or (at your option) any
; later version.
;
; or both in parallel, as here.
;
; The GNU MP Library is distributed in the hope that it will be useful, but
; WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
; for more details.
;
; You should have received copies of the GNU General Public License and the
; GNU Lesser General Public License along with the GNU MP Library. If not,
; see https://www.gnu.org/licenses/.
bb0 0,size,Lret1 /* Add last limb */ ld r10,s1_ptr,8 ld r8,s2_ptr,8
addu.cio r6,r10,r8 st r6,res_ptr,8
Lret1: jmp.n r1
addu.ci r2,r0,r0 ; return carry-out from most sign. limb
L1: xor r12,s1_ptr,res_ptr
bb1 2,r12,L2
; ** V1b **
or r12,r0,s2_ptr
or s2_ptr,r0,s1_ptr
or s1_ptr,r0,r12
br L0
; ** V2 ** /* If we come here, the alignment of s1_ptr and res_ptr as well as the alignment of s2_ptr and res_ptr differ. Since there are only two ways things can be aligned (that we care about) we now know that the alignment
of s1_ptr and s2_ptr are the same. */
L2: cmp r12,size,1
bb1 eq,r12,Ljone
bb0 2,s1_ptr,L_v2 ; branch if s1_ptr is aligned /* Add least significant limb separately to align res_ptr and s2_ptr */ ld r10,s1_ptr,0
addu s1_ptr,s1_ptr,4 ld r8,s2_ptr,0
addu s2_ptr,s2_ptr,4
subu size,size,1
addu.co r6,r10,r8 st r6,res_ptr,0
addu res_ptr,res_ptr,4
L_v2: subu size,size,8
bcnd lt0,size,Lfin2 /* Add blocks of 8 limbs until less than 8 limbs remain */ align 8
Loop2: subu size,size,8 ld.d r8,s1_ptr,0 ld.d r6,s2_ptr,0
addu.cio r8,r8,r6 st r8,res_ptr,0
addu.cio r9,r9,r7 st r9,res_ptr,4 ld.d r8,s1_ptr,8 ld.d r6,s2_ptr,8
addu.cio r8,r8,r6 st r8,res_ptr,8
addu.cio r9,r9,r7 st r9,res_ptr,12 ld.d r8,s1_ptr,16 ld.d r6,s2_ptr,16
addu.cio r8,r8,r6 st r8,res_ptr,16
addu.cio r9,r9,r7 st r9,res_ptr,20 ld.d r8,s1_ptr,24 ld.d r6,s2_ptr,24
addu.cio r8,r8,r6 st r8,res_ptr,24
addu.cio r9,r9,r7 st r9,res_ptr,28
addu s1_ptr,s1_ptr,32
addu s2_ptr,s2_ptr,32
addu res_ptr,res_ptr,32
bcnd ge0,size,Loop2
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.