]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/sparc/sparc64/multiarch/sub_n-vis3.S
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / sparc / sparc64 / multiarch / sub_n-vis3.S
CommitLineData
32fcb36d
DM
1! SPARC v9 64-bit VIS3 __mpn_sub_n -- Subtract two limb vectors of the same length > 0
2! and store difference in a third limb vector.
3!
04277e02 4! Copyright (C) 2013-2019 Free Software Foundation, Inc.
32fcb36d
DM
5! This file is part of the GNU C Library.
6! Contributed by David S. Miller <davem@davemloft.net>
7!
8! The GNU C Library is free software; you can redistribute it and/or
9! modify it under the terms of the GNU Lesser General Public
10! License as published by the Free Software Foundation; either
11! version 2.1 of the License, or (at your option) any later version.
12!
13! The GNU C Library is distributed in the hope that it will be useful,
14! but WITHOUT ANY WARRANTY; without even the implied warranty of
15! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16! Lesser General Public License for more details.
17!
18! You should have received a copy of the GNU Lesser General Public
19! License along with the GNU C Library; if not, see
20! <http://www.gnu.org/licenses/>.
21
22#include <sysdep.h>
23
24#define res_ptr %o0
25#define s1_ptr %o1
26#define s2_ptr %o2
27#define sz %o3
28#define tmp1 %g1
29#define tmp2 %g2
30#define tmp3 %g3
31#define tmp4 %o4
32
33 .register %g2,#scratch
34 .register %g3,#scratch
35ENTRY(__mpn_sub_n_vis3)
36 subcc sz, 1, sz
37 be .Lfinal_limb
38 cmp %g0, 1
39
40.Lloop:
41 ldx [s2_ptr + 0x00], tmp1
42 add s2_ptr, 0x10, s2_ptr
43 ldx [s1_ptr + 0x00], tmp2
44 add s1_ptr, 0x10, s1_ptr
45 ldx [s2_ptr - 0x08], tmp3
46 add res_ptr, 0x10, res_ptr
47 ldx [s1_ptr - 0x08], tmp4
48 sub sz, 2, sz
49 xnor tmp1, %g0, tmp1
50 addxccc tmp1, tmp2, tmp1
51 stx tmp1, [res_ptr - 0x10]
52 xnor tmp3, %g0, tmp3
53 addxccc tmp3, tmp4, tmp3
54 brgz sz, .Lloop
55 stx tmp3, [res_ptr - 0x08]
56
57 brlz,pt sz, .Lfinish
58 nop
59
60.Lfinal_limb:
61 ldx [s2_ptr + 0x00], tmp1
62 ldx [s1_ptr + 0x00], tmp2
63 xnor tmp1, %g0, tmp1
64 addxccc tmp1, tmp2, tmp1
65 stx tmp1, [res_ptr + 0x00]
66
67.Lfinish:
68 clr %o0
69 retl
70 movcc %xcc, 1, %o0
71END(__mpn_sub_n_vis3)