patch-2.4.22 linux-2.4.22/arch/alpha/lib/stxncpy.S

Next file: linux-2.4.22/arch/arm/Makefile
Previous file: linux-2.4.22/arch/alpha/lib/ev6-stxncpy.S
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/arch/alpha/lib/stxncpy.S linux-2.4.22/arch/alpha/lib/stxncpy.S
@@ -313,9 +313,9 @@
 	lda	t2, -1		# e0    : for creating masks later
 	beq	t12, $u_head	# .. e1 :
 
-	nop			# e0    :
-	cmpbge	zero, t1, t8	# .. e1 : is there a zero?
 	extql	t2, a1, t2	# e0    :
+	cmpbge	zero, t1, t8	# .. e1 : is there a zero?
+	andnot	t2, t6, t12	# e0    : dest mask for a single word copy
 	or	t8, t10, t5	# .. e1 : test for end-of-count too
 	cmpbge	zero, t2, t3	# e0    :
 	cmoveq	a2, t5, t8	# .. e1 :
@@ -330,14 +330,14 @@
 	ldq_u	t0, 0(a0)	# e0    :
 	negq	t8, t6		# .. e1 : build bitmask of bytes <= zero
 	mskqh	t1, t4, t1	# e0    :
-	and	t6, t8, t12	# .. e1 :
-	subq	t12, 1, t6	# e0    :
-	or	t6, t12, t8	# e1    :
+	and	t6, t8, t2	# .. e1 :
+	subq	t2, 1, t6	# e0    :
+	or	t6, t2, t8	# e1    :
 
-	zapnot	t2, t8, t2	# e0    : prepare source word; mirror changes
+	zapnot	t12, t8, t12	# e0    : prepare source word; mirror changes
 	zapnot	t1, t8, t1	# .. e1 : to source validity mask
 
-	andnot	t0, t2, t0	# e0    : zero place for source to reside
+	andnot	t0, t12, t0	# e0    : zero place for source to reside
 	or	t0, t1, t0	# e1    : and put it there
 	stq_u	t0, 0(a0)	# e0    :
 	ret	(t9)		# .. e1 :

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)