Skip to content

Commit b0cfb43

Browse files
authored
[BinaryPlatforms]: Impose an ordering on arch_march_isa_mapping (#37692)
We want to be able to easily walk these in "compatibility order", so we arrange them in order. It may be that we eventually have multiple "branches", btu since there's a nice linearization right now, let's see how far we can walk with this. I've also switched to vectors rather than tuples, to make it easier to modify these in the future if we must.
1 parent 07e9e09 commit b0cfb43

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

base/binaryplatforms.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ include(string(length(Core.ARGS) >= 2 ? Core.ARGS[2] : "", "features_h.jl")) #
3333

3434
# Keep in sync with `arch_march_isa_mapping`.
3535
const ISAs_by_family = Dict(
36-
"x86_64" => (
36+
"x86_64" => [
3737
# Source: https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html.
3838
# Implicit in all sets, because always required: mmx, sse, sse2
3939
"x86_64" => ISA(Set{UInt32}()),
@@ -43,19 +43,19 @@ const ISAs_by_family = Dict(
4343
"haswell" => ISA(Set((JL_X86_movbe, JL_X86_sse3, JL_X86_ssse3, JL_X86_sse41, JL_X86_sse42, JL_X86_popcnt, JL_X86_avx, JL_X86_avx2, JL_X86_aes, JL_X86_pclmul, JL_X86_fsgsbase, JL_X86_rdrnd, JL_X86_fma, JL_X86_bmi, JL_X86_bmi2, JL_X86_f16c))),
4444
"skylake" => ISA(Set((JL_X86_movbe, JL_X86_sse3, JL_X86_ssse3, JL_X86_sse41, JL_X86_sse42, JL_X86_popcnt, JL_X86_avx, JL_X86_avx2, JL_X86_aes, JL_X86_pclmul, JL_X86_fsgsbase, JL_X86_rdrnd, JL_X86_fma, JL_X86_bmi, JL_X86_bmi2, JL_X86_f16c, JL_X86_rdseed, JL_X86_adx, JL_X86_prfchw, JL_X86_clflushopt, JL_X86_xsavec, JL_X86_xsaves))),
4545
"skylake_avx512" => ISA(Set((JL_X86_movbe, JL_X86_sse3, JL_X86_ssse3, JL_X86_sse41, JL_X86_sse42, JL_X86_popcnt, JL_X86_pku, JL_X86_avx, JL_X86_avx2, JL_X86_aes, JL_X86_pclmul, JL_X86_fsgsbase, JL_X86_rdrnd, JL_X86_fma, JL_X86_bmi, JL_X86_bmi2, JL_X86_f16c, JL_X86_rdseed, JL_X86_adx, JL_X86_prfchw, JL_X86_clflushopt, JL_X86_xsavec, JL_X86_xsaves, JL_X86_avx512f, JL_X86_clwb, JL_X86_avx512vl, JL_X86_avx512bw, JL_X86_avx512dq, JL_X86_avx512cd))),
46-
),
47-
"arm" => (
46+
],
47+
"arm" => [
4848
"armv7l" => ISA(Set{UInt32}()),
4949
"armv7l_neon" => ISA(Set((JL_AArch32_neon,))),
5050
"armv7l_neon_vfp4" => ISA(Set((JL_AArch32_neon, JL_AArch32_vfp4))),
51-
),
52-
"aarch64" => (
51+
],
52+
"aarch64" => [
5353
# Implicit in all sets, because always required: fp, asimd
5454
"armv8.0_a" => ISA(Set{UInt32}()),
5555
"armv8.1_a" => ISA(Set((JL_AArch64_lse, JL_AArch64_crc, JL_AArch64_rdm))),
5656
"armv8.2_a_crypto" => ISA(Set((JL_AArch64_lse, JL_AArch64_crc, JL_AArch64_rdm, JL_AArch64_aes, JL_AArch64_sha2))),
5757
"armv8.4_a_crypto_sve" => ISA(Set((JL_AArch64_lse, JL_AArch64_crc, JL_AArch64_rdm, JL_AArch64_fp16fml, JL_AArch64_dotprod, JL_AArch64_aes, JL_AArch64_sha2, JL_AArch64_dotprod, JL_AArch64_sve))),
58-
),
58+
],
5959
)
6060

6161
test_cpu_feature(feature::UInt32) = ccall(:jl_test_cpu_feature, Bool, (UInt32,), feature)
@@ -652,22 +652,22 @@ const arch_march_isa_mapping = let
652652
return all[findfirst(x -> x.first == name, all)].second
653653
end
654654
Dict(
655-
"x86_64" => Dict{String,CPUID.ISA}(
655+
"x86_64" => [
656656
"x86_64" => get_set("x86_64", "x86_64"),
657657
"avx" => get_set("x86_64", "sandybridge"),
658658
"avx2" => get_set("x86_64", "haswell"),
659659
"avx512" => get_set("x86_64", "skylake_avx512"),
660-
),
661-
"armv7l" => Dict{String,CPUID.ISA}(
660+
],
661+
"armv7l" => [
662662
"armv7l" => get_set("arm", "armv7l"),
663663
"neon" => get_set("arm", "armv7l_neon"),
664664
"vfp4" => get_set("arm", "armv7l_neon_vfp4"),
665-
),
666-
"aarch64" => Dict{String,CPUID.ISA}(
665+
],
666+
"aarch64" => [
667667
"armv8" => get_set("aarch64", "armv8.0_a"),
668668
"thunderx2" => get_set("aarch64", "armv8.1_a"),
669669
"carmel" => get_set("aarch64", "armv8.2_a_crypto"),
670-
),
670+
],
671671
)
672672
end
673673
const os_mapping = Dict(

0 commit comments

Comments
 (0)