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:
parent
55d2c71b88
commit
2cdafcbbe0
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user