mpir/mpn/x86_64w/core2/store.asm
gladman 1485e3dc1b 1. Add Jason's new assembler code to the Windows builds
2. Tidy up assembler to prepare for Windows nehalem build
2009-12-02 16:24:00 +00:00

59 lines
1.5 KiB
NASM

; Copyright 2009 Jason Moxham
;
; This file is part of the MPIR Library.
;
; Windows Conversion Copyright 2008 Brian Gladman
;
; 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.
;
; mpn_store(mp_ptr rcx ,mp_size_t rdx, mp_limb_t rax)
; rax rcx, rdx, r8
%include "..\yasm_mac.inc"
CPU Core2
BITS 64
LEAF_PROC mpn_store
movsxd r8, r8d
cmp rdx, 0
jz .4
movq xmm0, r8
movddup xmm0, xmm0
lea rcx, [rcx-16]
test rcx, 0xF
jz .1
mov [rcx+16], r8
lea rcx, [rcx+8]
sub rdx, 1
.1:
sub rdx, 2
jc .3
xalign 16
.2:
lea rcx, [rcx+16]
sub rdx, 2
movdqa [rcx], xmm0
jnc .2
.3:
jnp .4
mov [rcx+16], r8
.4:
ret
end