Fix a whole bunch of dependancy bugs and make it actually work when the
size is not a multiple of eight.
This commit is contained in:
parent
8a0f924b15
commit
69d68ac34b
@ -38,28 +38,30 @@ ENTRY(bzero, 2)
|
||||
cmp.ltu p6,p0=17,in1 // check for small
|
||||
(p6) br.dptk.few 3f
|
||||
|
||||
add r15=-1,in1 ;;
|
||||
1: mov ar.lc=r15
|
||||
1: add r15=-1,in1 ;;
|
||||
mov ar.lc=r15 ;;
|
||||
2: st1 [in0]=r0,1 // zero one byte
|
||||
br.cloop.sptk.few 2b // loop
|
||||
|
||||
;;
|
||||
mov ar.lc=r14 // done
|
||||
br.ret.sptk.few rp
|
||||
|
||||
// Zero up to 8byte alignment
|
||||
|
||||
3: tbit.nz p6,p0=in1,0 ;;
|
||||
3: tbit.nz p6,p0=in0,0 ;;
|
||||
(p6) st1 [in0]=r0,1
|
||||
(p6) add in1=-1,in1
|
||||
|
||||
tbit.nz p6,p0=in1,1 ;;
|
||||
tbit.nz p6,p0=in0,1 ;;
|
||||
(p6) st2 [in0]=r0,2
|
||||
(p6) add in1=-2,in1
|
||||
|
||||
tbit.nz p6,p0=in1,2 ;;
|
||||
tbit.nz p6,p0=in0,2 ;;
|
||||
(p6) st4 [in0]=r0,4
|
||||
(p6) add in1=-4,in1
|
||||
|
||||
;;
|
||||
shr.u r15=in1,3 // word count
|
||||
extr.u in1=in1,0,3 ;; // trailing bytes
|
||||
cmp.eq p6,p0=r15,r0 // check for zero
|
||||
@ -67,13 +69,14 @@ ENTRY(bzero, 2)
|
||||
(p6) br.dpnt.few 1b // zero last bytes
|
||||
|
||||
add r15=-1,r15 ;;
|
||||
mov ar.lc=r15
|
||||
mov ar.lc=r15 ;;
|
||||
4: st8 [in0]=r0,8
|
||||
br.cloop.sptk.few 4b
|
||||
|
||||
(p7) br.dpnt.few 1b // zero last bytes
|
||||
|
||||
;;
|
||||
mov ar.lc=r14 // done
|
||||
br.ret.sptk.few rp
|
||||
|
||||
END(bzero)
|
||||
END(bzero)
|
||||
|
Loading…
x
Reference in New Issue
Block a user