=================================================================== RCS file: /home/cvs/OpenXM_contrib/gmp/mpn/x86/k6/mmx/Attic/logops_n.asm,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.2 diff -u -p -r1.1.1.1 -r1.1.1.2 --- OpenXM_contrib/gmp/mpn/x86/k6/mmx/Attic/logops_n.asm 2000/09/09 14:12:42 1.1.1.1 +++ OpenXM_contrib/gmp/mpn/x86/k6/mmx/Attic/logops_n.asm 2003/08/25 16:06:28 1.1.1.2 @@ -1,19 +1,7 @@ dnl AMD K6-2 mpn_and_n, mpn_andn_n, mpn_nand_n, mpn_ior_n, mpn_iorn_n, dnl mpn_nior_n, mpn_xor_n, mpn_xnor_n -- mpn bitwise logical operations. -dnl -dnl alignment dst/src1/src2, A=0mod8, N=4mod8 -dnl A/A/A A/A/N A/N/A A/N/N N/A/A N/A/N N/N/A N/N/N -dnl -dnl K6-2 1.2 1.5 1.5 1.2 1.2 1.5 1.5 1.2 and,andn,ior,xor -dnl K6-2 1.5 1.75 2.0 1.75 1.75 2.0 1.75 1.5 iorn,xnor -dnl K6-2 1.75 2.0 2.0 2.0 2.0 2.0 2.0 1.75 nand,nior -dnl -dnl K6 1.5 1.68 1.75 1.2 1.75 1.75 1.68 1.5 and,andn,ior,xor -dnl K6 2.0 2.0 2.25 2.25 2.25 2.25 2.0 2.0 iorn,xnor -dnl K6 2.0 2.25 2.25 2.25 2.25 2.25 2.25 2.0 nand,nior - -dnl Copyright (C) 1999, 2000 Free Software Foundation, Inc. +dnl Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. dnl dnl This file is part of the GNU MP Library. dnl @@ -32,10 +20,23 @@ dnl License along with the GNU MP Library; see the fi dnl not, write to the Free Software Foundation, Inc., 59 Temple Place - dnl Suite 330, Boston, MA 02111-1307, USA. - include(`../config.m4') +NAILS_SUPPORT(0-31) + +C alignment dst/src1/src2, A=0mod8, N=4mod8 +C A/A/A A/A/N A/N/A A/N/N N/A/A N/A/N N/N/A N/N/N +C +C K6-2 1.2 1.5 1.5 1.2 1.2 1.5 1.5 1.2 and,andn,ior,xor +C K6-2 1.5 1.75 2.0 1.75 1.75 2.0 1.75 1.5 iorn,xnor +C K6-2 1.75 2.0 2.0 2.0 2.0 2.0 2.0 1.75 nand,nior +C +C K6 1.5 1.68 1.75 1.2 1.75 1.75 1.68 1.5 and,andn,ior,xor +C K6 2.0 2.0 2.25 2.25 2.25 2.25 2.0 2.0 iorn,xnor +C K6 2.0 2.25 2.25 2.25 2.25 2.25 2.25 2.0 nand,nior + + dnl M4_p and M4_i are the MMX and integer instructions dnl M4_*_neg_dst means whether to negate the final result before writing dnl M4_*_neg_src2 means whether to negate the src2 values before using them @@ -55,9 +56,13 @@ define(`M4_i_neg_src2',`$7') dnl xnor is done in "iorn" style because it's a touch faster than "nior" dnl style (the two are equivalent for xor). +dnl +dnl pandn can't be used with nails. M4_choose_op( and_n, pand,0,0, andl,0,0) -M4_choose_op( andn_n, pandn,0,0, andl,0,1) +ifelse(GMP_NAIL_BITS,0, +`M4_choose_op(andn_n, pandn,0,0, andl,0,1)', +`M4_choose_op(andn_n, pand,0,1, andl,0,1)') M4_choose_op( nand_n, pand,1,0, andl,1,0) M4_choose_op( ior_n, por,0,0, orl,0,0) M4_choose_op( iorn_n, por,0,1, orl,0,1) @@ -105,24 +110,26 @@ defframe(PARAM_SRC1,8) defframe(PARAM_DST, 4) deflit(`FRAME',0) - .text + TEXT ALIGN(32) PROLOGUE(M4_function) movl PARAM_SIZE, %ecx - pushl %ebx - FRAME_pushl() + pushl %ebx FRAME_pushl() + movl PARAM_SRC1, %eax + movl PARAM_SRC2, %ebx cmpl $1, %ecx + movl PARAM_DST, %edx ja L(two_or_more) movl (%ebx), %ecx popl %ebx -ifelse(M4_i_neg_src2,1,`notl %ecx') +ifelse(M4_i_neg_src2,1,`notl_or_xorl_GMP_NUMB_MASK( %ecx)') M4_i (%eax), %ecx -ifelse(M4_i_neg_dst,1,` notl %ecx') +ifelse(M4_i_neg_dst,1,` notl_or_xorl_GMP_NUMB_MASK( %ecx)') movl %ecx, (%edx) ret @@ -136,20 +143,17 @@ L(two_or_more): C esi C edi C ebp - C - C carry bit is low of size - pushl %esi - FRAME_pushl() + pushl %esi FRAME_pushl() testl $4, %eax jz L(alignment_ok) movl (%ebx), %esi addl $4, %ebx -ifelse(M4_i_neg_src2,1,`notl %esi') +ifelse(M4_i_neg_src2,1,`notl_or_xorl_GMP_NUMB_MASK( %esi)') M4_i (%eax), %esi addl $4, %eax -ifelse(M4_i_neg_dst,1,` notl %esi') +ifelse(M4_i_neg_dst,1,` notl_or_xorl_GMP_NUMB_MASK( %esi)') movl %esi, (%edx) addl $4, %edx decl %ecx @@ -161,9 +165,9 @@ L(alignment_ok): movl (%ebx), %ecx popl %esi -ifelse(M4_i_neg_src2,1,`notl %ecx') +ifelse(M4_i_neg_src2,1,`notl_or_xorl_GMP_NUMB_MASK( %ecx)') M4_i (%eax), %ecx -ifelse(M4_i_neg_dst,1,` notl %ecx') +ifelse(M4_i_neg_dst,1,` notl_or_xorl_GMP_NUMB_MASK( %ecx)') popl %ebx movl %ecx, (%edx) ret @@ -171,7 +175,8 @@ ifelse(M4_i_neg_dst,1,` notl %ecx') L(still_two_or_more): ifelse(eval(M4_p_neg_src2 || M4_p_neg_dst),1,` - pcmpeqd %mm7, %mm7 C all ones + pcmpeqd %mm7, %mm7 C all ones +ifelse(GMP_NAIL_BITS,0,,`psrld $GMP_NAIL_BITS, %mm7') C clear nails ') ALIGN(16) @@ -198,9 +203,9 @@ ifelse(M4_p_neg_dst,1,` pxor %mm7, %mm0') jnc L(no_extra) movl -4(%ebx,%esi,4), %ebx -ifelse(M4_i_neg_src2,1,`notl %ebx') +ifelse(M4_i_neg_src2,1,`notl_or_xorl_GMP_NUMB_MASK( %ebx)') M4_i -4(%eax,%esi,4), %ebx -ifelse(M4_i_neg_dst,1,` notl %ebx') +ifelse(M4_i_neg_dst,1,` notl_or_xorl_GMP_NUMB_MASK( %ebx)') movl %ebx, -4(%edx,%esi,4) L(no_extra):