From 8b8003ed544bf7fd45192ad6b9429512dedc1a55 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Thu, 31 May 2018 21:45:54 +0200 Subject: [PATCH] re PR target/85591 (__builtin_cpu_is() is not detecting bdver2 with Model = 0x02) PR target/85591 * config/i386/cpuinfo.c (get_amd_cpu): Return AMDFAM15H_BDVER2 for AMDFAM15H model 0x2. From-SVN: r261036 --- libgcc/ChangeLog | 6 ++++++ libgcc/config/i386/cpuinfo.c | 11 +++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 89760ef011d..9a94e8333ab 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2018-05-31 Uros Bizjak + + PR target/85591 + * config/i386/cpuinfo.c (get_amd_cpu): Return + AMDFAM15H_BDVER2 for AMDFAM15H model 0x2. + 2018-05-30 Rasmus Villemoes * crtstuff.c: Remove declaration of _Jv_RegisterClasses. diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c index 8c9878c791d..a7bb9dac151 100644 --- a/libgcc/config/i386/cpuinfo.c +++ b/libgcc/config/i386/cpuinfo.c @@ -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" */ -- 2.30.2