beta-0.89.2
[luatex.git] / source / libs / gmp / gmp-src / mpn / vax / sub_n.asm
blob2844ef2cc1c537622e8b1a91dc9b452caea4e3ab
1 dnl VAX mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
2 dnl store difference in a third limb vector.
4 dnl Copyright 1999, 2000, 2012 Free Software Foundation, Inc.
6 dnl This file is part of the GNU MP Library.
7 dnl
8 dnl The GNU MP Library is free software; you can redistribute it and/or modify
9 dnl it under the terms of either:
10 dnl
11 dnl * the GNU Lesser General Public License as published by the Free
12 dnl Software Foundation; either version 3 of the License, or (at your
13 dnl option) any later version.
14 dnl
15 dnl or
16 dnl
17 dnl * the GNU General Public License as published by the Free Software
18 dnl Foundation; either version 2 of the License, or (at your option) any
19 dnl later version.
20 dnl
21 dnl or both in parallel, as here.
22 dnl
23 dnl The GNU MP Library is distributed in the hope that it will be useful, but
24 dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
25 dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26 dnl for more details.
27 dnl
28 dnl You should have received copies of the GNU General Public License and the
29 dnl GNU Lesser General Public License along with the GNU MP Library. If not,
30 dnl see https://www.gnu.org/licenses/.
32 include(`../config.m4')
34 ASM_START()
35 PROLOGUE(mpn_sub_n)
36 .word 0x0
37 movl 16(ap), r0
38 movl 12(ap), r1
39 movl 8(ap), r2
40 movl 4(ap), r3
41 mnegl r0, r5
42 addl2 $3, r0
43 ashl $-2, r0, r0 C unroll loop count
44 bicl2 $-4, r5 C mask out low 2 bits
45 movaq (r5)[r5], r5 C 9x
46 jmp L(top)[r5]
48 L(top): movl (r2)+, r4
49 sbwc (r1)+, r4
50 movl r4, (r3)+
51 movl (r2)+, r4
52 sbwc (r1)+, r4
53 movl r4, (r3)+
54 movl (r2)+, r4
55 sbwc (r1)+, r4
56 movl r4, (r3)+
57 movl (r2)+, r4
58 sbwc (r1)+, r4
59 movl r4, (r3)+
60 sobgtr r0, L(top)
62 adwc r0, r0
63 ret
64 EPILOGUE()