2009-05-13 05:54:24 -04:00
|
|
|
|
|
|
|
; Copyright 2009 Jason Moxham
|
2009-09-02 13:20:55 -04:00
|
|
|
;
|
2009-05-13 05:54:24 -04:00
|
|
|
; Windows Conversion Copyright 2008 Brian Gladman
|
|
|
|
;
|
|
|
|
; This file is part of the MPIR Library.
|
|
|
|
; 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-09-02 13:20:55 -04:00
|
|
|
; by the Free Software Foundation; either version 2.1 of the License, or (at
|
|
|
|
; your option) any later version.
|
2009-05-13 05:54:24 -04: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-09-02 13:20:55 -04:00
|
|
|
; void mpn_copyd(mp_ptr, mp_ptr, mp_size_t)
|
|
|
|
; rdi rsi rdx
|
|
|
|
; rcx rdx r8d
|
2009-05-13 05:54:24 -04:00
|
|
|
|
|
|
|
%include "..\yasm_mac.inc"
|
|
|
|
|
|
|
|
CPU Core2
|
|
|
|
BITS 64
|
|
|
|
|
|
|
|
LEAF_PROC mpn_copyd
|
|
|
|
movsxd r8, r8d
|
|
|
|
lea rdx, [rdx+r8*8-8]
|
|
|
|
lea rcx, [rcx+r8*8-8]
|
|
|
|
sub r8, 4
|
2009-12-02 11:24:00 -05:00
|
|
|
jl .2
|
2009-05-13 05:54:24 -04:00
|
|
|
xalign 16
|
2009-12-02 11:24:00 -05:00
|
|
|
.1:
|
2009-05-13 05:54:24 -04:00
|
|
|
mov rax, [rdx]
|
|
|
|
mov r9, [rdx-8]
|
|
|
|
mov r10, [rdx-16]
|
|
|
|
mov r11, [rdx-24]
|
|
|
|
mov [rcx], rax
|
|
|
|
mov [rcx-8], r9
|
|
|
|
lea rcx, [rcx-32]
|
|
|
|
sub r8, 4
|
|
|
|
mov [rcx+16], r10
|
|
|
|
mov [rcx+8], r11
|
|
|
|
lea rdx, [rdx-32]
|
2009-12-02 11:24:00 -05:00
|
|
|
jns .1
|
|
|
|
.2:
|
2009-05-13 05:54:24 -04:00
|
|
|
add r8, 2
|
2009-12-02 11:24:00 -05:00
|
|
|
jz .5
|
|
|
|
jns .6
|
|
|
|
jp .4
|
|
|
|
.3:
|
2009-05-13 05:54:24 -04:00
|
|
|
ret
|
|
|
|
xalign 16
|
2009-12-02 11:24:00 -05:00
|
|
|
.4:
|
2009-05-13 05:54:24 -04:00
|
|
|
mov rax, [rdx]
|
|
|
|
mov [rcx], rax
|
|
|
|
ret
|
|
|
|
xalign 16
|
2009-12-02 11:24:00 -05:00
|
|
|
.5:
|
2009-05-13 05:54:24 -04:00
|
|
|
mov rax, [rdx]
|
|
|
|
mov r9, [rdx-8]
|
|
|
|
mov [rcx], rax
|
|
|
|
mov [rcx-8], r9
|
|
|
|
ret
|
|
|
|
xalign 16
|
2009-12-02 11:24:00 -05:00
|
|
|
.6:
|
2009-05-13 05:54:24 -04:00
|
|
|
mov rax, [rdx]
|
|
|
|
mov r9, [rdx-8]
|
|
|
|
mov r10, [rdx-16]
|
|
|
|
mov [rcx], rax
|
|
|
|
mov [rcx-8], r9
|
|
|
|
mov [rcx-16], r10
|
|
|
|
ret
|
|
|
|
end
|