]> sourceware.org Git - glibc.git/commitdiff
x86: Add new architecture type for Hygon processors
authorFeifei Wang <wangfeifei@hygon.cn>
Mon, 19 Aug 2024 06:57:53 +0000 (14:57 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 26 Aug 2024 17:01:58 +0000 (10:01 -0700)
Add a new architecture type arch_kind_hygon to spilt Hygon branch
from AMD. This is to facilitate the Hygon processors to make settings
that are suitable for its own characteristics.

Signed-off-by: Feifei Wang <wangfeifei@hygon.cn>
Reviewed-by: Jing Li <lijing@hygon.cn>
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
sysdeps/x86/cpu-features.c
sysdeps/x86/include/cpu-features.h

index 0fb50f9432509a00493b17a41bb5e7183704719b..e6139e28374257389b230a17cce204f419d95535 100644 (file)
@@ -986,9 +986,8 @@ https://www.intel.com/content/www/us/en/support/articles/000059422/processors.ht
        cpu_features->preferred[index_arch_Avoid_Short_Distance_REP_MOVSB]
          |= bit_arch_Avoid_Short_Distance_REP_MOVSB;
     }
-  /* This spells out "AuthenticAMD" or "HygonGenuine".  */
-  else if ((ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65)
-          || (ebx == 0x6f677948 && ecx == 0x656e6975 && edx == 0x6e65476e))
+  /* This spells out "AuthenticAMD".  */
+  else if (ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65)
     {
       unsigned int extended_model;
 
@@ -1104,6 +1103,20 @@ https://www.intel.com/content/www/us/en/support/articles/000059422/processors.ht
            }
        }
     }
+  /* This spells out "HygonGenuine".  */
+  else if (ebx == 0x6f677948 && ecx == 0x656e6975 && edx == 0x6e65476e)
+    {
+      unsigned int extended_model;
+
+      kind = arch_kind_hygon;
+
+      get_common_indices (cpu_features, &family, &model, &extended_model,
+                         &stepping);
+
+      get_extended_indices (cpu_features);
+
+      update_active (cpu_features);
+    }
   else
     {
       kind = arch_kind_other;
index aaae44f0e12294f565f78a4bae90bee3efe0cb0c..b8e790c8fdaddf820897955158bb7d941ceac754 100644 (file)
@@ -881,6 +881,7 @@ enum cpu_features_kind
   arch_kind_intel,
   arch_kind_amd,
   arch_kind_zhaoxin,
+  arch_kind_hygon,
   arch_kind_other
 };
 
This page took 0.047242 seconds and 5 git commands to generate.