From: Mike F. <su...@li...> - 2013-01-05 04:26:30
|
The branch, master, has been updated via 506c2ddfb5aec45f41396c4f3cbb99d17e5b2a48 (commit) via e04a8ee5668ef13a5670b5c0a0e0150abcf4ed38 (commit) from 38bf6cde3f7b91ed25aeebaae3a1f64664a4b0d4 (commit) - Log ----------------------------------------------------------------- commit 506c2ddfb5aec45f41396c4f3cbb99d17e5b2a48 Author: Mike Frysinger <va...@ge...> Date: Fri Jan 4 23:25:53 2013 -0500 ignore gdb state files Signed-off-by: Mike Frysinger <va...@ge...> commit e04a8ee5668ef13a5670b5c0a0e0150abcf4ed38 Author: Mike Frysinger <va...@ge...> Date: Fri Jan 4 23:23:59 2013 -0500 cpuid: optimize x86 & fix x86_64 truncation Use xchg on x86 to avoid needing to use an intermediate register and shave off one instruction. Skip the whole thing on x86_64 to avoid truncating the top 32bits of the rbx reg due to moving things around with ebx/etc... Signed-off-by: Mike Frysinger <va...@ge...> ----------------------------------------------------------------------- Summary of changes: .gitignore | 2 ++ include/ltp_cpuid.h | 18 +++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index c9f5637..7904fba 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ CVS *.obj *.gdb core +.gdb_history +.gdbinit lib*.a /aclocal.m4 diff --git a/include/ltp_cpuid.h b/include/ltp_cpuid.h index 9052e29..6bd5537 100644 --- a/include/ltp_cpuid.h +++ b/include/ltp_cpuid.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 The Chromium OS Authors. All rights reserved. + * Copyright (c) 2012-2013 The Chromium OS Authors. All rights reserved. * * Licensed under the BSD 3-clause. */ @@ -13,13 +13,17 @@ static inline void cpuid(unsigned int info, unsigned int *eax, unsigned int *ebx #if defined(__i386__) || defined(__x86_64__) unsigned int _eax = info, _ebx, _ecx, _edx; asm volatile( - "mov %%ebx, %%edi;" // save ebx (for PIC) +# ifdef __i386__ + "xchg %%ebx, %%esi;" /* save ebx (for PIC) */ "cpuid;" - "mov %%ebx, %%esi;" // pass to caller - "mov %%edi, %%ebx;" // restore ebx - : "+a" (_eax), "=S" (_ebx), "=c" (_ecx), "=d" (_edx) - : /* inputs: eax is handled above */ - : "edi" /* clobbers: we hit edi directly */ + "xchg %%esi, %%ebx;" /* restore ebx & pass to caller */ + : "=S" (_ebx), +# else + "cpuid;" + : "=b" (_ebx), +# endif + "+a" (_eax), "=c" (_ecx), "=d" (_edx) + : /* inputs: eax is handled above */ ); if (eax) *eax = _eax; if (ebx) *ebx = _ebx; hooks/post-receive -- ltp |