aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2005-04-10 18:12:07 +0000
committerAlan Cox <alc@FreeBSD.org>2005-04-10 18:12:07 +0000
commitfb41e047872b0a25b526e2873d9d15b7a338036c (patch)
tree42943daf777a27a748439ed3aa93f02cca498624 /sys/amd64
parent313bcc9cb8f70f4dab2d63dc072d932ff8e42aa9 (diff)
downloadsrc-fb41e047872b0a25b526e2873d9d15b7a338036c.tar.gz
src-fb41e047872b0a25b526e2873d9d15b7a338036c.zip
Eliminate a conditional branch and as a side-effect eliminate a branch to
a return instruction. (The latter is discouraged by the Opteron optimization manual because it disables branch prediction for the return instruction.) Reviewed by: bde
Notes
Notes: svn path=/head/; revision=144868
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/support.S7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S
index ba6f3c22f0b5..3d4098e318d2 100644
--- a/sys/amd64/amd64/support.S
+++ b/sys/amd64/amd64/support.S
@@ -86,8 +86,6 @@ ENTRY(pagezero)
ret
ENTRY(bcmp)
- xorq %rax,%rax
-
movq %rdx,%rcx
shrq $3,%rcx
cld /* compare forwards */
@@ -99,10 +97,9 @@ ENTRY(bcmp)
andq $7,%rcx
repe
cmpsb
- je 2f
1:
- incq %rax
-2:
+ setne %al
+ movsbl %al,%eax
ret
/*