diff options
-rw-r--r-- | lib/libc/amd64/string/bcmp.S | 9 | ||||
-rw-r--r-- | sys/amd64/amd64/support.S | 7 |
2 files changed, 6 insertions, 10 deletions
diff --git a/lib/libc/amd64/string/bcmp.S b/lib/libc/amd64/string/bcmp.S index bb72035..36a0c7e 100644 --- a/lib/libc/amd64/string/bcmp.S +++ b/lib/libc/amd64/string/bcmp.S @@ -6,7 +6,6 @@ __FBSDID("$FreeBSD$"); #endif ENTRY(bcmp) - xorl %eax,%eax /* clear return value */ cld /* set compare direction forward */ movq %rdx,%rcx /* compare by words */ @@ -19,7 +18,7 @@ ENTRY(bcmp) andq $7,%rcx repe cmpsb - je L2 - -L1: incl %eax -L2: ret +L1: + setne %al + movsbl %al,%eax + ret diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index ba6f3c2..3d4098e 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 /* |