fix sign-extend bug
committer: jreiser <jreiser> 1114311664 +0000
This commit is contained in:
+3
-4
@@ -49,11 +49,10 @@ L5:
|
|||||||
mtctr len # count of words
|
mtctr len # count of words
|
||||||
b L20
|
b L20
|
||||||
L10:
|
L10:
|
||||||
subf t1,ptr,t0 # raw distance
|
rlwinm t1,t0,0,6+W_CTO,31-2 # the displacement field in position
|
||||||
|
subf t1,ptr,t1 # raw distance
|
||||||
add t1,t1,ptr0 # relative to virtual address of base
|
add t1,t1,ptr0 # relative to virtual address of base
|
||||||
rlwinm t1,t1,6+W_CTO,0,31-(6+W_CTO) # shift displacement up to sign bit
|
rlwimi t0,t1,0,6 ,31-2 # unfiltered instruction
|
||||||
srawi t1,t1,6+W_CTO # sign extended displacement
|
|
||||||
rlwimi t0,t1,0,6,31-2 # t0= unfiltered instruction
|
|
||||||
stw t0,0(ptr) # replace in memory
|
stw t0,0(ptr) # replace in memory
|
||||||
bdzlr- # if (0==--ctr) return; // extremely unlikely
|
bdzlr- # if (0==--ctr) return; // extremely unlikely
|
||||||
L20:
|
L20:
|
||||||
|
|||||||
Reference in New Issue
Block a user