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 cycles/limb
C norm unorm
C AMD K8,K9 1111
C AMD K10 1111
C AMD bull 13.514
C AMD pile 1415
C AMD steam
C AMD excavator
C AMD bobcat 1414
C AMD jaguar 14.515
C Intel P4 3333
C Intel core2 13.513.25
C Intel NHM 1414
C Intel SBR 88.25
C Intel IBR 7.757.85
C Intel HWL 88
C Intel BWL 88
C Intel SKL 88
C Intel atom 3436
C Intel SLM 13.713.5
C VIA nano 19.2519.25 needs re-measuring
C INPUT PARAMETERS
define(`rp', `%rdi')
define(`up', `%rsi')
define(`n', `%rdx')
define(`d', `%rcx')
define(`di', `%r8') C just mpn_pi1_bdiv_q_1
define(`ncnt', `%r9') C just mpn_pi1_bdiv_q_1
ABI_SUPPORT(DOS64)
ABI_SUPPORT(STD64)
ASM_START()
TEXT ALIGN(16)
PROLOGUE(mpn_bdiv_q_1)
FUNC_ENTRY(4) push %rbx
mov %rcx, %r11 C d mov %rdx, %r10 C n mov %r9, %rcx C ncnt
L(pi1): mov (up), %rax C up[0]
dec %r10 jz L(one)
lea8(up,%r10,8), up C up end lea (rp,%r10,8), rp C rp end neg %r10 C -n
test R32(%rcx), R32(%rcx) jnz L(unorm) C branch if count != 0 xor R32(%rbx), R32(%rbx) jmp L(nent)
ALIGN(8)
L(ntop):mul %r11 C carry limb in rdx 010 mov -8(up,%r10,8), %rax C sub %rbx, %rax C apply carry bit
setc R8(%rbx) C sub %rdx, %rax C apply carry limb 5 adc $0, R32(%rbx) C 6
L(nent):imul %r8, %rax C 6 mov %rax, (rp,%r10,8) C inc %r10 C jnz L(ntop)
mov -8(up), %r9 C up high limb jmp L(com)
L(unorm): mov (up,%r10,8), %r9 C up[1] shr R8(%rcx), %rax C neg R32(%rcx)
shl R8(%rcx), %r9 C neg R32(%rcx) or %r9, %rax xor R32(%rbx), R32(%rbx) jmp L(uent)
ALIGN(8)
L(utop):mul %r11 C carry limb in rdx 010 mov (up,%r10,8), %rax C
shl R8(%rcx), %rax C neg R32(%rcx) or %r9, %rax sub %rbx, %rax C apply carry bit
setc R8(%rbx) C sub %rdx, %rax C apply carry limb 5 adc $0, R32(%rbx) C 6
L(uent):imul %r8, %rax C 6 mov (up,%r10,8), %r9 C shr R8(%rcx), %r9 C neg R32(%rcx) mov %rax, (rp,%r10,8) C inc %r10 C jnz L(utop)
L(com): mul %r11 C carry limb in rdx sub %rbx, %r9 C apply carry bit sub %rdx, %r9 C apply carry limb
imul %r8, %r9 mov %r9, (rp) pop %rbx
FUNC_EXIT() ret
L(one): shr R8(%rcx), %rax
imul %r8, %rax mov %rax, (rp) pop %rbx
FUNC_EXIT() ret
EPILOGUE()
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-06-04)
¤
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.