1
/* SPARC v8 __mpn_addmul_1 -- Multiply a limb vector with a limb and
2
* add the result to a second limb vector.
4
* Copyright (C) 1992, 1993, 1994, 1995, 1998,
5
* 2001 Free Software Foundation, Inc.
7
* This file is part of GnuPG.
9
* GnuPG is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; either version 2 of the License, or
12
* (at your option) any later version.
14
* GnuPG is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software
21
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
23
* Note: This code is heavily based on the GNU MP Library.
24
* Actually it's the same code with only minor changes in the
25
* way the data is stored; this is to support the abstraction
26
* of an optional secure memory allocation which may be used
27
* to avoid revealing of sensitive data due to paging etc.
28
* The GNU MP Library itself is published under the LGPL;
29
* however I decided to publish this code under the plain GPL.
44
.global C_SYMBOL_NAME(mpihelp_addmul_1)
45
C_SYMBOL_NAME(mpihelp_addmul_1):
52
mov %o7,%g4 ! Save return address register
55
1: mov %g4,%o7 ! Restore return address register
64
b Loop00 /* 4, 8, 12, ... */
67
LL01: b Loop01 /* 1, 5, 9, ... */
71
LL10: add %o0,-12,%o0 /* 2, 6, 10, ... */
75
LL11: add %o0,-8,%o0 /* 3, 7, 11, ... */
80
1: addcc %g3,%g2,%g3 ! 1
87
Loop00: umul %o4,%o3,%g3 ! 2
89
addxcc %g3,%g2,%g3 ! 2
96
Loop11: umul %o4,%o3,%g3 ! 3
97
addxcc %g3,%g2,%g3 ! 3
105
Loop10: umul %o4,%o3,%g3 ! 4
106
addxcc %g3,%g2,%g3 ! 4
115
Loop01: addcc %o2,-4,%o2
119
addcc %g3,%g2,%g3 ! 4
131
! umul, ld, addxcc, rd, st
133
! umul, ld, addxcc, rd, ld, addcc, st, addx