This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, i386] Handle extended family cpuid info for AMD
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: "Gopalasubramanian, Ganesh" <Ganesh dot Gopalasubramanian at amd dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 1 Aug 2014 09:59:47 +0200
- Subject: Re: [PATCH, i386] Handle extended family cpuid info for AMD
- Authentication-results: sourceware.org; auth=none
- References: <EB4625145972F94C9680D8CADD651615787D3293 at SATLEXDAG02 dot amd dot com> <CAFULd4bYmTe8H0DobUjsTV2ZkUjj3F66ofS-Fk4yfW08E=aK2g at mail dot gmail dot com> <EB4625145972F94C9680D8CADD651615787D32D3 at SATLEXDAG02 dot amd dot com> <CAFULd4aoB070f4rTZ9RsR4x4K89QZFaHmBKdMhmZQFf09M8DVQ at mail dot gmail dot com> <EB4625145972F94C9680D8CADD651615787D32E9 at SATLEXDAG02 dot amd dot com> <CAFULd4YvfSiZk+ya51BgiHQLbanYsVwn04TrbeqfJ2bDgHjp4A at mail dot gmail dot com> <EB4625145972F94C9680D8CADD651615787D5FE3 at SATLEXDAG02 dot amd dot com>
On Fri, Aug 1, 2014 at 8:18 AM, Gopalasubramanian, Ganesh
<Ganesh.Gopalasubramanian@amd.com> wrote:
>> I would like to have a check for a family at the beginning, something like:
>
>> if (name == signature_NSC_ebx)
>> processor = PROCESSOR_GEODE;
>> else if (family == 22)
>> {
>> if (has_movbe)
>
> I get your idea of having the family checked first and then differentiating with cpuid info later.
> But, this case is getting interesting because, BTVER1 and BTVER2 are two variants but don't really have same family numbers.
> BTVER1 is family 14h and BTVER2 is family 16h. I don't see near term plans for any additional cpus to either 14h or 16h.
> Given that fact, this particular check is applicable only for BTVER2.
> In that case, having
>
> else if (family == 22)
> if (has_movbe)
> processor = PROCESSOR_BTVER2;
>
> looks odd.
In this case, having only check for family ID should be enough. If
BTVER1 and BTVER2 can be uniquely determined by their family IDs ,
then:
... (signature checks)
else if (family == 0x16h)
processor = PROCESSOR_BTVER2;
else if (family == 0x14h)
processor = PROCESSOR_BTVER1;
else
... (detect processor in a generic way by its cpuid features.)
IMO, this would be the most future-proof approach. Signature checks
will override family id checks which will override cpuid checks.
Uros.