Microoptimize pagezero() based upon something that I learned writing the

optimized pagecopy().  This also has the virtual of making these two
functions more similar in style.
This commit is contained in:
Alan Cox 2004-04-03 05:33:10 +00:00
parent 55d2c71b88
commit 2cdafcbbe0

View File

@ -76,15 +76,15 @@ ENTRY(bzero)
/* Address: %rdi */
ENTRY(pagezero)
lea 4096(%rdi),%rsi
movq $-PAGE_SIZE,%rdx
subq %rdx,%rdi
xorq %rax,%rax
1:
movnti %rax,(%rdi)
movnti %rax,8(%rdi)
movnti %rax,16(%rdi)
movnti %rax,24(%rdi)
addq $32,%rdi
cmpq %rsi,%rdi
movnti %rax,(%rdi,%rdx)
movnti %rax,8(%rdi,%rdx)
movnti %rax,16(%rdi,%rdx)
movnti %rax,24(%rdi,%rdx)
addq $32,%rdx
jne 1b
sfence
retq