version 1.1, 2000/09/09 14:12:42 |
version 1.1.1.2, 2003/08/25 16:06:28 |
|
|
dnl AMD K6-2 mpn_com_n -- mpn bitwise one's complement. |
dnl AMD K6-2 mpn_com_n -- mpn bitwise one's complement. |
dnl |
|
dnl alignment dst/src, A=0mod8 N=4mod8 |
|
dnl A/A A/N N/A N/N |
|
dnl K6-2 1.0 1.18 1.18 1.18 cycles/limb |
|
dnl K6 1.5 1.85 1.75 1.85 |
|
|
|
|
dnl Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. |
dnl Copyright (C) 1999, 2000 Free Software Foundation, Inc. |
|
dnl |
dnl |
dnl This file is part of the GNU MP Library. |
dnl This file is part of the GNU MP Library. |
dnl |
dnl |
Line 25 dnl License along with the GNU MP Library; see the fi |
|
Line 19 dnl License along with the GNU MP Library; see the fi |
|
dnl not, write to the Free Software Foundation, Inc., 59 Temple Place - |
dnl not, write to the Free Software Foundation, Inc., 59 Temple Place - |
dnl Suite 330, Boston, MA 02111-1307, USA. |
dnl Suite 330, Boston, MA 02111-1307, USA. |
|
|
|
|
include(`../config.m4') |
include(`../config.m4') |
|
|
|
NAILS_SUPPORT(0-31) |
|
|
|
|
|
C alignment dst/src, A=0mod8 N=4mod8 |
|
C A/A A/N N/A N/N |
|
C K6-2 1.0 1.18 1.18 1.18 cycles/limb |
|
C K6 1.5 1.85 1.75 1.85 |
|
|
|
|
C void mpn_com_n (mp_ptr dst, mp_srcptr src, mp_size_t size); |
C void mpn_com_n (mp_ptr dst, mp_srcptr src, mp_size_t size); |
C |
C |
C Take the bitwise ones-complement of src,size and write it to dst,size. |
C Take the bitwise ones-complement of src,size and write it to dst,size. |
Line 37 defframe(PARAM_SIZE,12) |
|
Line 38 defframe(PARAM_SIZE,12) |
|
defframe(PARAM_SRC, 8) |
defframe(PARAM_SRC, 8) |
defframe(PARAM_DST, 4) |
defframe(PARAM_DST, 4) |
|
|
.text |
TEXT |
ALIGN(32) |
ALIGN(16) |
PROLOGUE(mpn_com_n) |
PROLOGUE(mpn_com_n) |
deflit(`FRAME',0) |
deflit(`FRAME',0) |
|
|
Line 49 deflit(`FRAME',0) |
|
Line 50 deflit(`FRAME',0) |
|
jnz L(two_or_more) |
jnz L(two_or_more) |
|
|
movl (%eax), %eax |
movl (%eax), %eax |
notl %eax |
notl_or_xorl_GMP_NUMB_MASK( %eax) |
movl %eax, (%edx) |
movl %eax, (%edx) |
ret |
ret |
|
|
|
|
L(two_or_more): |
L(two_or_more): |
pushl %ebx |
pushl %ebx FRAME_pushl() |
FRAME_pushl() |
pcmpeqd %mm7, %mm7 C all ones |
|
|
movl %ecx, %ebx |
movl %ecx, %ebx |
|
ifelse(GMP_NAIL_BITS,0,, |
|
` psrld $GMP_NAIL_BITS, %mm7') C clear nails |
|
|
pcmpeqd %mm7, %mm7 C all ones |
|
|
|
|
|
ALIGN(16) |
ALIGN(8) |
L(top): |
L(top): |
C eax src |
C eax src |
C ebx floor(size/2) |
C ebx floor(size/2) |
C ecx counter |
C ecx counter |
C edx dst |
C edx dst |
C esi |
C |
C edi |
C mm0 scratch |
C ebp |
C mm7 mask |
|
|
movq -8(%eax,%ecx,8), %mm0 |
movq -8(%eax,%ecx,8), %mm0 |
pxor %mm7, %mm0 |
pxor %mm7, %mm0 |
|
|
|
|
jnc L(no_extra) |
jnc L(no_extra) |
movl (%eax,%ebx,8), %eax |
movl (%eax,%ebx,8), %eax |
notl %eax |
notl_or_xorl_GMP_NUMB_MASK( %eax) |
movl %eax, (%edx,%ebx,8) |
movl %eax, (%edx,%ebx,8) |
L(no_extra): |
L(no_extra): |
|
|