From: "M. Warner Losh" <imp@bsdimp.com>
To: qemu-devel@nongnu.org, Laurent.Vivier@bull.net
Cc: agraf@suse.de
Subject: Re: [Qemu-devel] [PATCH 1/3] [x86] Clean up vendor identification
Date: Mon, 11 Aug 2008 07:37:58 -0600 (MDT) [thread overview]
Message-ID: <20080811.073758.179960465.imp@bsdimp.com> (raw)
In-Reply-To: <1218459039.3871.18.camel@frecb07144>
In message: <1218459039.3871.18.camel@frecb07144>
Laurent Vivier <Laurent.Vivier@bull.net> writes:
: Le lundi 11 août 2008 à 14:32 +0200, Alexander Graf a écrit :
: > On Aug 11, 2008, at 1:56 PM, Laurent Vivier wrote:
: >
: > > Le lundi 11 août 2008 à 12:37 +0200, Alexander Graf a écrit :
: > >> Right now CPU vendor identification contains a lot of magic numbers.
: > >> The
: > >> patch cleans them up to defines, so we can identify the CPU later on
: > >> without copying magic numbers.
: > >>
: > >> Signed-off-by: Alexander Graf <agraf@suse.de>
: > >>
: > >>
: > >>
: > >> diff --git a/qemu/target-i386/cpu.h b/qemu/target-i386/cpu.h
: > >> index 7e95900..3c84dc9 100644
: > >> --- a/qemu/target-i386/cpu.h
: > >> +++ b/qemu/target-i386/cpu.h
: > >> @@ -339,6 +341,14 @@
: > >> #define CPUID_EXT3_IBS (1 << 10)
: > >> #define CPUID_EXT3_SKINIT (1 << 12)
: > >>
: > >> +#define CPUID_VENDOR_INTEL_1 0x756e6547 /* "Genu" */
: > >> +#define CPUID_VENDOR_INTEL_2 0x49656e69 /* "ineI" */
: > >> +#define CPUID_VENDOR_INTEL_3 0x6c65746e /* "ntel" */
: > >> +
: > >> +#define CPUID_VENDOR_AMD_1 0x68747541 /* "Auth" */
: > >> +#define CPUID_VENDOR_AMD_2 0x69746e65 /* "enti" */
: > >> +#define CPUID_VENDOR_AMD_3 0x444d4163 /* "cAMD" */
: > >
: > > if you add "-Wno-multichar" in C flags, you can use:
: > >
: > > #define CPUID_VENDOR_INTEL_1 'Genu'
: > > ...
: >
: > Is that a real improvement? It won't make the code faster and the
: > readability doesn't improve that much either.
:
: The code is not faster, it is not more readable,
: but when you read this, are you sure 0x756e6547 is equal to "Genu" ?
:
: Personally, I'm not.
man ascii
and you'll be sure... Besides, you know you have an upper case
letter, followed by 3 lower case ones just by glancing at it...
Warner
next prev parent reply other threads:[~2008-08-11 13:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-11 10:37 [Qemu-devel] [PATCH 1/3] [x86] Clean up vendor identification Alexander Graf
2008-08-11 11:56 ` Laurent Vivier
2008-08-11 12:32 ` Alexander Graf
2008-08-11 12:50 ` Laurent Vivier
2008-08-11 13:37 ` M. Warner Losh [this message]
2008-08-11 14:05 ` Laurent Vivier
2008-08-11 12:56 ` Carlos A. M. dos Santos
2008-08-11 14:51 ` Paul Brook
2008-08-11 15:22 ` Carlos A. M. dos Santos
2008-08-11 13:04 ` Paul Brook
2008-08-11 13:35 ` M. Warner Losh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080811.073758.179960465.imp@bsdimp.com \
--to=imp@bsdimp.com \
--cc=Laurent.Vivier@bull.net \
--cc=agraf@suse.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.