1/* mips3 sub_n -- Subtract two limb vectors of the same length > 0 and 2 * store difference in a third limb vector. 3 * 4 * Copyright (C) 1995, 1998, 1999, 2000, 5 * 2001 Free Software Foundation, Inc. 6 * 7 * This file is part of GnuPG. 8 * 9 * GnuPG is free software; you can redistribute it and/or modify 10 * it under the terms of the GNU General Public License as published by 11 * the Free Software Foundation; either version 3 of the License, or 12 * (at your option) any later version. 13 * 14 * GnuPG is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU General Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public License 20 * along with this program; if not, see <http://www.gnu.org/licenses/>. 21 */ 22 23 24/******************* 25 * mpi_limb_t 26 * mpihelp_sub_n( mpi_ptr_t res_ptr, (r4) 27 * mpi_ptr_t s1_ptr, (r5) 28 * mpi_ptr_t s2_ptr, (r6) 29 * mpi_size_t size) (r7) 30 */ 31 32 33 .text 34 .align 2 35 .globl mpihelp_sub_n 36 .ent mpihelp_sub_n 37mpihelp_sub_n: 38 .set noreorder 39 .set nomacro 40 41 ld $10,0($5) 42 ld $11,0($6) 43 44 daddiu $7,$7,-1 45 and $9,$7,4-1 # number of limbs in first loop 46 beq $9,$0,.L0 # if multiple of 4 limbs, skip first loop 47 move $2,$0 48 49 dsubu $7,$7,$9 50 51.Loop0: daddiu $9,$9,-1 52 ld $12,8($5) 53 daddu $11,$11,$2 54 ld $13,8($6) 55 sltu $8,$11,$2 56 dsubu $11,$10,$11 57 sltu $2,$10,$11 58 sd $11,0($4) 59 or $2,$2,$8 60 61 daddiu $5,$5,8 62 daddiu $6,$6,8 63 move $10,$12 64 move $11,$13 65 bne $9,$0,.Loop0 66 daddiu $4,$4,8 67 68.L0: beq $7,$0,.Lend 69 nop 70 71.Loop: daddiu $7,$7,-4 72 73 ld $12,8($5) 74 daddu $11,$11,$2 75 ld $13,8($6) 76 sltu $8,$11,$2 77 dsubu $11,$10,$11 78 sltu $2,$10,$11 79 sd $11,0($4) 80 or $2,$2,$8 81 82 ld $10,16($5) 83 daddu $13,$13,$2 84 ld $11,16($6) 85 sltu $8,$13,$2 86 dsubu $13,$12,$13 87 sltu $2,$12,$13 88 sd $13,8($4) 89 or $2,$2,$8 90 91 ld $12,24($5) 92 daddu $11,$11,$2 93 ld $13,24($6) 94 sltu $8,$11,$2 95 dsubu $11,$10,$11 96 sltu $2,$10,$11 97 sd $11,16($4) 98 or $2,$2,$8 99 100 ld $10,32($5) 101 daddu $13,$13,$2 102 ld $11,32($6) 103 sltu $8,$13,$2 104 dsubu $13,$12,$13 105 sltu $2,$12,$13 106 sd $13,24($4) 107 or $2,$2,$8 108 109 daddiu $5,$5,32 110 daddiu $6,$6,32 111 112 bne $7,$0,.Loop 113 daddiu $4,$4,32 114 115.Lend: daddu $11,$11,$2 116 sltu $8,$11,$2 117 dsubu $11,$10,$11 118 sltu $2,$10,$11 119 sd $11,0($4) 120 j $31 121 or $2,$2,$8 122 123 .end mpihelp_sub_n 124 125