Blame sysdeps/powerpc/powerpc64/mul_1.S
|
Packit |
6c4009 |
/* PowerPC64 __mpn_mul_1 -- Multiply a limb vector with a limb and store
|
|
Packit |
6c4009 |
the result in a second limb vector.
|
|
Packit |
6c4009 |
Copyright (C) 1999-2018 Free Software Foundation, Inc.
|
|
Packit |
6c4009 |
This file is part of the GNU C Library.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit |
6c4009 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License as published by the Free Software Foundation; either
|
|
Packit |
6c4009 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit |
6c4009 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
6c4009 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
6c4009 |
Lesser General Public License for more details.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License along with the GNU C Library; if not, see
|
|
Packit |
6c4009 |
<http://www.gnu.org/licenses/>. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#include <sysdep.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#define RP r3
|
|
Packit |
6c4009 |
#define UP r4
|
|
Packit |
6c4009 |
#define N r5
|
|
Packit |
6c4009 |
#define VL r6
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ENTRY_TOCLESS (__mpn_mul_1, 5)
|
|
Packit Service |
3b0880 |
std r27, -40(r1)
|
|
Packit Service |
3b0880 |
std r26, -48(r1)
|
|
Packit |
6c4009 |
li r12, 0
|
|
Packit |
6c4009 |
ld r26, 0(UP)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
rldicl. r0, N, 0, 62
|
|
Packit |
6c4009 |
cmpdi VL, r0, 2
|
|
Packit |
6c4009 |
addic N, N, RP
|
|
Packit |
6c4009 |
srdi N, N, 2
|
|
Packit |
6c4009 |
mtctr N
|
|
Packit |
6c4009 |
beq cr0, L(b00)
|
|
Packit |
6c4009 |
blt cr6, L(b01)
|
|
Packit |
6c4009 |
beq cr6, L(b10)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
L(b11): mr cr7, r12
|
|
Packit |
6c4009 |
mulld cr0, r26, VL
|
|
Packit |
6c4009 |
mulhdu r12, r26, VL
|
|
Packit |
6c4009 |
addi UP, UP, 8
|
|
Packit |
6c4009 |
addc r0, r0, r7
|
|
Packit |
6c4009 |
std r0, 0(RP)
|
|
Packit |
6c4009 |
addi RP, RP, 8
|
|
Packit |
6c4009 |
b L(fic)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
L(b00): ld r27, r8(UP)
|
|
Packit |
6c4009 |
addi UP, UP, 16
|
|
Packit |
6c4009 |
mulld r0, r26, VL
|
|
Packit |
6c4009 |
mulhdu N, r26, VL
|
|
Packit |
6c4009 |
mulld r7, r27, VL
|
|
Packit |
6c4009 |
mulhdu r8, r27, VL
|
|
Packit |
6c4009 |
addc r0, r0, r12
|
|
Packit |
6c4009 |
adde r7, r7, N
|
|
Packit |
6c4009 |
addze r12, r8
|
|
Packit |
6c4009 |
std r0, 0(RP)
|
|
Packit |
6c4009 |
std r7, 8(RP)
|
|
Packit |
6c4009 |
addi RP, RP, 16
|
|
Packit |
6c4009 |
b L(fic)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
nop
|
|
Packit |
6c4009 |
L(b01): bdnz L(gt1)
|
|
Packit |
6c4009 |
mulld r0, r26, VL
|
|
Packit |
6c4009 |
mulhdu r8, r26, VL
|
|
Packit |
6c4009 |
addc r0, r0, r12
|
|
Packit |
6c4009 |
std r0, 0(RP)
|
|
Packit |
6c4009 |
b L(ret)
|
|
Packit |
6c4009 |
L(gt1): ld r27, 8(UP)
|
|
Packit |
6c4009 |
nop
|
|
Packit |
6c4009 |
mulld r0, r26, VL
|
|
Packit |
6c4009 |
mulhdu N, r26, VL
|
|
Packit |
6c4009 |
ld r26, 16(UP)
|
|
Packit |
6c4009 |
mulld r7, r27, VL
|
|
Packit |
6c4009 |
mulhdu r8, r27, VL
|
|
Packit |
6c4009 |
mulld r9, r26, VL
|
|
Packit |
6c4009 |
mulhdu r10, r26, VL
|
|
Packit |
6c4009 |
addc r0, r0, r12
|
|
Packit |
6c4009 |
adde r7, r7, N
|
|
Packit |
6c4009 |
adde r9, r9, r8
|
|
Packit |
6c4009 |
addze r12, r10
|
|
Packit |
6c4009 |
std r0, 0(RP)
|
|
Packit |
6c4009 |
std r7, 8(RP)
|
|
Packit |
6c4009 |
std r9, 16(RP)
|
|
Packit |
6c4009 |
addi UP, UP, 24
|
|
Packit |
6c4009 |
addi RP, RP, 24
|
|
Packit |
6c4009 |
b L(fic)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
nop
|
|
Packit |
6c4009 |
L(fic): ld r26, 0(UP)
|
|
Packit |
6c4009 |
L(b10): ld r27, 8(UP)
|
|
Packit |
6c4009 |
addi UP, UP, 16
|
|
Packit |
6c4009 |
bdz L(end)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
L(top): mulld r0, r26, VL
|
|
Packit |
6c4009 |
mulhdu N, r26, VL
|
|
Packit |
6c4009 |
mulld r7, r27, VL
|
|
Packit |
6c4009 |
mulhdu r8, r27, VL
|
|
Packit |
6c4009 |
ld r26, 0(UP)
|
|
Packit |
6c4009 |
ld r27, 8(UP)
|
|
Packit |
6c4009 |
adde r0, r0, r12
|
|
Packit |
6c4009 |
adde r7, r7, N
|
|
Packit |
6c4009 |
mulld r9, r26, VL
|
|
Packit |
6c4009 |
mulhdu r10, r26, VL
|
|
Packit |
6c4009 |
mulld r11, r27, VL
|
|
Packit |
6c4009 |
mulhdu r12, r27, VL
|
|
Packit |
6c4009 |
ld r26, 16(UP)
|
|
Packit |
6c4009 |
ld r27, 24(UP)
|
|
Packit |
6c4009 |
std r0, 0(RP)
|
|
Packit |
6c4009 |
adde r9, r9, r8
|
|
Packit |
6c4009 |
std r7, 8(RP)
|
|
Packit |
6c4009 |
adde r11, r11, r10
|
|
Packit |
6c4009 |
std r9, 16(RP)
|
|
Packit |
6c4009 |
addi UP, UP, 32
|
|
Packit |
6c4009 |
std r11, 24(RP)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
addi RP, RP, 32
|
|
Packit |
6c4009 |
bdnz L(top)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
L(end): mulld r0, r26, VL
|
|
Packit |
6c4009 |
mulhdu N, r26, VL
|
|
Packit |
6c4009 |
mulld r7, r27, VL
|
|
Packit |
6c4009 |
mulhdu r8, r27, VL
|
|
Packit |
6c4009 |
adde r0, r0, r12
|
|
Packit |
6c4009 |
adde r7, r7, N
|
|
Packit |
6c4009 |
std r0, 0(RP)
|
|
Packit |
6c4009 |
std r7, 8(RP)
|
|
Packit |
6c4009 |
L(ret): addze RP, r8
|
|
Packit Service |
3b0880 |
ld r27, -40(r1)
|
|
Packit Service |
3b0880 |
ld r26, -48(r1)
|
|
Packit |
6c4009 |
blr
|
|
Packit |
6c4009 |
END(__mpn_mul_1)
|