aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/amd64/support.S
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2004-04-03 05:33:10 +0000
committerAlan Cox <alc@FreeBSD.org>2004-04-03 05:33:10 +0000
commit2cdafcbbe0ec40481d8a5abb4b2f3eb1072db03a (patch)
treeb85da0d6e282198f3ec1f6eac7168d3848c9fc64 /sys/amd64/amd64/support.S
parent55d2c71b88f36cb8d088ac2f725633fb679522d5 (diff)
downloadsrc-2cdafcbbe0ec40481d8a5abb4b2f3eb1072db03a.tar.gz
src-2cdafcbbe0ec40481d8a5abb4b2f3eb1072db03a.zip
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.
Notes
Notes: svn path=/head/; revision=127786
Diffstat (limited to 'sys/amd64/amd64/support.S')
-rw-r--r--sys/amd64/amd64/support.S14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S
index 633f7b1c0529..7fcb4b9d07fb 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