dnl PowerPC-32 mpn_invert_limb -- Invert a normalized limb.
dnl Copyright 2011 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/limb
C 603e: ?
C 604e: ?
C 75x (G3): ?
C 7400,7410 (G4): ?
C 744x,745x (G4+): 32
C power4/ppc970: ?
C power5: ?
EXTERN(approx_tab)
ASM_START()
PROLOGUE(mpn_invert_limb)
rlwinm r6, r3, 11, 22, 30 C extract bits 30..22 to pos 2^1
srwi r10, r3, 11 C extract bits 31..11 LEA( r9, approx_tab) C N.B. clobbers r0 for ELF and Darwin
lhzx r9, r9, r6 C w2
addi r0, r10, 1
mullw r11, r9, r9
slwi r9, r9, 4
mulhwu r7, r11, r0
rlwinm r11, r3, 0, 31, 31 C extract bit 0
addi r0, r9, -1
srwi r9, r3, 1 C d >> 1
subf r0, r7, r0 C w1 add r9, r9, r11 C d31
mullw r9, r0, r9 C w1 * d31
srwi r10, r0, 1 C w1 >> 1 neg r11, r11 and r11, r10, r11
subf r11, r9, r11
mulhwu r9, r11, r0
slwi r0, r0, 15
srwi r9, r9, 1 add r0, r9, r0 C w0
mullw r10, r0, r3
mulhwu r9, r0, r3
addc r11, r10, r3
adde r3, r9, r3
subf r3, r3, r0
blr
EPILOGUE()
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.