From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
To: axp-list@redhat.com
Subject: Re: stxncpy
Date: Thu, 5 Dec 2002 13:25:09 +0300 [thread overview]
Message-ID: <20021205132509.A6245@jurassic.park.msu.ru> (raw)
In-Reply-To: <20021204101156.A11299@twiddle.net>; from rth@twiddle.net on Wed, Dec 04, 2002 at 10:11:56AM -0800
On Wed, Dec 04, 2002 at 10:11:56AM -0800, Richard Henderson wrote:
> On Tue, Dec 03, 2002 at 01:50:07PM +0100, Heid Oliver wrote:
> > Does anybody know what the patch intended to fix?
>
> Reading too much data (and oopsing) under certain conditions.
There are few uncaught typos.
- ev6: missing local label which causes oopses in several places;
- ev5: t12 instead of t10 - corruption in ISO readdir, probably other
nastiness.
Also, minor cleanups:
- move the label in $unaligned, this should save a cycle or two;
- replace redundant `mskqh' with a nop (it doesn't save any cycles though);
- fix comment: t12 _is_ touched.
Applies to both 2.4 and 2.5.
Ivan.
--- all/arch/alpha/lib/stxncpy.S Thu Oct 24 09:11:59 2002
+++ linux/arch/alpha/lib/stxncpy.S Thu Dec 5 12:04:20 2002
@@ -25,7 +25,7 @@
* a0 = unaligned address of the last *word* written
* a2 = the number of full words left in COUNT
*
- * Furthermore, v0, a3-a5, t11, t12, and $at are untouched.
+ * Furthermore, v0, a3-a5, t11, and $at are untouched.
*/
#include <asm/regdef.h>
@@ -269,7 +269,7 @@ $u_final:
t1 == the shifted high-order bits from the previous source word */
$u_eoc:
and a1, 7, t6 # e1 :
- sll t12, t6, t6 # e0 :
+ sll t10, t6, t6 # e0 :
and t6, 0xff, t6 # e0 :
bne t6, 1f # .. e1 :
@@ -303,18 +303,17 @@ $unaligned:
ldq_u t0, 0(a0) # e0 :
lda t6, -1 # .. e1 :
mskql t6, a0, t6 # e0 :
-1:
subq a1, t4, a1 # .. e1 : sub dest misalignment from src addr
/* If source misalignment is larger than dest misalignment, we need
extra startup checks to avoid SEGV. */
- cmplt t4, t5, t12 # e1 :
+1: cmplt t4, t5, t12 # e1 :
extql t1, a1, t1 # .. e0 : shift src into place
lda t2, -1 # e0 : for creating masks later
- beq t12, $u_head # e1 :
+ beq t12, $u_head # .. e1 :
- mskqh t2, t5, t2 # e0 : begin src byte validity mask
+ nop # e0 :
cmpbge zero, t1, t8 # .. e1 : is there a zero?
extql t2, a1, t2 # e0 :
or t8, t10, t5 # .. e1 : test for end-of-count too
--- all/arch/alpha/lib/ev6-stxncpy.S Thu Oct 24 09:11:59 2002
+++ linux/arch/alpha/lib/ev6-stxncpy.S Thu Dec 5 11:50:47 2002
@@ -25,7 +25,7 @@
* a0 = unaligned address of the last *word* written
* a2 = the number of full words left in COUNT
*
- * Furthermore, v0, a3-a5, t11, t12, and $at are untouched.
+ * Furthermore, v0, a3-a5, t11, and $at are untouched.
*
* Much of the information about 21264 scheduling/coding comes from:
* Compiler Writer's Guide for the Alpha 21264
@@ -324,7 +324,7 @@ $u_eoc:
extqh t2, a1, t0 # U : extract low bits for last word (stall)
or t1, t0, t1 # E : (stall)
- cmpbge zero, t1, t8 # E :
+1: cmpbge zero, t1, t8 # E :
mov t1, t0 # E :
$u_eocfin: # end-of-count, final word
@@ -350,17 +350,17 @@ $unaligned:
mskql t6, a0, t6 # U :
nop
nop
-1: subq a1, t4, a1 # E : sub dest misalignment from src addr
+ subq a1, t4, a1 # E : sub dest misalignment from src addr
/* If source misalignment is larger than dest misalignment, we need
extra startup checks to avoid SEGV. */
- cmplt t4, t5, t12 # E :
+1: cmplt t4, t5, t12 # E :
extql t1, a1, t1 # U : shift src into place
lda t2, -1 # E : for creating masks later
beq t12, $u_head # U : (stall)
- mskqh t2, t5, t2 # U : begin src byte validity mask
+ nop
cmpbge zero, t1, t8 # E : is there a zero?
extql t2, a1, t2 # U :
or t8, t10, t5 # E : test for end-of-count too
next prev parent reply other threads:[~2002-12-05 10:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-03 12:50 stxncpy Heid Oliver
2002-12-03 23:56 ` stxncpy Falk Hueffner
2002-12-04 18:11 ` stxncpy Richard Henderson
2002-12-05 10:25 ` Ivan Kokshaysky [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-12-04 9:48 stxncpy Heid Oliver
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox