|
Packit |
6c4009 |
! SPARC __mpn_submul_1 -- Multiply a limb vector with a limb and subtract
|
|
Packit |
6c4009 |
! the result from a second limb vector.
|
|
Packit |
6c4009 |
!
|
|
Packit |
6c4009 |
! Copyright (C) 1992-2018 Free Software Foundation, Inc.
|
|
Packit |
6c4009 |
!
|
|
Packit |
6c4009 |
! This file is part of the GNU MP Library.
|
|
Packit |
6c4009 |
!
|
|
Packit |
6c4009 |
! The GNU MP Library is free software; you can redistribute it and/or modify
|
|
Packit |
6c4009 |
! it under the terms of the GNU Lesser General Public License as published by
|
|
Packit |
6c4009 |
! the Free Software Foundation; either version 2.1 of the License, or (at your
|
|
Packit |
6c4009 |
! option) any later version.
|
|
Packit |
6c4009 |
!
|
|
Packit |
6c4009 |
! The GNU MP Library is distributed in the hope that it will be useful, but
|
|
Packit |
6c4009 |
! WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
Packit |
6c4009 |
! or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
Packit |
6c4009 |
! License for more details.
|
|
Packit |
6c4009 |
!
|
|
Packit |
6c4009 |
! You should have received a copy of the GNU Lesser General Public License
|
|
Packit |
6c4009 |
! along with the GNU MP Library; see the file COPYING.LIB. If not,
|
|
Packit |
6c4009 |
! see <http://www.gnu.org/licenses/>.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
! INPUT PARAMETERS
|
|
Packit |
6c4009 |
! RES_PTR o0
|
|
Packit |
6c4009 |
! S1_PTR o1
|
|
Packit |
6c4009 |
! SIZE o2
|
|
Packit |
6c4009 |
! S2_LIMB o3
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#include <sysdep.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ENTRY(__mpn_submul_1)
|
|
Packit |
6c4009 |
! Make S1_PTR and RES_PTR point at the end of their blocks
|
|
Packit |
6c4009 |
! and put (- 4 x SIZE) in index/loop counter.
|
|
Packit |
6c4009 |
sll %o2,2,%o2
|
|
Packit |
6c4009 |
add %o0,%o2,%o4 ! RES_PTR in o4 since o0 is retval
|
|
Packit |
6c4009 |
add %o1,%o2,%o1
|
|
Packit |
6c4009 |
sub %g0,%o2,%o2
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
cmp %o3,0xfff
|
|
Packit |
6c4009 |
bgu LOC(large)
|
|
Packit |
6c4009 |
nop
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ld [%o1+%o2],%o5
|
|
Packit |
6c4009 |
mov 0,%o0
|
|
Packit |
6c4009 |
b LOC(0)
|
|
Packit |
6c4009 |
add %o4,-4,%o4
|
|
Packit |
6c4009 |
LOC(loop0):
|
|
Packit |
6c4009 |
subcc %o5,%g1,%g1
|
|
Packit |
6c4009 |
ld [%o1+%o2],%o5
|
|
Packit |
6c4009 |
addx %o0,%g0,%o0
|
|
Packit |
6c4009 |
st %g1,[%o4+%o2]
|
|
Packit |
6c4009 |
LOC(0): wr %g0,%o3,%y
|
|
Packit |
6c4009 |
sra %o5,31,%g2
|
|
Packit |
6c4009 |
and %o3,%g2,%g2
|
|
Packit |
6c4009 |
andcc %g1,0,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o5,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o5,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o5,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o5,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o5,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o5,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o5,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o5,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o5,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o5,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o5,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o5,%g1
|
|
Packit |
6c4009 |
mulscc %g1,0,%g1
|
|
Packit |
6c4009 |
sra %g1,20,%g4
|
|
Packit |
6c4009 |
sll %g1,12,%g1
|
|
Packit |
6c4009 |
rd %y,%g3
|
|
Packit |
6c4009 |
srl %g3,20,%g3
|
|
Packit |
6c4009 |
or %g1,%g3,%g1
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
addcc %g1,%o0,%g1
|
|
Packit |
6c4009 |
addx %g2,%g4,%o0 ! add sign-compensation and cy to hi limb
|
|
Packit |
6c4009 |
addcc %o2,4,%o2 ! loop counter
|
|
Packit |
6c4009 |
bne LOC(loop0)
|
|
Packit |
6c4009 |
ld [%o4+%o2],%o5
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
subcc %o5,%g1,%g1
|
|
Packit |
6c4009 |
addx %o0,%g0,%o0
|
|
Packit |
6c4009 |
retl
|
|
Packit |
6c4009 |
st %g1,[%o4+%o2]
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
LOC(large):
|
|
Packit |
6c4009 |
ld [%o1+%o2],%o5
|
|
Packit |
6c4009 |
mov 0,%o0
|
|
Packit |
6c4009 |
sra %o3,31,%g4 ! g4 = mask of ones iff S2_LIMB < 0
|
|
Packit |
6c4009 |
b LOC(1)
|
|
Packit |
6c4009 |
add %o4,-4,%o4
|
|
Packit |
6c4009 |
LOC(loop):
|
|
Packit |
6c4009 |
subcc %o5,%g3,%g3
|
|
Packit |
6c4009 |
ld [%o1+%o2],%o5
|
|
Packit |
6c4009 |
addx %o0,%g0,%o0
|
|
Packit |
6c4009 |
st %g3,[%o4+%o2]
|
|
Packit |
6c4009 |
LOC(1): wr %g0,%o5,%y
|
|
Packit |
6c4009 |
and %o5,%g4,%g2
|
|
Packit |
6c4009 |
andcc %g0,%g0,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%o3,%g1
|
|
Packit |
6c4009 |
mulscc %g1,%g0,%g1
|
|
Packit |
6c4009 |
rd %y,%g3
|
|
Packit |
6c4009 |
addcc %g3,%o0,%g3
|
|
Packit |
6c4009 |
addx %g2,%g1,%o0
|
|
Packit |
6c4009 |
addcc %o2,4,%o2
|
|
Packit |
6c4009 |
bne LOC(loop)
|
|
Packit |
6c4009 |
ld [%o4+%o2],%o5
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
subcc %o5,%g3,%g3
|
|
Packit |
6c4009 |
addx %o0,%g0,%o0
|
|
Packit |
6c4009 |
retl
|
|
Packit |
6c4009 |
st %g3,[%o4+%o2]
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
END(__mpn_submul_1)
|