1
dnl Alpha mpn_sqr_diagonal.
3
dnl Copyright 2001 Free Software Foundation, Inc.
5
dnl This file is part of the GNU MP Library.
7
dnl The GNU MP Library is free software; you can redistribute it and/or modify
8
dnl it under the terms of the GNU Lesser General Public License as published
9
dnl by the Free Software Foundation; either version 2.1 of the License, or (at
10
dnl your option) any later version.
12
dnl The GNU MP Library is distributed in the hope that it will be useful, but
13
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15
dnl License for more details.
17
dnl You should have received a copy of the GNU Lesser General Public License
18
dnl along with the GNU MP Library; see the file COPYING.LIB. If not, write to
19
dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20
dnl MA 02111-1307, USA.
22
include(`../config.m4')
29
dnl This code runs at 42 cycles/limb on EV4, 18 cycles/limb on EV5, and 4
30
dnl cycles/limb on EV6.
33
PROLOGUE(mpn_sqr_diagonal)
34
ldq r2,0(r17) C r2 = s1_limb
35
lda r18,-2(r18) C size -= 2
36
mulq r2,r2,r3 C r3 = prod_low
37
umulh r2,r2,r4 C r4 = prod_high
38
blt r18,$Lend1 C jump if size was == 1
39
ldq r2,8(r17) C r2 = s1_limb
40
beq r18,$Lend2 C jump if size was == 2
44
mulq r2,r2,r3 C r3 = prod_low
45
lda r18,-1(r18) C size--
47
umulh r2,r2,r4 C r4 = cy_limb
48
ldq r2,16(r17) C r2 = s1_limb
49
lda r17,8(r17) C s1_ptr++
50
lda r16,16(r16) C res_ptr++
54
mulq r2,r2,r3 C r3 = prod_low
56
umulh r2,r2,r4 C r4 = cy_limb
63
EPILOGUE(mpn_sqr_diagonal)