Blame sysdeps/x86_64/addmul_1.S
|
Packit Service |
82fcde |
/* x86-64 __mpn_addmul_1 -- Multiply a limb vector with a limb and add
|
|
Packit Service |
82fcde |
the result to a second limb vector.
|
|
Packit Service |
82fcde |
Copyright (C) 2003-2018 Free Software Foundation, Inc.
|
|
Packit Service |
82fcde |
This file is part of the GNU MP Library.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
The GNU MP Library is free software; you can redistribute it and/or modify
|
|
Packit Service |
82fcde |
it under the terms of the GNU Lesser General Public License as published by
|
|
Packit Service |
82fcde |
the Free Software Foundation; either version 2.1 of the License, or (at your
|
|
Packit Service |
82fcde |
option) any later version.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
The GNU MP Library is distributed in the hope that it will be useful, but
|
|
Packit Service |
82fcde |
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
Packit Service |
82fcde |
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
Packit Service |
82fcde |
License for more details.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
You should have received a copy of the GNU Lesser General Public License
|
|
Packit Service |
82fcde |
along with the GNU MP Library; see the file COPYING.LIB. If not,
|
|
Packit Service |
82fcde |
see <http://www.gnu.org/licenses/>. */
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#include "sysdep.h"
|
|
Packit Service |
82fcde |
#include "asm-syntax.h"
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#define rp %rdi
|
|
Packit Service |
82fcde |
#define up %rsi
|
|
Packit Service |
82fcde |
#define n %rdx
|
|
Packit Service |
82fcde |
#define v0 %rcx
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#ifndef func
|
|
Packit Service |
82fcde |
# define func __mpn_addmul_1
|
|
Packit Service |
82fcde |
# define ADDSUB add
|
|
Packit Service |
82fcde |
#endif
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
.text
|
|
Packit Service |
82fcde |
ENTRY (func)
|
|
Packit Service |
82fcde |
push %rbx
|
|
Packit Service |
82fcde |
push %rbp
|
|
Packit Service |
82fcde |
lea (%rdx), %rbx
|
|
Packit Service |
82fcde |
neg %rbx
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
mov (up), %rax
|
|
Packit Service |
82fcde |
mov (rp), %r10
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
lea -16(rp,%rdx,8), rp
|
|
Packit Service |
82fcde |
lea (up,%rdx,8), up
|
|
Packit Service |
82fcde |
mul %rcx
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
bt $0, %ebx
|
|
Packit Service |
82fcde |
jc L(odd)
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
lea (%rax), %r11
|
|
Packit Service |
82fcde |
mov 8(up,%rbx,8), %rax
|
|
Packit Service |
82fcde |
lea (%rdx), %rbp
|
|
Packit Service |
82fcde |
mul %rcx
|
|
Packit Service |
82fcde |
add $2, %rbx
|
|
Packit Service |
82fcde |
jns L(n2)
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
lea (%rax), %r8
|
|
Packit Service |
82fcde |
mov (up,%rbx,8), %rax
|
|
Packit Service |
82fcde |
lea (%rdx), %r9
|
|
Packit Service |
82fcde |
jmp L(mid)
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
L(odd): add $1, %rbx
|
|
Packit Service |
82fcde |
jns L(n1)
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
lea (%rax), %r8
|
|
Packit Service |
82fcde |
mov (up,%rbx,8), %rax
|
|
Packit Service |
82fcde |
lea (%rdx), %r9
|
|
Packit Service |
82fcde |
mul %rcx
|
|
Packit Service |
82fcde |
lea (%rax), %r11
|
|
Packit Service |
82fcde |
mov 8(up,%rbx,8), %rax
|
|
Packit Service |
82fcde |
lea (%rdx), %rbp
|
|
Packit Service |
82fcde |
jmp L(e)
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
.p2align 4
|
|
Packit Service |
82fcde |
L(top): mul %rcx
|
|
Packit Service |
82fcde |
ADDSUB %r8, %r10
|
|
Packit Service |
82fcde |
lea (%rax), %r8
|
|
Packit Service |
82fcde |
mov (up,%rbx,8), %rax
|
|
Packit Service |
82fcde |
adc %r9, %r11
|
|
Packit Service |
82fcde |
mov %r10, -8(rp,%rbx,8)
|
|
Packit Service |
82fcde |
mov (rp,%rbx,8), %r10
|
|
Packit Service |
82fcde |
lea (%rdx), %r9
|
|
Packit Service |
82fcde |
adc $0, %rbp
|
|
Packit Service |
82fcde |
L(mid): mul %rcx
|
|
Packit Service |
82fcde |
ADDSUB %r11, %r10
|
|
Packit Service |
82fcde |
lea (%rax), %r11
|
|
Packit Service |
82fcde |
mov 8(up,%rbx,8), %rax
|
|
Packit Service |
82fcde |
adc %rbp, %r8
|
|
Packit Service |
82fcde |
mov %r10, (rp,%rbx,8)
|
|
Packit Service |
82fcde |
mov 8(rp,%rbx,8), %r10
|
|
Packit Service |
82fcde |
lea (%rdx), %rbp
|
|
Packit Service |
82fcde |
adc $0, %r9
|
|
Packit Service |
82fcde |
L(e): add $2, %rbx
|
|
Packit Service |
82fcde |
js L(top)
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
mul %rcx
|
|
Packit Service |
82fcde |
ADDSUB %r8, %r10
|
|
Packit Service |
82fcde |
adc %r9, %r11
|
|
Packit Service |
82fcde |
mov %r10, -8(rp)
|
|
Packit Service |
82fcde |
adc $0, %rbp
|
|
Packit Service |
82fcde |
L(n2): mov (rp), %r10
|
|
Packit Service |
82fcde |
ADDSUB %r11, %r10
|
|
Packit Service |
82fcde |
adc %rbp, %rax
|
|
Packit Service |
82fcde |
mov %r10, (rp)
|
|
Packit Service |
82fcde |
adc $0, %rdx
|
|
Packit Service |
82fcde |
L(n1): mov 8(rp), %r10
|
|
Packit Service |
82fcde |
ADDSUB %rax, %r10
|
|
Packit Service |
82fcde |
mov %r10, 8(rp)
|
|
Packit Service |
82fcde |
mov %ebx, %eax /* zero rax */
|
|
Packit Service |
82fcde |
adc %rdx, %rax
|
|
Packit Service |
82fcde |
pop %rbp
|
|
Packit Service |
82fcde |
pop %rbx
|
|
Packit Service |
82fcde |
ret
|
|
Packit Service |
82fcde |
END (func)
|