@@ -89,22 +89,20 @@ function normalize_arch(arch::String)
89
89
return arch
90
90
end
91
91
92
- const ALL_FEATURES = let
93
- get_features (prefix:: String ) =
94
- getfield .(Ref (@__MODULE__ ), filter (n -> startswith (String (n), prefix), (names (@__MODULE__ ; all= true ))))
95
- Dict (
96
- " i686" => get_features (" JL_X86" ),
97
- " x86_64" => get_features (" JL_X86" ),
98
- " armv6l" => get_features (" JL_AArch32" ),
99
- " armv7l" => get_features (" JL_AArch32" ),
100
- " aarch64" => get_features (" JL_AArch64" ),
101
- " powerpc64le" => UInt32[],
102
- )
103
- end
92
+ let
93
+ # Collect all relevant features for the current architecture, if any.
94
+ FEATURES = UInt32[]
95
+ arch = normalize_arch (String (Sys. ARCH))
96
+ if arch in keys (ISAs_by_family)
97
+ for isa in ISAs_by_family[arch]
98
+ unique! (append! (FEATURES, last (isa). features))
99
+ end
100
+ end
104
101
105
- # Use `@eval` to statically determine the list of features for the current architecture.
106
- @eval function cpu_isa ()
107
- return ISA (Set {UInt32} (feat for feat in $ (ALL_FEATURES[normalize_arch (String (Sys. ARCH))]) if test_cpu_feature (feat)))
102
+ # Use `@eval` to inline the list of features.
103
+ @eval function cpu_isa ()
104
+ return ISA (Set {UInt32} (feat for feat in $ (FEATURES) if test_cpu_feature (feat)))
105
+ end
108
106
end
109
107
110
108
"""
0 commit comments