1dnl PowerPC-64 mpn_gcd_11. 2 3dnl Copyright 2000-2002, 2005, 2009, 2011-2013, 2019 Free Software Foundation, 4dnl Inc. 5 6dnl This file is part of the GNU MP Library. 7dnl 8dnl The GNU MP Library is free software; you can redistribute it and/or modify 9dnl it under the terms of either: 10dnl 11dnl * the GNU Lesser General Public License as published by the Free 12dnl Software Foundation; either version 3 of the License, or (at your 13dnl option) any later version. 14dnl 15dnl or 16dnl 17dnl * the GNU General Public License as published by the Free Software 18dnl Foundation; either version 2 of the License, or (at your option) any 19dnl later version. 20dnl 21dnl or both in parallel, as here. 22dnl 23dnl The GNU MP Library is distributed in the hope that it will be useful, but 24dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 25dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 26dnl for more details. 27dnl 28dnl You should have received copies of the GNU General Public License and the 29dnl GNU Lesser General Public License along with the GNU MP Library. If not, 30dnl see https://www.gnu.org/licenses/. 31 32include(`../config.m4') 33 34C cycles/bit (approx) 35C POWER3/PPC630 - 36C POWER4/PPC970 - 37C POWER5 - 38C POWER6 - 39C POWER7 - 40C POWER8 - 41C POWER9 5.75 42C Numbers measured with: speed -CD -s16-64 -t48 mpn_gcd_1 43 44define(`u0', `r3') 45define(`v0', `r4') 46 47define(`cnt', `r9')dnl 48 49ASM_START() 50PROLOGUE(mpn_gcd_11) 51 b L(odd) 52 53 ALIGN(16) 54L(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 57L(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 63L(end): blr 64EPILOGUE() 65