Blame sysdeps/s390/s390-32/mul_1.S

Packit 6c4009
/* __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) 2000-2018 Free Software Foundation, Inc.
Packit 6c4009
   Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
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   %r2
Packit 6c4009
   s1_ptr    %r3
Packit 6c4009
   size	     %r4
Packit 6c4009
   s2_limb   %r5
Packit 6c4009
*/
Packit 6c4009
Packit 6c4009
#include <sysdep.h>
Packit 6c4009
#include "asm-syntax.h"
Packit 6c4009
Packit 6c4009
	.text
Packit 6c4009
ENTRY(__mpn_mul_1)
Packit 6c4009
	st     %r6,24(%r15)
Packit 6c4009
	cfi_offset (%r6, -72)
Packit 6c4009
	slr    %r6,%r6            # cy_limb = 0
Packit 6c4009
.L0:    icm    %r1,15,0(%r3)      # get s1_ptr[i]
Packit 6c4009
	mr     %r0,%r5            # umul_ppmm(prod_high,prod_low,s1_ptr[j],s2_limb)
Packit 6c4009
	jnm    .L1
Packit 6c4009
	alr    %r0,%r5
Packit 6c4009
.L1:    ltr    %r5,%r5
Packit 6c4009
	jnm    .L2
Packit 6c4009
	al     %r0,0(%r3)
Packit 6c4009
.L2:    alr    %r1,%r6            # prod_low += cy_limb
Packit 6c4009
	lr     %r6,%r0            # cy_limb = prod_high
Packit 6c4009
	brc    12,.L3
Packit 6c4009
	ahi    %r6,1              #           + (prod_low < cy_limb)
Packit 6c4009
.L3:    st     %r1,0(%r2)
Packit 6c4009
	la     %r2,4(0,%r2)
Packit 6c4009
	la     %r3,4(0,%r3)
Packit 6c4009
	brct   %r4,.L0
Packit 6c4009
	lr     %r2,%r6            # return cy_limb
Packit 6c4009
	l      %r6,24(%r15)
Packit 6c4009
.Lexit: br     %r14
Packit 6c4009
END(__mpn_mul_1)