diff options
| author | ad <ad@NetBSD.org> | 2008-03-11 00:40:38 +0000 |
|---|---|---|
| committer | ad <ad@NetBSD.org> | 2008-03-11 00:40:38 +0000 |
| commit | 3f5fa954a6dfd69ada1183753ebf877b9b7ac5c9 (patch) | |
| tree | 3e86f3085c83b6235cde3bb66c82be44db30ea64 /sys | |
| parent | b714b9dd42cf04c90f6312f8afa2cf6a6c50c024 (diff) | |
tsc_get_timecount: remove unneeded instructions. Pointed out by dsl@.
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/arch/amd64/amd64/amd64func.S | 6 | ||||
| -rw-r--r-- | sys/arch/i386/i386/i386func.S | 8 |
2 files changed, 5 insertions, 9 deletions
diff --git a/sys/arch/amd64/amd64/amd64func.S b/sys/arch/amd64/amd64/amd64func.S index 04e8b8faa1a..d07941285ba 100644 --- a/sys/arch/amd64/amd64/amd64func.S +++ b/sys/arch/amd64/amd64/amd64func.S @@ -1,4 +1,4 @@ -/* $NetBSD: amd64func.S,v 1.1 2008/03/10 22:03:40 ad Exp $ */ +/* $NetBSD: amd64func.S,v 1.2 2008/03/11 00:40:38 ad Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -56,9 +56,7 @@ ENTRY(tsc_get_timecount) orl CC_DENOM+4(%rdi), %eax /* cc_denom > 0xffffffff) */ jnz 2f /* return tsc_slow_timecount() */ rdtsc /* cc = cpu_counter32(); */ - movl $0, %edx - subl CC_CC(%rdi), %eax /* cc -= cc->cc_cc; */ - adcl $0, %edx /* if (cc < 0) cc += 0x100000000; */ + subl CC_CC(%rdi), %eax /* cc -= cc->cc_cc; (can wrap) */ mull CC_DELTA(%rdi) /* rcc = (cc * ci->ci_cc.cc_delta) */ divl CC_DENOM(%rdi) /* / ci->ci_cc.cc_denom */ addl CC_VAL(%rdi), %eax /* + ci->ci_cc.cc_val; */ diff --git a/sys/arch/i386/i386/i386func.S b/sys/arch/i386/i386/i386func.S index 4866c687300..74f26cd5257 100644 --- a/sys/arch/i386/i386/i386func.S +++ b/sys/arch/i386/i386/i386func.S @@ -1,4 +1,4 @@ -/* $NetBSD: i386func.S,v 1.5 2008/03/10 22:04:06 ad Exp $ */ +/* $NetBSD: i386func.S,v 1.6 2008/03/11 00:40:38 ad Exp $ */ /*- * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include <machine/asm.h> -__KERNEL_RCSID(0, "$NetBSD: i386func.S,v 1.5 2008/03/10 22:04:06 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i386func.S,v 1.6 2008/03/11 00:40:38 ad Exp $"); #include <machine/specialreg.h> #include <machine/segments.h> @@ -181,9 +181,7 @@ ENTRY(tsc_get_timecount) orl CC_DENOM+4(%edi), %eax /* cc_denom > 0xffffffff) */ jnz 2f /* return tsc_slow_timecount() */ rdtsc /* cc = cpu_counter32(); */ - movl $0, %edx - subl CC_CC(%edi), %eax /* cc -= cc->cc_cc; */ - adcl $0, %edx /* if (cc < 0) cc += 0x100000000; */ + subl CC_CC(%edi), %eax /* cc -= cc->cc_cc; (can wrap) */ mull CC_DELTA(%edi) /* rcc = (cc * ci->ci_cc.cc_delta) */ divl CC_DENOM(%edi) /* / ci->ci_cc.cc_denom */ addl CC_VAL(%edi), %eax /* + ci->ci_cc.cc_val; */ |
