diff options
author | alc <alc@FreeBSD.org> | 2004-04-03 05:33:10 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2004-04-03 05:33:10 +0000 |
commit | f18821928b1822e430badc9b8017fe9587228e53 (patch) | |
tree | b85da0d6e282198f3ec1f6eac7168d3848c9fc64 /sys/amd64 | |
parent | e2445bb257244fdfe609927f10d85037dd1953a5 (diff) | |
download | FreeBSD-src-f18821928b1822e430badc9b8017fe9587228e53.zip FreeBSD-src-f18821928b1822e430badc9b8017fe9587228e53.tar.gz |
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.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/support.S | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index 633f7b1..7fcb4b9 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -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 |