|
Packit |
5c3484 |
dnl S/390 mpn_mul_1 -- Multiply a limb vector with a limb and store the
|
|
Packit |
5c3484 |
dnl result in a second limb vector.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
dnl Copyright 2001 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 |
define(`rp',2)
|
|
Packit |
5c3484 |
define(`up',3)
|
|
Packit |
5c3484 |
define(`n',4)
|
|
Packit |
5c3484 |
define(`vlimb',5)
|
|
Packit |
5c3484 |
define(`cylimb',7)
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
ASM_START()
|
|
Packit |
5c3484 |
PROLOGUE(mpn_mul_1)
|
|
Packit |
5c3484 |
stm 6,7,24(15)
|
|
Packit |
5c3484 |
slr cylimb,cylimb # clear cylimb
|
|
Packit |
5c3484 |
ltr vlimb,vlimb
|
|
Packit |
5c3484 |
jnl .Loopp
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
.Loopn: l 1,0(up) # load from u
|
|
Packit |
5c3484 |
lr 6,1 #
|
|
Packit |
5c3484 |
mr 0,vlimb # multiply signed
|
|
Packit |
5c3484 |
alr 0,6 # add vlimb to phi
|
|
Packit |
5c3484 |
sra 6,31 # make mask
|
|
Packit |
5c3484 |
nr 6,vlimb # 0 or vlimb
|
|
Packit |
5c3484 |
alr 0,6 # conditionally add vlimb to phi
|
|
Packit |
5c3484 |
alr 1,cylimb # add carry limb to plo
|
|
Packit |
5c3484 |
brc 8+4,+8 # branch if not carry
|
|
Packit |
5c3484 |
ahi 0,1 # increment phi
|
|
Packit |
5c3484 |
lr cylimb,0 # new cylimb
|
|
Packit |
5c3484 |
st 1,0(rp) # store
|
|
Packit |
5c3484 |
la up,4(,up)
|
|
Packit |
5c3484 |
la rp,4(,rp)
|
|
Packit |
5c3484 |
brct n,.Loopn
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
lr 2,cylimb
|
|
Packit |
5c3484 |
lm 6,7,24(15)
|
|
Packit |
5c3484 |
br 14
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
.Loopp: l 1,0(up) # load from u
|
|
Packit |
5c3484 |
lr 6,1 #
|
|
Packit |
5c3484 |
mr 0,vlimb # multiply signed
|
|
Packit |
5c3484 |
sra 6,31 # make mask
|
|
Packit |
5c3484 |
nr 6,vlimb # 0 or vlimb
|
|
Packit |
5c3484 |
alr 0,6 # conditionally add vlimb to phi
|
|
Packit |
5c3484 |
alr 1,cylimb # add carry limb to plo
|
|
Packit |
5c3484 |
brc 8+4,+8 # branch if not carry
|
|
Packit |
5c3484 |
ahi 0,1 # increment phi
|
|
Packit |
5c3484 |
lr cylimb,0 # new cylimb
|
|
Packit |
5c3484 |
st 1,0(rp) # store
|
|
Packit |
5c3484 |
la up,4(,up)
|
|
Packit |
5c3484 |
la rp,4(,rp)
|
|
Packit |
5c3484 |
brct n,.Loopp
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
lr 2,cylimb
|
|
Packit |
5c3484 |
lm 6,7,24(15)
|
|
Packit |
5c3484 |
br 14
|
|
Packit |
5c3484 |
EPILOGUE(mpn_mul_1)
|