1dnl PPC64 mpn_bdiv_dbm1c. 2 3dnl Copyright 2008, 2010 Free Software Foundation, Inc. 4 5dnl This file is part of the GNU MP Library. 6 7dnl The GNU MP Library is free software; you can redistribute it and/or modify 8dnl it under the terms of the GNU Lesser General Public License as published 9dnl by the Free Software Foundation; either version 3 of the License, or (at 10dnl your option) any later version. 11 12dnl The GNU MP Library is distributed in the hope that it will be useful, but 13dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 14dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 15dnl License for more details. 16 17dnl You should have received a copy of the GNU Lesser General Public License 18dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. 19 20include(`../config.m4') 21 22C cycles/limb 23C POWER3/PPC630 6-18 24C POWER4/PPC970 8.5? 25C POWER5 8.5 fluctuating as function of n % 3 26C POWER6 15 27C POWER6 15 28C POWER7 4.75 29 30C TODO 31C * Nothing to do... 32 33C INPUT PARAMETERS 34define(`rp', `r3') 35define(`up', `r4') 36define(`n', `r5') 37define(`bd', `r6') 38define(`cy', `r7') 39 40ASM_START() 41PROLOGUE(mpn_bdiv_dbm1c) 42 ld r0, 0(r4) 43 44 rldicl. r12, r5, 0,62 45 cmpldi cr6, r12, 2 46 cmpldi cr7, r5, 4 47 addi r5, r5, 1 48 srwi r5, r5, 2 49 mtctr r5 50 beq cr0, L(b00) 51 blt cr6, L(b01) 52 beq cr6, L(b10) 53 54 ALIGN(16) 55L(b11): mulld r5, r0, r6 56 mulhdu r12, r0, r6 57 ld r0, 8(r4) 58 addi r4, r4, -24 59 addi r3, r3, -24 60 b L(3) 61 62 ALIGN(16) 63L(b00): mulld r9, r0, r6 64 mulhdu r8, r0, r6 65 addi r4, r4, -16 66 addi r3, r3, -16 67 b L(0) 68 69 ALIGN(16) 70L(b01): mulld r5, r0, r6 71 mulhdu r12, r0, r6 72 addi r3, r3, -8 73 ble cr7, L(e1) 74 ld r0, 8(r4) 75 addi r4, r4, -8 76 b L(1) 77 78 ALIGN(16) 79L(b10): mulld r9, r0, r6 80 mulhdu r8, r0, r6 81 ble cr7, L(e2) 82 83 ALIGN(16) 84L(top): subfc r11, r9, r7 85 ld r10, 8(r4) 86 ld r0, 16(r4) 87 subfe r7, r8, r11 88 std r11, 0(r3) 89 mulld r5, r10, r6 90 mulhdu r12, r10, r6 91L(1): mulld r9, r0, r6 92 mulhdu r8, r0, r6 93 subfc r11, r5, r7 94 subfe r7, r12, r11 95 std r11, 8(r3) 96L(0): subfc r11, r9, r7 97 ld r10, 24(r4) 98 ld r0, 32(r4) 99 subfe r7, r8, r11 100 std r11, 16(r3) 101 mulld r5, r10, r6 102 mulhdu r12, r10, r6 103L(3): mulld r9, r0, r6 104 mulhdu r8, r0, r6 105 subfc r11, r5, r7 106 subfe r7, r12, r11 107 std r11, 24(r3) 108 addi r4, r4, 32 109 addi r3, r3, 32 110 bdnz L(top) 111 112L(e2): ld r10, 8(r4) 113 mulld r5, r10, r6 114 mulhdu r12, r10, r6 115 subfc r11, r9, r7 116 subfe r7, r8, r11 117 std r11, 0(r3) 118L(e1): subfc r11, r5, r7 119 std r11, 8(r3) 120 subfe r3, r12, r11 121 blr 122EPILOGUE() 123