Commit b5c7a2dd authored by Ivan Kokshaysky's avatar Ivan Kokshaysky Committed by Linus Torvalds

[PATCH] Fix unaligned stxncpy again

Herbert Xu noted:
  "The current stxncpy on alpha is still broken when it comes to single
   word, unaligned, src misalignment > dest misalignment copies.

   I've attached a program which demonstrates this problem."

Ugh, indeed. It fails when there is a zero byte before the data.
Thanks.

Here is the fix for this (both regular and ev6 version).
parent 196c4ebd
......@@ -365,7 +365,7 @@ $unaligned:
andnot t2, t6, t12 # E : dest mask for a single word copy
or t8, t10, t5 # E : test for end-of-count too
cmpbge zero, t2, t3 # E :
cmpbge zero, t12, t3 # E :
cmoveq a2, t5, t8 # E : Latency=2, extra map slot
nop # E : keep with cmoveq
andnot t8, t3, t8 # E : (stall)
......
......@@ -317,7 +317,7 @@ $unaligned:
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 :
cmpbge zero, t12, t3 # e0 :
cmoveq a2, t5, t8 # .. e1 :
andnot t8, t3, t8 # e0 :
beq t8, $u_head # .. e1 (zdb)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment