2009-02-19 18:22:30 -05:00
|
|
|
|
2009-09-02 07:41:43 -04:00
|
|
|
; Copyright 2009 Jason Moxham
|
2009-02-22 16:03:08 -05:00
|
|
|
;
|
|
|
|
; Windows Conversion Copyright 2008 Brian Gladman
|
|
|
|
;
|
2009-02-19 18:22:30 -05:00
|
|
|
; This file is part of the MPIR Library.
|
2009-09-02 07:41:43 -04:00
|
|
|
;
|
2009-02-19 18:22:30 -05:00
|
|
|
; The MPIR Library is free software; you can redistribute it and/or modify
|
|
|
|
; it under the terms of the GNU Lesser General Public License as published
|
2009-03-13 06:22:20 -04:00
|
|
|
; by the Free Software Foundation; either version 2.1 of the License, or (at
|
|
|
|
; your option) any later version.
|
2009-02-19 18:22:30 -05:00
|
|
|
; The MPIR Library is distributed in the hope that it will be useful, but
|
|
|
|
; WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
|
|
; License for more details.
|
|
|
|
; You should have received a copy of the GNU Lesser General Public License
|
|
|
|
; along with the MPIR Library; see the file COPYING.LIB. If not, write
|
|
|
|
; to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
; Boston, MA 02110-1301, USA.
|
2009-02-22 16:03:08 -05:00
|
|
|
;
|
2009-09-02 07:41:43 -04:00
|
|
|
; mp_limb_t mpn_sublsh1_n(mp_ptr, mp_ptr, mp_ptr, mp_size_t)
|
|
|
|
; rax rdi rsi rdx rcx
|
2010-07-02 07:52:24 -04:00
|
|
|
; rax rcx rdx r8 r9
|
2009-02-19 18:22:30 -05:00
|
|
|
|
2010-08-15 06:08:57 -04:00
|
|
|
%include "yasm_mac.inc"
|
2009-02-19 18:22:30 -05:00
|
|
|
|
2009-09-02 07:41:43 -04:00
|
|
|
%define reg_save_list rbx, rsi, rdi
|
2009-02-19 18:22:30 -05:00
|
|
|
|
2009-03-24 10:40:39 -04:00
|
|
|
CPU Athlon64
|
2009-03-07 10:00:35 -05:00
|
|
|
BITS 64
|
2009-02-19 18:22:30 -05:00
|
|
|
|
2009-03-07 10:00:35 -05:00
|
|
|
FRAME_PROC mpn_sublsh1_n, 0, reg_save_list
|
2010-07-02 07:52:24 -04:00
|
|
|
mov rax, r9
|
2009-02-19 18:22:30 -05:00
|
|
|
|
2009-09-02 07:41:43 -04:00
|
|
|
lea rdi, [rcx+rax*8-56]
|
|
|
|
lea rsi, [rdx+rax*8-56]
|
|
|
|
lea rdx, [ r8+rax*8-56]
|
2009-03-13 16:32:09 -04:00
|
|
|
mov rcx, rax
|
|
|
|
|
2009-09-02 07:41:43 -04:00
|
|
|
xor rax, rax
|
|
|
|
xor r10, r10
|
|
|
|
mov r8, 3
|
|
|
|
sub r8, rcx
|
|
|
|
jge .3
|
|
|
|
add r8, 4
|
|
|
|
mov r11, [rsi+r8*8+24]
|
|
|
|
mov rcx, [rsi+r8*8+16]
|
|
|
|
mov r9, [rsi+r8*8]
|
|
|
|
mov rbx, [rsi+r8*8+8]
|
|
|
|
jc .2
|
|
|
|
|
|
|
|
xalign 16
|
2010-07-22 07:33:16 -04:00
|
|
|
.1: add rax, 1
|
2009-09-02 07:41:43 -04:00
|
|
|
sbb r9, [rdx+r8*8]
|
|
|
|
sbb rbx, [rdx+r8*8+8]
|
|
|
|
sbb rcx, [rdx+r8*8+16]
|
|
|
|
sbb r11, [rdx+r8*8+24]
|
|
|
|
sbb rax, rax
|
|
|
|
add r10, 1
|
|
|
|
sbb r9, [rdx+r8*8]
|
|
|
|
sbb rbx, [rdx+r8*8+8]
|
|
|
|
sbb rcx, [rdx+r8*8+16]
|
|
|
|
sbb r11, [rdx+r8*8+24]
|
|
|
|
sbb r10, r10
|
|
|
|
mov [rdi+r8*8], r9
|
|
|
|
mov [rdi+r8*8+8], rbx
|
|
|
|
mov [rdi+r8*8+16], rcx
|
|
|
|
mov [rdi+r8*8+24], r11
|
|
|
|
mov r11, [rsi+r8*8+56]
|
|
|
|
mov rcx, [rsi+r8*8+48]
|
|
|
|
add r8, 4
|
|
|
|
mov r9, [rsi+r8*8]
|
|
|
|
mov rbx, [rsi+r8*8+8]
|
|
|
|
jnc .1
|
2010-07-22 07:33:16 -04:00
|
|
|
.2: add rax, 1
|
2009-09-02 07:41:43 -04:00
|
|
|
sbb r9, [rdx+r8*8]
|
|
|
|
sbb rbx, [rdx+r8*8+8]
|
|
|
|
sbb rcx, [rdx+r8*8+16]
|
|
|
|
sbb r11, [rdx+r8*8+24]
|
|
|
|
sbb rax, rax
|
|
|
|
add r10, 1
|
|
|
|
sbb r9, [rdx+r8*8]
|
|
|
|
sbb rbx, [rdx+r8*8+8]
|
|
|
|
sbb rcx, [rdx+r8*8+16]
|
|
|
|
sbb r11, [rdx+r8*8+24]
|
|
|
|
sbb r10, r10
|
|
|
|
mov [rdi+r8*8], r9
|
|
|
|
mov [rdi+r8*8+8], rbx
|
|
|
|
mov [rdi+r8*8+16], rcx
|
|
|
|
mov [rdi+r8*8+24], r11
|
2010-07-22 07:33:16 -04:00
|
|
|
.3: cmp r8, 2
|
2009-09-02 07:41:43 -04:00
|
|
|
ja .7
|
|
|
|
jz .6
|
|
|
|
jp .5
|
2010-07-22 07:33:16 -04:00
|
|
|
.4: mov rcx, [rsi+r8*8+48]
|
2009-09-02 07:41:43 -04:00
|
|
|
mov r9, [rsi+r8*8+32]
|
|
|
|
mov rbx, [rsi+r8*8+40]
|
|
|
|
add rax, 1
|
|
|
|
sbb r9, [rdx+r8*8+32]
|
|
|
|
sbb rbx, [rdx+r8*8+40]
|
|
|
|
sbb rcx, [rdx+r8*8+48]
|
|
|
|
sbb rax, rax
|
|
|
|
add r10, 1
|
|
|
|
sbb r9, [rdx+r8*8+32]
|
|
|
|
sbb rbx, [rdx+r8*8+40]
|
|
|
|
sbb rcx, [rdx+r8*8+48]
|
|
|
|
mov [rdi+r8*8+32], r9
|
|
|
|
mov [rdi+r8*8+40], rbx
|
|
|
|
mov [rdi+r8*8+48], rcx
|
2010-07-22 07:33:16 -04:00
|
|
|
sbb rax, 0
|
|
|
|
neg rax
|
|
|
|
EXIT_PROC reg_save_list
|
2009-09-02 07:41:43 -04:00
|
|
|
|
|
|
|
xalign 16
|
2010-07-22 07:33:16 -04:00
|
|
|
.5: mov r9, [rsi+r8*8+32]
|
2009-09-02 07:41:43 -04:00
|
|
|
mov rbx, [rsi+r8*8+40]
|
|
|
|
add rax, 1
|
|
|
|
sbb r9, [rdx+r8*8+32]
|
|
|
|
sbb rbx, [rdx+r8*8+40]
|
|
|
|
sbb rax, rax
|
|
|
|
add r10, 1
|
|
|
|
sbb r9, [rdx+r8*8+32]
|
|
|
|
sbb rbx, [rdx+r8*8+40]
|
|
|
|
mov [rdi+r8*8+32], r9
|
|
|
|
mov [rdi+r8*8+40], rbx
|
2010-07-22 07:33:16 -04:00
|
|
|
sbb rax, 0
|
|
|
|
neg rax
|
|
|
|
EXIT_PROC reg_save_list
|
2009-09-02 07:41:43 -04:00
|
|
|
|
|
|
|
xalign 16
|
2010-07-22 07:33:16 -04:00
|
|
|
.6: mov r9, [rsi+r8*8+32]
|
2009-09-02 07:41:43 -04:00
|
|
|
add rax, 1
|
|
|
|
sbb r9, [rdx+r8*8+32]
|
|
|
|
sbb rax, rax
|
|
|
|
add r10, 1
|
|
|
|
sbb r9, [rdx+r8*8+32]
|
|
|
|
mov [rdi+r8*8+32], r9
|
2010-07-22 07:33:16 -04:00
|
|
|
sbb rax, 0
|
|
|
|
neg rax
|
|
|
|
EXIT_PROC reg_save_list
|
2009-09-02 07:41:43 -04:00
|
|
|
|
|
|
|
xalign 16
|
2010-07-22 07:33:16 -04:00
|
|
|
.7: add r10, 1
|
|
|
|
.8: sbb rax, 0
|
2009-09-02 07:41:43 -04:00
|
|
|
neg rax
|
|
|
|
END_PROC reg_save_list
|
2009-03-13 16:32:09 -04:00
|
|
|
|
2009-12-02 11:24:00 -05:00
|
|
|
end
|
|
|
|
|