2009-02-19 18:22:30 -05:00
|
|
|
|
|
|
|
; Version 1.0.4
|
|
|
|
;
|
|
|
|
; Copyright 2008 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.
|
|
|
|
; 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 version 2.1 of the License, or (at
|
|
|
|
; your option) any later version.
|
|
|
|
; 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
|
|
|
; void mpn_com_n(mp_ptr, mp_ptr, mp_size_t)
|
|
|
|
; rdi rsi rdx
|
2009-09-02 09:35:23 -04:00
|
|
|
; rcx rdx r8d
|
2009-02-19 18:22:30 -05:00
|
|
|
|
2009-03-07 10:00:35 -05:00
|
|
|
%include "..\yasm_mac.inc"
|
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
|
|
|
|
LEAF_PROC mpn_com_n
|
2009-03-09 17:27:31 -04:00
|
|
|
movsxd rax, r8d
|
2009-03-13 16:32:09 -04:00
|
|
|
sub rax, 4
|
|
|
|
jc .2
|
|
|
|
|
2009-03-24 10:40:39 -04:00
|
|
|
xalign 8
|
2009-12-02 11:24:00 -05:00
|
|
|
.1:
|
|
|
|
mov r8, [rdx+rax*8+24]
|
2009-03-13 16:32:09 -04:00
|
|
|
mov r9, [rdx+rax*8+16]
|
|
|
|
not r8
|
|
|
|
not r9
|
|
|
|
mov [rcx+rax*8+24], r8
|
|
|
|
mov [rcx+rax*8+16], r9
|
|
|
|
mov r8, [rdx+rax*8+8]
|
|
|
|
mov r9, [rdx+rax*8]
|
|
|
|
not r8
|
|
|
|
not r9
|
|
|
|
mov [rcx+rax*8+8], r8
|
|
|
|
mov [rcx+rax*8], r9
|
|
|
|
sub rax, 4
|
|
|
|
jae .1
|
2009-12-02 11:24:00 -05:00
|
|
|
.2:
|
|
|
|
add rax, 4
|
2009-03-13 16:32:09 -04:00
|
|
|
jz .3
|
2009-02-19 18:22:30 -05:00
|
|
|
|
|
|
|
; Could still have potential cache-bank conflicts in this tail part
|
|
|
|
|
2009-03-13 16:32:09 -04:00
|
|
|
mov r8, [rdx+rax*8-8]
|
|
|
|
not r8
|
|
|
|
mov [rcx+rax*8-8], r8
|
|
|
|
dec rax
|
|
|
|
jz .3
|
|
|
|
mov r8, [rdx+rax*8-8]
|
|
|
|
not r8
|
|
|
|
mov [rcx+rax*8-8], r8
|
|
|
|
dec rax
|
|
|
|
jz .3
|
|
|
|
mov r8, [rdx+rax*8-8]
|
|
|
|
not r8
|
|
|
|
mov [rcx+rax*8-8], r8
|
2009-12-02 11:24:00 -05:00
|
|
|
.3:
|
|
|
|
ret
|
2009-02-19 18:22:30 -05:00
|
|
|
|
|
|
|
end
|