1 dnl Alpha mpn_sqr_diagonal.
3 dnl Copyright 2001, 2002 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 3 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. If not, see http://www.gnu.org/licenses/.
20 include(`../config.m4')
34 PROLOGUE(mpn_sqr_diagonal)
35 ldq r2,0(r17) C r2 = s1_limb
36 lda r18,-2(r18) C size -= 2
37 mulq r2,r2,r3 C r3 = prod_low
38 umulh r2,r2,r4 C r4 = prod_high
39 blt r18,$Lend1 C jump if size was == 1
40 ldq r2,8(r17) C r2 = s1_limb
41 beq r18,$Lend2 C jump if size was == 2
45 mulq r2,r2,r3 C r3 = prod_low
46 lda r18,-1(r18) C size--
48 umulh r2,r2,r4 C r4 = cy_limb
49 ldq r2,16(r17) C r2 = s1_limb
50 lda r17,8(r17) C s1_ptr++
51 lda r16,16(r16) C res_ptr++
55 mulq r2,r2,r3 C r3 = prod_low
57 umulh r2,r2,r4 C r4 = cy_limb
64 EPILOGUE(mpn_sqr_diagonal)