re PR target/77756 (__get_cpuid() returns wrong values for level 7 (extended features))
PR target/77756 * config/i386/cpuid.h (__get_cpuid_count): New. (__get_cpuid): Rename __level to __leaf. testsuite/ChangeLog: PR target/77756 * gcc.target/i386/pr77756.c: New test. From-SVN: r240629
This commit is contained in:
parent
f90b32b95b
commit
2488ebe5ef
@ -1,3 +1,9 @@
|
||||
2016-09-29 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
PR target/77756
|
||||
* config/i386/cpuid.h (__get_cpuid_count): New.
|
||||
(__get_cpuid): Rename __level to __leaf.
|
||||
|
||||
2016-09-29 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
* genattrtab.c (write_attr_case): Also emit FALLTHRU marker.
|
||||
@ -100,11 +106,6 @@
|
||||
get_destination_size, pass_sprintf_length::handle_gimple_call):
|
||||
Likewise.
|
||||
|
||||
2016-09-28 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
PR target/77756
|
||||
* config/i386/cpuid.h (__get_cpuid): Handle CPUID level >= 7.
|
||||
|
||||
2016-09-28 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* gimple-ssa-sprintf.c: Fix comment formatting.
|
||||
|
@ -229,31 +229,37 @@ __get_cpuid_max (unsigned int __ext, unsigned int *__sig)
|
||||
return __eax;
|
||||
}
|
||||
|
||||
/* Return cpuid data for requested cpuid level, as found in returned
|
||||
/* Return cpuid data for requested cpuid leaf, as found in returned
|
||||
eax, ebx, ecx and edx registers. The function checks if cpuid is
|
||||
supported and returns 1 for valid cpuid information or 0 for
|
||||
unsupported cpuid level. All pointers are required to be non-null. */
|
||||
unsupported cpuid leaf. All pointers are required to be non-null. */
|
||||
|
||||
static __inline int
|
||||
__get_cpuid (unsigned int __level,
|
||||
__get_cpuid (unsigned int __leaf,
|
||||
unsigned int *__eax, unsigned int *__ebx,
|
||||
unsigned int *__ecx, unsigned int *__edx)
|
||||
{
|
||||
unsigned int __ext = __level & 0x80000000;
|
||||
unsigned int __ext = __leaf & 0x80000000;
|
||||
|
||||
if (__get_cpuid_max (__ext, 0) < __level)
|
||||
if (__get_cpuid_max (__ext, 0) < __leaf)
|
||||
return 0;
|
||||
|
||||
if (__ext)
|
||||
__cpuid (__level, *__eax, *__ebx, *__ecx, *__edx);
|
||||
else
|
||||
{
|
||||
if (__level >= 13)
|
||||
__cpuid_count (__level, 1, *__eax, *__ebx, *__ecx, *__edx);
|
||||
else if (__level >= 7)
|
||||
__cpuid_count (__level, 0, *__eax, *__ebx, *__ecx, *__edx);
|
||||
else
|
||||
__cpuid (__level, *__eax, *__ebx, *__ecx, *__edx);
|
||||
}
|
||||
__cpuid (__leaf, *__eax, *__ebx, *__ecx, *__edx);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Same as above, but sub-leaf can be specified. */
|
||||
|
||||
static __inline int
|
||||
__get_cpuid_count (unsigned int __leaf, unsigned int __subleaf,
|
||||
unsigned int *__eax, unsigned int *__ebx,
|
||||
unsigned int *__ecx, unsigned int *__edx)
|
||||
{
|
||||
unsigned int __ext = __leaf & 0x80000000;
|
||||
|
||||
if (__get_cpuid_max (__ext, 0) < __leaf)
|
||||
return 0;
|
||||
|
||||
__cpuid_count (__leaf, __subleaf, *__eax, *__ebx, *__ecx, *__edx);
|
||||
return 1;
|
||||
}
|
||||
|
@ -1,3 +1,8 @@
|
||||
2016-09-29 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
PR target/77756
|
||||
* gcc.target/i386/pr77756.c: New test.
|
||||
|
||||
2016-09-29 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
* g++.dg/cpp0x/fallthrough2.C: Use the c++14_down target.
|
||||
@ -32,11 +37,6 @@
|
||||
* gcc.dg/profile-update-warning.c: Restrict to ia32.
|
||||
(dg-options): Remove -m32.
|
||||
|
||||
2016-09-28 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
PR target/77756
|
||||
* gcc.target/i386/pr77756.c: New test.
|
||||
|
||||
2016-09-28 Martin Sebor <msebor@redhat.com>
|
||||
|
||||
PR middle-end/77721
|
||||
|
@ -11,7 +11,7 @@ main ()
|
||||
{
|
||||
unsigned int eax, ebx, ecx, edx;
|
||||
|
||||
if (!__get_cpuid (7, &eax, &ebx, &ecx, &edx))
|
||||
if (!__get_cpuid_count (7, 0, &eax, &ebx, &ecx, &edx))
|
||||
__builtin_abort ();
|
||||
|
||||
if (!(ebx & bit_AVX2))
|
||||
|
Loading…
Reference in New Issue
Block a user