1 dnl PowerPC-32 mpn_mul_1 -- Multiply a limb vector with a limb and store
2 dnl the result in a second limb vector.
4 dnl Copyright (C) 1995, 1997, 2000 Free Software Foundation, Inc.
6 dnl This file is part of the GNU MP Library.
8 dnl The GNU MP Library is free software; you can redistribute it and/or modify
9 dnl it under the terms of the GNU Lesser General Public License as published by
10 dnl the Free Software Foundation; either version 2.1 of the License, or (at your
11 dnl option) any later version.
13 dnl The GNU MP Library is distributed in the hope that it will be useful, but
14 dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16 dnl License for more details.
18 dnl You should have received a copy of the GNU Lesser General Public License
19 dnl along with the GNU MP Library; see the file COPYING.LIB. If not, write to
20 dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
21 dnl MA 02111-1307, USA.
30 dnl This is optimized for the PPC604 but it runs decently even on PPC601. It
31 dnl has not been tested on a PPC603 since I don't have access to any such
34 include(`../config.m4')
39 addi r3,r3,-4 C adjust res_ptr, it's offset before it's used
40 li r12,0 C clear upper product reg
41 addic r0,r0,0 C clear cy
42 C Start software pipeline
45 stmw r30,-8(r1) C save registers we are supposed to preserve
50 C Software pipelined main loop
63 C Finish software pipeline
64 .Lend1: mullw r10,r9,r6
71 lmw r30,-8(r1) C restore registers from stack
73 .Lend2: mullw r11,r8,r6
80 lmw r30,-8(r1) C restore registers from stack
82 .Lend3: mullw r11,r8,r6