2012-06-27 00:35:20 -04:00
|
|
|
; GLOBAL_FUNC(store)
|
2009-09-02 07:41:43 -04:00
|
|
|
; Copyright 2009 Jason Moxham
|
2009-09-02 13:20:55 -04:00
|
|
|
;
|
2009-09-02 07:41:43 -04:00
|
|
|
; This file is part of the MPIR Library.
|
2009-09-02 13:20:55 -04:00
|
|
|
;
|
|
|
|
; Windows Conversion Copyright 2008 Brian Gladman
|
|
|
|
;
|
2009-09-02 07:41:43 -04: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
|
|
|
|
; by the Free Software Foundation; either verdxon 2.1 of the License, or (at
|
|
|
|
; your option) any later verdxon.
|
|
|
|
; 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
|
|
|
; mpn_store(mp_ptr, mp_size_t, mp_limb_t)
|
2010-12-05 09:04:42 -05:00
|
|
|
; r10 rdi rsi rdx
|
|
|
|
; r10 rcx rdx r8
|
2009-09-02 07:41:43 -04:00
|
|
|
|
2010-08-15 06:08:57 -04:00
|
|
|
%include "yasm_mac.inc"
|
2009-09-02 07:41:43 -04:00
|
|
|
|
2009-09-02 13:20:55 -04:00
|
|
|
CPU Athlon64
|
2009-09-02 07:41:43 -04:00
|
|
|
BITS 64
|
|
|
|
|
|
|
|
LEAF_PROC mpn_store
|
2010-12-05 09:04:42 -05:00
|
|
|
mov rax, rdx
|
|
|
|
and rax, 7
|
|
|
|
mov r9, 8
|
|
|
|
sub r9, rax
|
|
|
|
mov rax, r8
|
|
|
|
lea r9, [r9+r9*4]
|
|
|
|
lea r10, [rel .0]
|
|
|
|
add r10, r9
|
|
|
|
and rdx, -8
|
|
|
|
add rcx, 48
|
|
|
|
jmp r10
|
2009-09-02 07:41:43 -04:00
|
|
|
xalign 16
|
2010-12-05 09:04:42 -05:00
|
|
|
.0: mov [rcx+rdx*8+8], rax
|
|
|
|
mov [byte rcx+rdx*8+0], rax
|
|
|
|
mov [rcx+rdx*8-8], rax
|
|
|
|
mov [rcx+rdx*8-16], rax
|
|
|
|
mov [rcx+rdx*8-24], rax
|
|
|
|
mov [rcx+rdx*8-32], rax
|
|
|
|
mov [rcx+rdx*8-40], rax
|
|
|
|
mov [rcx+rdx*8-48], rax
|
|
|
|
nop
|
|
|
|
sub rdx, 8
|
|
|
|
jnc .0
|
|
|
|
nop
|
|
|
|
ret
|
|
|
|
|
|
|
|
end
|