Debian Codegraph @

mpn/powerpc64/mode64/p9/gcd_11.asm

raw
1 dnl PowerPC-64 mpn_gcd_11.
2
3 dnl Copyright 2000-2002, 2005, 2009, 2011-2013, 2019 Free Software Foundation,
4 dnl Inc.
5
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/.
31
32 include(`../config.m4')
33
34 C cycles/bit (approx)
35 C POWER3/PPC630 -
36 C POWER4/PPC970 -
37 C POWER5 -
38 C POWER6 -
39 C POWER7 -
40 C POWER8 -
41 C POWER9 5.75
42 C Numbers measured with: speed -CD -s16-64 -t48 mpn_gcd_1
43
44 define(`u0', `r3')
45 define(`v0', `r4')
46
47 define(`cnt', `r9')dnl
48
49 ASM_START()
50 PROLOGUE(mpn_gcd_11)
51 b L(odd)
52
53 ALIGN(16)
54 L(top): isel v0, u0, v0, 29 C v = min(u,v)
55 isel u0, r10, r11, 29 C u = |v - u|
56 srd u0, u0, cnt
57 L(odd): subf r10, u0, v0 C r10 = v - u
58 subf r11, v0, u0 C r11 = u - v
59 cmpld cr7, v0, u0
60 cnttzd cnt, r10
61 bne cr7, L(top)
62
63 L(end): blr
64 EPILOGUE()