re PR target/85591 (__builtin_cpu_is() is not detecting bdver2 with Model = 0x02)
authorUros Bizjak <ubizjak@gmail.com>
Thu, 31 May 2018 19:45:54 +0000 (21:45 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Thu, 31 May 2018 19:45:54 +0000 (21:45 +0200)
PR target/85591
* config/i386/cpuinfo.c (get_amd_cpu): Return
AMDFAM15H_BDVER2 for AMDFAM15H model 0x2.

From-SVN: r261036

libgcc/ChangeLog
libgcc/config/i386/cpuinfo.c

index 89760ef011d602a4fe6dc59d929c752ff5c813be..9a94e8333ab893da5338419b9de818cefcecc27e 100644 (file)
@@ -1,3 +1,9 @@
+2018-05-31  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/85591
+       * config/i386/cpuinfo.c (get_amd_cpu): Return
+       AMDFAM15H_BDVER2 for AMDFAM15H model 0x2.
+
 2018-05-30  Rasmus Villemoes  <rasmus.villemoes@prevas.dk>
 
         * crtstuff.c: Remove declaration of _Jv_RegisterClasses.
index 8c9878c791de527b19e180f4b20fc55de87f5956..a7bb9dac151374055110a479f1a62bbaa1226e48 100644 (file)
@@ -83,17 +83,20 @@ get_amd_cpu (unsigned int family, unsigned int model)
     /* AMD Family 15h "Bulldozer".  */
     case 0x15:
       __cpu_model.__cpu_type = AMDFAM15H;
+
+      if (model == 0x2)
+       __cpu_model.__cpu_subtype = AMDFAM15H_BDVER2;      
       /* Bulldozer version 1.  */
-      if ( model <= 0xf)
+      else if (model <= 0xf)
        __cpu_model.__cpu_subtype = AMDFAM15H_BDVER1;
       /* Bulldozer version 2 "Piledriver" */
-      if (model >= 0x10 && model <= 0x2f)
+      else if (model <= 0x2f)
        __cpu_model.__cpu_subtype = AMDFAM15H_BDVER2;      
       /* Bulldozer version 3 "Steamroller"  */
-      if (model >= 0x30 && model <= 0x4f)
+      else if (model <= 0x4f)
        __cpu_model.__cpu_subtype = AMDFAM15H_BDVER3;
       /* Bulldozer version 4 "Excavator"   */
-      if (model >= 0x60 && model <= 0x7f)
+      else if (model <= 0x7f)
        __cpu_model.__cpu_subtype = AMDFAM15H_BDVER4;
       break;
     /* AMD Family 16h "btver2" */