File tree 1 file changed +12
-2
lines changed
crates/std_detect/src/detect/os
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -234,8 +234,18 @@ fn detect_features() -> cache::Initializer {
234
234
// The `is_x86_feature_detected!("lzcnt")` macro then
235
235
// internally maps to Feature::abm.
236
236
enable ( extended_proc_info_ecx, 5 , Feature :: abm) ;
237
- if vendor_id == * b"AuthenticAMD" {
238
- // These features are only available on AMD CPUs:
237
+ // As Hygon Dhyana originates from AMD technology and shares most of the architecture with
238
+ // AMD's family 17h, but with different CPU Vendor ID("HygonGenuine")/Family series
239
+ // number(Family 18h).
240
+ //
241
+ // For CPUID feature bits, Hygon Dhyana(family 18h) share the same definition with AMD
242
+ // family 17h.
243
+ //
244
+ // Related AMD CPUID specification is https://www.amd.com/system/files/TechDocs/25481.pdf.
245
+ // Related Hygon kernel patch can be found on
246
+ // http://lkml.kernel.org/r/5ce86123a7b9dad925ac583d88d2f921040e859b.1538583282.git.puwen@hygon.cn
247
+ if vendor_id == * b"AuthenticAMD" || vendor_id == * b"HygonGenuine" {
248
+ // These features are available on AMD arch CPUs:
239
249
enable ( extended_proc_info_ecx, 6 , Feature :: sse4a) ;
240
250
enable ( extended_proc_info_ecx, 21 , Feature :: tbm) ;
241
251
}
You can’t perform that action at this time.
0 commit comments