Blame sysdeps/mips/sub_n.S

Packit 6c4009
/* MIPS2 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
Packit 6c4009
store difference in a third limb vector.
Packit 6c4009
Packit 6c4009
Copyright (C) 1995-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.  If not, see
Packit 6c4009
<http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#include <sysdep.h>
Packit 6c4009
Packit 6c4009
/* INPUT PARAMETERS
Packit 6c4009
   res_ptr	$4
Packit 6c4009
   s1_ptr	$5
Packit 6c4009
   s2_ptr	$6
Packit 6c4009
   size		$7
Packit 6c4009
*/
Packit 6c4009
#ifdef __PIC__
Packit 6c4009
	.option pic2
Packit 6c4009
#endif
Packit 6c4009
ENTRY (__mpn_sub_n)
Packit 6c4009
	.set	noreorder
Packit 6c4009
#ifdef __PIC__
Packit 6c4009
	.cpload t9
Packit 6c4009
#endif
Packit 6c4009
	.set	nomacro
Packit 6c4009
Packit 6c4009
	lw	$10,0($5)
Packit 6c4009
	lw	$11,0($6)
Packit 6c4009
Packit 6c4009
	addiu	$7,$7,-1
Packit 6c4009
	and	$9,$7,4-1	/* number of limbs in first loop */
Packit 6c4009
	beq	$9,$0,L(L0)	/* if multiple of 4 limbs, skip first loop */
Packit 6c4009
	move	$2,$0
Packit 6c4009
Packit 6c4009
	subu	$7,$7,$9
Packit 6c4009
Packit 6c4009
L(Loop0):	addiu	$9,$9,-1
Packit 6c4009
	lw	$12,4($5)
Packit 6c4009
	addu	$11,$11,$2
Packit 6c4009
	lw	$13,4($6)
Packit 6c4009
	sltu	$8,$11,$2
Packit 6c4009
	subu	$11,$10,$11
Packit 6c4009
	sltu	$2,$10,$11
Packit 6c4009
	sw	$11,0($4)
Packit 6c4009
	or	$2,$2,$8
Packit 6c4009
Packit 6c4009
	addiu	$5,$5,4
Packit 6c4009
	addiu	$6,$6,4
Packit 6c4009
	move	$10,$12
Packit 6c4009
	move	$11,$13
Packit 6c4009
	bne	$9,$0,L(Loop0)
Packit 6c4009
	addiu	$4,$4,4
Packit 6c4009
Packit 6c4009
L(L0):	beq	$7,$0,L(Lend)
Packit 6c4009
	nop
Packit 6c4009
Packit 6c4009
L(Loop):	addiu	$7,$7,-4
Packit 6c4009
Packit 6c4009
	lw	$12,4($5)
Packit 6c4009
	addu	$11,$11,$2
Packit 6c4009
	lw	$13,4($6)
Packit 6c4009
	sltu	$8,$11,$2
Packit 6c4009
	subu	$11,$10,$11
Packit 6c4009
	sltu	$2,$10,$11
Packit 6c4009
	sw	$11,0($4)
Packit 6c4009
	or	$2,$2,$8
Packit 6c4009
Packit 6c4009
	lw	$10,8($5)
Packit 6c4009
	addu	$13,$13,$2
Packit 6c4009
	lw	$11,8($6)
Packit 6c4009
	sltu	$8,$13,$2
Packit 6c4009
	subu	$13,$12,$13
Packit 6c4009
	sltu	$2,$12,$13
Packit 6c4009
	sw	$13,4($4)
Packit 6c4009
	or	$2,$2,$8
Packit 6c4009
Packit 6c4009
	lw	$12,12($5)
Packit 6c4009
	addu	$11,$11,$2
Packit 6c4009
	lw	$13,12($6)
Packit 6c4009
	sltu	$8,$11,$2
Packit 6c4009
	subu	$11,$10,$11
Packit 6c4009
	sltu	$2,$10,$11
Packit 6c4009
	sw	$11,8($4)
Packit 6c4009
	or	$2,$2,$8
Packit 6c4009
Packit 6c4009
	lw	$10,16($5)
Packit 6c4009
	addu	$13,$13,$2
Packit 6c4009
	lw	$11,16($6)
Packit 6c4009
	sltu	$8,$13,$2
Packit 6c4009
	subu	$13,$12,$13
Packit 6c4009
	sltu	$2,$12,$13
Packit 6c4009
	sw	$13,12($4)
Packit 6c4009
	or	$2,$2,$8
Packit 6c4009
Packit 6c4009
	addiu	$5,$5,16
Packit 6c4009
	addiu	$6,$6,16
Packit 6c4009
Packit 6c4009
	bne	$7,$0,L(Loop)
Packit 6c4009
	addiu	$4,$4,16
Packit 6c4009
Packit 6c4009
L(Lend):	addu	$11,$11,$2
Packit 6c4009
	sltu	$8,$11,$2
Packit 6c4009
	subu	$11,$10,$11
Packit 6c4009
	sltu	$2,$10,$11
Packit 6c4009
	sw	$11,0($4)
Packit 6c4009
	j	$31
Packit 6c4009
	or	$2,$2,$8
Packit 6c4009
	END (__mpn_sub_n)