Blame mpn/powerpc32/sqr_diag_addlsh1.asm
|
Packit |
5c3484 |
dnl PowerPC-32 mpn_sqr_diag_addlsh1.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
dnl Copyright 2013 Free Software Foundation, Inc.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
dnl This file is part of the GNU MP Library.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl The GNU MP Library is free software; you can redistribute it and/or modify
|
|
Packit |
5c3484 |
dnl it under the terms of either:
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl * the GNU Lesser General Public License as published by the Free
|
|
Packit |
5c3484 |
dnl Software Foundation; either version 3 of the License, or (at your
|
|
Packit |
5c3484 |
dnl option) any later version.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl or
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl * the GNU General Public License as published by the Free Software
|
|
Packit |
5c3484 |
dnl Foundation; either version 2 of the License, or (at your option) any
|
|
Packit |
5c3484 |
dnl later version.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl or both in parallel, as here.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl The GNU MP Library is distributed in the hope that it will be useful, but
|
|
Packit |
5c3484 |
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
Packit |
5c3484 |
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
Packit |
5c3484 |
dnl for more details.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl You should have received copies of the GNU General Public License and the
|
|
Packit |
5c3484 |
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
|
|
Packit |
5c3484 |
dnl see https://www.gnu.org/licenses/.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
include(`../config.m4')
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
C cycles/limb
|
|
Packit |
5c3484 |
C 603e ?
|
|
Packit |
5c3484 |
C 604e ?
|
|
Packit |
5c3484 |
C 75x (G3) ?
|
|
Packit |
5c3484 |
C 7400,7410 (G4) ?
|
|
Packit |
5c3484 |
C 744x,745x (G4+) 6
|
|
Packit |
5c3484 |
C power4/ppc970 ?
|
|
Packit |
5c3484 |
C power5 ?
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
C This has been feebly optimised for 7447 but not for any other CPU.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
define(`rp', r3)
|
|
Packit |
5c3484 |
define(`tp', r4)
|
|
Packit |
5c3484 |
define(`up', r5)
|
|
Packit |
5c3484 |
define(`n', r6)
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
ASM_START()
|
|
Packit |
5c3484 |
PROLOGUE(mpn_sqr_diag_addlsh1)
|
|
Packit |
5c3484 |
addi n, n, -1
|
|
Packit |
5c3484 |
addi tp, tp, -4
|
|
Packit |
5c3484 |
mtctr n
|
|
Packit |
5c3484 |
lwz r0, 0(up)
|
|
Packit |
5c3484 |
li r10, 0
|
|
Packit |
5c3484 |
mullw r7, r0, r0
|
|
Packit |
5c3484 |
stw r7, 0(rp)
|
|
Packit |
5c3484 |
mulhwu r6, r0, r0
|
|
Packit |
5c3484 |
addic r31, r31, 0 C clear CF
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
ALIGN(16)
|
|
Packit |
5c3484 |
L(top): lwzu r0, 4(up)
|
|
Packit |
5c3484 |
mullw r7, r0, r0
|
|
Packit |
5c3484 |
lwz r8, 4(tp)
|
|
Packit |
5c3484 |
lwzu r9, 8(tp)
|
|
Packit |
5c3484 |
rlwimi r10, r8, 1,0,30
|
|
Packit |
5c3484 |
srwi r11, r8, 31
|
|
Packit |
5c3484 |
rlwimi r11, r9, 1,0,30
|
|
Packit |
5c3484 |
adde r10, r10, r6
|
|
Packit |
5c3484 |
adde r11, r11, r7
|
|
Packit |
5c3484 |
stw r10, 4(rp)
|
|
Packit |
5c3484 |
srwi r10, r9, 31
|
|
Packit |
5c3484 |
mulhwu r6, r0, r0
|
|
Packit |
5c3484 |
stwu r11, 8(rp)
|
|
Packit |
5c3484 |
bdnz L(top)
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
adde r10, r10, r6
|
|
Packit |
5c3484 |
stw r10, 4(rp)
|
|
Packit |
5c3484 |
blr
|
|
Packit |
5c3484 |
EPILOGUE()
|