public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug driver/50740] New: CPUID leaf 7 for BMI/BMI2/AVX2 feature detection not qualified with max_level and doesn't use subleaf
@ 2011-10-16  0:06 craig.topper at gmail dot com
  2011-10-21  1:10 ` [Bug driver/50740] " hjl.tools at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: craig.topper at gmail dot com @ 2011-10-16  0:06 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50740

             Bug #: 50740
           Summary: CPUID leaf 7 for BMI/BMI2/AVX2 feature detection not
                    qualified with max_level and doesn't use subleaf
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: craig.topper@gmail.com


The cpuid code for detecting BMI, BMI2, and AVX2 support needs to be qualified
with max_level >= 7. Additionally, it should use __cpuid_count instead of
__cpuid because leaf 7 uses subleafs just like leaf 4.

Relevant code from i386-driver.c

      __cpuid (0x7, eax, ebx, ecx, edx);

      has_bmi = ebx & bit_BMI;
      has_avx2 = ebx & bit_AVX2;
      has_bmi2 = ebx & bit_BMI2;


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug driver/50740] CPUID leaf 7 for BMI/BMI2/AVX2 feature detection not qualified with max_level and doesn't use subleaf
  2011-10-16  0:06 [Bug driver/50740] New: CPUID leaf 7 for BMI/BMI2/AVX2 feature detection not qualified with max_level and doesn't use subleaf craig.topper at gmail dot com
@ 2011-10-21  1:10 ` hjl.tools at gmail dot com
  2011-10-21 14:33 ` uros at gcc dot gnu.org
  2011-10-21 14:45 ` ubizjak at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: hjl.tools at gmail dot com @ 2011-10-21  1:10 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50740

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2011-10-21 01:09:46 UTC ---
Created attachment 25565
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25565
A patch

Kirill, can you take care of it?


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug driver/50740] CPUID leaf 7 for BMI/BMI2/AVX2 feature detection not qualified with max_level and doesn't use subleaf
  2011-10-16  0:06 [Bug driver/50740] New: CPUID leaf 7 for BMI/BMI2/AVX2 feature detection not qualified with max_level and doesn't use subleaf craig.topper at gmail dot com
  2011-10-21  1:10 ` [Bug driver/50740] " hjl.tools at gmail dot com
@ 2011-10-21 14:33 ` uros at gcc dot gnu.org
  2011-10-21 14:45 ` ubizjak at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: uros at gcc dot gnu.org @ 2011-10-21 14:33 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50740

--- Comment #2 from uros at gcc dot gnu.org 2011-10-21 14:32:36 UTC ---
Author: uros
Date: Fri Oct 21 14:32:32 2011
New Revision: 180304

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=180304
Log:
    PR target/50740
    * config/i386/driver-i386.c (host_detect_local_cpu): Do cpuid 7 only
    if max_level allows that.

testsuite/ChangeLog:

    PR target/50740
    * gcc.target/i386/avx2-check.h (main): Check CPUID level correctly.
    * gcc.target/i386/bmi2-check.h: Ditto.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/driver-i386.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.target/i386/avx2-check.h
    trunk/gcc/testsuite/gcc.target/i386/bmi2-check.h


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug driver/50740] CPUID leaf 7 for BMI/BMI2/AVX2 feature detection not qualified with max_level and doesn't use subleaf
  2011-10-16  0:06 [Bug driver/50740] New: CPUID leaf 7 for BMI/BMI2/AVX2 feature detection not qualified with max_level and doesn't use subleaf craig.topper at gmail dot com
  2011-10-21  1:10 ` [Bug driver/50740] " hjl.tools at gmail dot com
  2011-10-21 14:33 ` uros at gcc dot gnu.org
@ 2011-10-21 14:45 ` ubizjak at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: ubizjak at gmail dot com @ 2011-10-21 14:45 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50740

Uros Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86
             Status|UNCONFIRMED                 |RESOLVED
                URL|                            |http://gcc.gnu.org/ml/gcc-p
                   |                            |atches/2011-10/msg01949.htm
                   |                            |l
         Resolution|                            |FIXED
   Target Milestone|---                         |4.7.0

--- Comment #3 from Uros Bizjak <ubizjak at gmail dot com> 2011-10-21 14:44:01 UTC ---
Fixed.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-10-21 14:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-16  0:06 [Bug driver/50740] New: CPUID leaf 7 for BMI/BMI2/AVX2 feature detection not qualified with max_level and doesn't use subleaf craig.topper at gmail dot com
2011-10-21  1:10 ` [Bug driver/50740] " hjl.tools at gmail dot com
2011-10-21 14:33 ` uros at gcc dot gnu.org
2011-10-21 14:45 ` ubizjak at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).