Annotation of OpenXM_contrib/gmp/mpn/powerpc32/750/com_n.asm, Revision 1.1.1.1
1.1 ohara 1: dnl PowerPC 750 mpn_com_n -- mpn bitwise one's complement
2:
3: dnl Copyright 2002 Free Software Foundation, Inc.
4: dnl
5: dnl This file is part of the GNU MP Library.
6: dnl
7: dnl The GNU MP Library is free software; you can redistribute it and/or
8: dnl modify it under the terms of the GNU Lesser General Public License as
9: dnl published by the Free Software Foundation; either version 2.1 of the
10: dnl License, or (at your option) any later version.
11: dnl
12: dnl The GNU MP Library is distributed in the hope that it will be useful,
13: dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14: dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: dnl Lesser General Public License for more details.
16: dnl
17: dnl You should have received a copy of the GNU Lesser General Public
18: dnl License along with the GNU MP Library; see the file COPYING.LIB. If
19: dnl not, write to the Free Software Foundation, Inc., 59 Temple Place -
20: dnl Suite 330, Boston, MA 02111-1307, USA.
21:
22: include(`../config.m4')
23:
24:
25: C cycles/limb
26: C 604e: 3.0
27: C 750: 2.0
28: C 7400: 2.0
29:
30:
31: C void mpn_com_n (mp_ptr dst, mp_srcptr src, mp_size_t size);
32: C
33: C This loop form is necessary for the claimed speed.
34:
35: ASM_START()
36: PROLOGUE(mpn_com_n)
37:
38: C r3 dst
39: C r4 src
40: C r5 size
41:
42: mtctr r5 C size
43: lwz r5, 0(r4) C src low limb
44:
45: sub r4, r4, r3 C src-dst
46: subi r3, r3, 4 C dst-4
47:
48: addi r4, r4, 8 C src-dst+8
49: bdz L(one)
50:
51: L(top):
52: C r3 &dst[i-1]
53: C r4 src-dst
54: C r5 src[i]
55: C r6 scratch
56:
57: not r6, r5 C ~src[i]
58: lwzx r5, r4,r3 C src[i+1]
59:
60: stwu r6, 4(r3) C dst[i]
61: bdnz L(top)
62:
63: L(one):
64: not r6, r5
65:
66: stw r6, 4(r3) C dst[size-1]
67: blr
68:
69: EPILOGUE()
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>