|
Packit Service |
82fcde |
/* __mpn_sub_n -- Add two limb vectors of the same length > 0 and store
|
|
Packit Service |
82fcde |
sum in a third limb vector. 64 bit S/390 version.
|
|
Packit Service |
82fcde |
Copyright (C) 2001-2018 Free Software Foundation, Inc.
|
|
Packit Service |
82fcde |
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
|
|
Packit Service |
82fcde |
This file is part of the GNU MP Library.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit Service |
82fcde |
modify it under the terms of the GNU Lesser General Public License as
|
|
Packit Service |
82fcde |
published by the Free Software Foundation; either version 2.1 of the
|
|
Packit Service |
82fcde |
License, or (at your option) any later version.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit Service |
82fcde |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
82fcde |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
82fcde |
Lesser General Public License for more details.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
82fcde |
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
|
Packit Service |
82fcde |
see <http://www.gnu.org/licenses/>. */
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
/* INPUT PARAMETERS
|
|
Packit Service |
82fcde |
%r2 = res_ptr
|
|
Packit Service |
82fcde |
%r3 = s1_ptr
|
|
Packit Service |
82fcde |
%r4 = s2_ptr
|
|
Packit Service |
82fcde |
%r5 = size. */
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#include "sysdep.h"
|
|
Packit Service |
82fcde |
#include "asm-syntax.h"
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
ENTRY(__mpn_sub_n)
|
|
Packit Service |
82fcde |
stg %r6,48(%r15) # save register 6
|
|
Packit Service |
82fcde |
cfi_offset (%r6,-112)
|
|
Packit Service |
82fcde |
sgr %r1,%r1
|
|
Packit Service |
82fcde |
lghi %r0,1 # cannot use ahi to add carry, use slr
|
|
Packit Service |
82fcde |
.L0: lg %r6,0(%r1,%r3) # .L0 -> no carry from last sub
|
|
Packit Service |
82fcde |
slg %r6,0(%r1,%r4)
|
|
Packit Service |
82fcde |
stg %r6,0(%r1,%r2)
|
|
Packit Service |
82fcde |
la %r1,8(%r1)
|
|
Packit Service |
82fcde |
brc 4,.L3
|
|
Packit Service |
82fcde |
.L1: brct %r5,.L0
|
|
Packit Service |
82fcde |
slgr %r2,%r2 # no last carry to return
|
|
Packit Service |
82fcde |
j .Lexit
|
|
Packit Service |
82fcde |
.L2: lg %r6,0(%r1,%r3) # .L2 -> carry from last sub
|
|
Packit Service |
82fcde |
slg %r6,0(%r1,%r4)
|
|
Packit Service |
82fcde |
brc 4,.L4
|
|
Packit Service |
82fcde |
slgr %r6,%r0 # no carry yet, add carry from last sub
|
|
Packit Service |
82fcde |
stg %r6,0(%r1,%r2)
|
|
Packit Service |
82fcde |
la %r1,8(%r1)
|
|
Packit Service |
82fcde |
brc 11,.L1 # new carry ?
|
|
Packit Service |
82fcde |
.L3: brct %r5,.L2
|
|
Packit Service |
82fcde |
lgr %r2,%r0 # return last carry
|
|
Packit Service |
82fcde |
j .Lexit
|
|
Packit Service |
82fcde |
.L4: slgr %r6,%r0 # already a carry, add carry from last sub
|
|
Packit Service |
82fcde |
stg %r6,0(%r1,%r2)
|
|
Packit Service |
82fcde |
la %r1,8(%r1)
|
|
Packit Service |
82fcde |
brct %r5,.L2
|
|
Packit Service |
82fcde |
lgr %r2,%r0 # return last carry
|
|
Packit Service |
82fcde |
.Lexit: lg %r6,48(%r15) # restore register 6
|
|
Packit Service |
82fcde |
br %r14
|
|
Packit Service |
82fcde |
END(__mpn_sub_n)
|