1997-06-29 22:05:27 +00:00
|
|
|
/* SPARC v9 __mpn_mul_1 -- Multiply a limb vector with a single limb and
|
|
|
|
store the product in a second limb vector.
|
1996-03-01 18:45:35 +00:00
|
|
|
|
2019-01-01 00:11:28 +00:00
|
|
|
Copyright (C) 1995-2019 Free Software Foundation, Inc.
|
1996-03-01 18:45:35 +00:00
|
|
|
|
1997-06-29 22:05:27 +00:00
|
|
|
This file is part of the GNU MP Library.
|
1996-03-01 18:45:35 +00:00
|
|
|
|
1997-06-29 22:05:27 +00:00
|
|
|
The GNU MP Library is free software; you can redistribute it and/or modify
|
2001-07-07 10:13:33 +00:00
|
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or (at your
|
1997-06-29 22:05:27 +00:00
|
|
|
option) any later version.
|
1996-03-01 18:45:35 +00:00
|
|
|
|
1997-06-29 22:05:27 +00:00
|
|
|
The GNU MP Library is distributed in the hope that it will be useful, but
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
2001-07-07 10:13:33 +00:00
|
|
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
1997-06-29 22:05:27 +00:00
|
|
|
License for more details.
|
1996-03-01 18:45:35 +00:00
|
|
|
|
2001-07-07 10:13:33 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
2012-02-09 23:18:22 +00:00
|
|
|
along with the GNU MP Library; see the file COPYING.LIB. If not,
|
|
|
|
see <http://www.gnu.org/licenses/>. */
|
1996-03-01 18:45:35 +00:00
|
|
|
|
1997-06-29 22:05:27 +00:00
|
|
|
#include <sysdep.h>
|
1996-03-01 18:45:35 +00:00
|
|
|
|
|
|
|
|
1997-06-29 22:05:27 +00:00
|
|
|
/* INPUT PARAMETERS
|
|
|
|
res_ptr o0
|
|
|
|
s1_ptr o1
|
|
|
|
size o2
|
|
|
|
s2_limb o3 */
|
|
|
|
|
|
|
|
ENTRY(__mpn_mul_1)
|
1996-03-01 18:45:35 +00:00
|
|
|
!#PROLOGUE# 0
|
Update.
1998-09-14 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* sysdeps/mach/hurd/dl-cache.c (_dl_unload_cache): New dummy
function. Reported by okuji@kuicr.kyoto-u.ac.jp [PR libc/789].
1998-09-15 David S. Miller <davem@pierdol.cobaltmicro.com>
* sysdeps/sparc/sparc32/dl-machine.h (elf_machine_runtime_setup):
Add profiling support.
(TRAMPOLINE_TEMPLATE): New macro.
(ELF_MACHINE_RUNTIME_TRAMPOLINE): Define in terms of that.
(RTLD_START): Prettify, and set __libc_stack_end properly.
(elf_machine_rela) [R_SPARC_COPY]: Remove RTLD_BOOTSTRAP ifndef
and check for sym being NULL instead.
* sysdeps/sparc/sparc64/addmul_1.S: Adjust to allocate 192 bytes
of stack space.
* sysdeps/sparc/sparc64/lshift.S: Likewise.
* sysdeps/sparc/sparc64/mul_1.S: Likewise.
* sysdeps/sparc/sparc64/rshift.S: Likewise.
* sysdeps/sparc/sparc64/submul_1.S: Likewise.
* sysdeps/sparc/sparc64/elf/crtbegin.S: Likewise and remove old
MEDANY code model %g4 usage.
* sysdeps/sparc/sparc64/elf/crtend.S: Likewise and remove old
MEDANY code model %g4 usage.
* sysdeps/sparc/sparc64/elf/start.S: Rework to not use old FULLANY
code model address formation.
* sysdeps/sparc/sparc64/dl-machine.h: Don't include link.h, do
include elf/ldsodefs.h
(DT_SPARC): Remove.
(elf_machine_matches_host): It is now EM_SPARCV9.
(elf_machine_dynamic): Clean up to remove ugly cast.
(elf_machine_fixup_plt): Rework for new V9 ABI, add support for
new PLT formats.
(elf_machine_rela): Don't do anything at all for R_SPARC_NONE.
Prettify rest of function.
[R_SPARC_COPY]: Check for sym being NULL.
[R_SPARC_32]: Handle it.
[R_SPARC_H44, R_SPARC_M44, R_SPARC_L44]: Handle them for the
MEDMID code model.
[R_SPARC_HH22, R_SPARC_HM10, R_SPARC_LM22]: Handle them for the
MEDANY code model.
[R_SPARC_NONE]: Remove this case, as it is now checked earlier.
(elf_machine_runtime_setup): Rewrite for new V9 ABI plt formats.
Add profiling support.
(TRAMPOLINE_TEMPLATE): New macro.
(ELF_MACHINE_RUNTIME_TRAMPOLINE): Define in terms of that.
(RTLD_START): Prettify and set __libc_stack_end.
* sysdeps/unix/sysv/linux/sparc/bits/sigaction.h (SA_SIGINFO):
Define.
* sysdeps/unix/sysv/linux/sparc/bits/signum.h (_NSIG): Set to 64.
(SIGRTMIN, SIGRTMAX, __SIGRTMIN, __SIGRTMAX): Define.
* sysdeps/unix/sysv/linux/sparc/sparc32/brk.c (__brk): Remove
unused variable scratch.
* sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
(__syscall_rt_sigaction, __rt_sigreturn_stub, __sigreturn_stub):
Declare.
(__sigaction): Rewrite rt_sigaction case to pass correct sigreturn
stub to rt_sigaction syscalls. Rewrite non-rt case to use correct
old format kernel sigaction structures.
* sysdeps/unix/sysv/linux/sparc/sparc64/ucontext.h: Move...
* sysdeps/unix/sysv/linux/sparc/sparc64/sys/ucontext.h: to here.
* sysdeps/unix/sysv/linux/sparc/sparc64/Dist: Remove ucontext.h
* sysdeps/unix/sysv/linux/sparc/sparc64/bits/setjmp.h: Fix
ucontext include.
(_JMPBUF_UNWINDS): Define.
* sysdeps/unix/sysv/linux/sparc/sparc64/bits/statfs.h: Declare
statfs64 structure, which is exactly the same as the normal one.
* sysdeps/unix/sysv/linux/sparc/sparc64/brk.S: Allocate 192 bytes
of stack. Use correct syscall trap number. Add branch prediction
settings to branch instructions. Remove old MEDANY code model %g4
referneces for non-PIC.
* sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/init-first.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Add
__libc_longjmp and __libc_siglongjmp strong aliases.
* sysdeps/unix/sysv/linux/sparc/sparc64/readdir.c (__readdir64):
Also define to __no__readdir64_decl around readdir.c inclusion.
(__readdir64): Add strong alias.
* sysdeps/unix/sysv/linux/sparc/sparc64/socket.S: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list (getrlimit):
Set strong and weak names properly.
1998-09-16 11:25 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* manual/Makefile (AWK): Default to gawk if standalone.
1998-09-15 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makefile (distribute): Undo last change.
* Make-dist (+tsrc) [not subdir]: Also include indirection headers
for sysdep headers.
(+subdir-headers): Removed, unused.
1998-09-15 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* stdio-common/Makefile ($(inst_includedir)/bits/stdio_lim.h): Use
$(do-install).
1998-09-15 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makerules ($(+sysdir_pfx)sysd-Makefile): Don't check for
absolute name in $(config-sysdirs), can never happen.
($(+sysdir_pfx)sysd-rules): Likewise.
* Makeconfig (full-config-sysdirs): Likewise.
(all-Subdirs-files): Prepend $(..).
* configure.in: Don't check for absolute name in $add_ons_pfx, can
not happen. Let --enable-add-ons=yes work if no add-ons actually
exist.
1998-09-15 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Rules ($(common-objpfx)bits/stdio_%.h): Remove extra
continuations in command.
1998-09-15 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* libio/oldstdfiles.c (_IO_stdin_used): Update declaration.
1998-09-16 17:54:34 +00:00
|
|
|
save %sp,-192,%sp
|
1996-03-01 18:45:35 +00:00
|
|
|
!#PROLOGUE# 1
|
1997-06-29 22:05:27 +00:00
|
|
|
|
1996-03-01 18:45:35 +00:00
|
|
|
sub %g0,%i2,%o7
|
|
|
|
sllx %o7,3,%g5
|
|
|
|
sub %i1,%g5,%o3
|
|
|
|
sub %i0,%g5,%o4
|
|
|
|
mov 0,%o0 ! zero cy_limb
|
|
|
|
|
|
|
|
srl %i3,0,%o1 ! extract low 32 bits of s2_limb
|
|
|
|
srlx %i3,32,%i3 ! extract high 32 bits of s2_limb
|
|
|
|
mov 1,%o2
|
|
|
|
sllx %o2,32,%o2 ! o2 = 0x100000000
|
|
|
|
|
|
|
|
! hi !
|
|
|
|
! mid-1 !
|
|
|
|
! mid-2 !
|
|
|
|
! lo !
|
|
|
|
.Loop:
|
|
|
|
sllx %o7,3,%g1
|
|
|
|
ldx [%o3+%g1],%g5
|
|
|
|
srl %g5,0,%i0 ! zero hi bits
|
|
|
|
srlx %g5,32,%g5
|
|
|
|
mulx %o1,%i0,%i4 ! lo product
|
|
|
|
mulx %i3,%i0,%i1 ! mid-1 product
|
|
|
|
mulx %o1,%g5,%l2 ! mid-2 product
|
|
|
|
mulx %i3,%g5,%i5 ! hi product
|
|
|
|
srlx %i4,32,%i0 ! extract high 32 bits of lo product...
|
|
|
|
add %i1,%i0,%i1 ! ...and add it to the mid-1 product
|
|
|
|
addcc %i1,%l2,%i1 ! add mid products
|
|
|
|
mov 0,%l0 ! we need the carry from that add...
|
|
|
|
movcs %xcc,%o2,%l0 ! ...compute it and...
|
|
|
|
add %i5,%l0,%i5 ! ...add to bit 32 of the hi product
|
|
|
|
sllx %i1,32,%i0 ! align low bits of mid product
|
|
|
|
srl %i4,0,%g5 ! zero high 32 bits of lo product
|
|
|
|
add %i0,%g5,%i0 ! combine into low 64 bits of result
|
|
|
|
srlx %i1,32,%i1 ! extract high bits of mid product...
|
|
|
|
add %i5,%i1,%i1 ! ...and add them to the high result
|
|
|
|
addcc %i0,%o0,%i0 ! add cy_limb to low 64 bits of result
|
|
|
|
mov 0,%g5
|
|
|
|
movcs %xcc,1,%g5
|
1999-07-06 16:26:03 +00:00
|
|
|
addcc %o7,1,%o7
|
1996-03-01 18:45:35 +00:00
|
|
|
stx %i0,[%o4+%g1]
|
1999-07-06 16:26:03 +00:00
|
|
|
bne,pt %xcc,.Loop
|
1997-06-29 22:05:27 +00:00
|
|
|
add %i1,%g5,%o0 ! compute new cy_limb
|
1996-03-01 18:45:35 +00:00
|
|
|
|
1997-06-29 22:05:27 +00:00
|
|
|
jmpl %i7+8,%g0
|
1999-07-06 16:26:03 +00:00
|
|
|
restore %o0,%g0,%o0
|
1997-06-29 22:05:27 +00:00
|
|
|
|
|
|
|
END(__mpn_mul_1)
|