Fix typos in arch_list and do variant validation
Test: m nothing Change-Id: Icfbc9f886a1e16abe02bf6c61671b8187a699942
This commit is contained in:
@@ -864,6 +864,10 @@ func createArchPropTypeDesc(props reflect.Type) []archPropTypeDesc {
|
|||||||
archVariant := variantReplacer.Replace(archVariant)
|
archVariant := variantReplacer.Replace(archVariant)
|
||||||
variants = append(variants, proptools.FieldNameForProperty(archVariant))
|
variants = append(variants, proptools.FieldNameForProperty(archVariant))
|
||||||
}
|
}
|
||||||
|
for _, cpuVariant := range cpuVariants[arch] {
|
||||||
|
cpuVariant := variantReplacer.Replace(cpuVariant)
|
||||||
|
variants = append(variants, proptools.FieldNameForProperty(cpuVariant))
|
||||||
|
}
|
||||||
for _, feature := range archFeatures[arch] {
|
for _, feature := range archFeatures[arch] {
|
||||||
feature := variantReplacer.Replace(feature)
|
feature := variantReplacer.Replace(feature)
|
||||||
variants = append(variants, proptools.FieldNameForProperty(feature))
|
variants = append(variants, proptools.FieldNameForProperty(feature))
|
||||||
@@ -1714,6 +1718,18 @@ func decodeArch(os OsType, arch string, archVariant, cpuVariant *string, abi []s
|
|||||||
a.CpuVariant = ""
|
a.CpuVariant = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if a.ArchVariant != "" {
|
||||||
|
if validArchVariants := archVariants[archType]; !InList(a.ArchVariant, validArchVariants) {
|
||||||
|
return Arch{}, fmt.Errorf("[%q] unknown arch variant %q, support variants: %q", archType, a.ArchVariant, validArchVariants)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if a.CpuVariant != "" {
|
||||||
|
if validCpuVariants := cpuVariants[archType]; !InList(a.CpuVariant, validCpuVariants) {
|
||||||
|
return Arch{}, fmt.Errorf("[%q] unknown cpu variant %q, support variants: %q", archType, a.CpuVariant, validCpuVariants)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Filter empty ABIs out of the list.
|
// Filter empty ABIs out of the list.
|
||||||
for i := 0; i < len(a.Abi); i++ {
|
for i := 0; i < len(a.Abi); i++ {
|
||||||
if a.Abi[i] == "" {
|
if a.Abi[i] == "" {
|
||||||
|
@@ -22,38 +22,12 @@ var archVariants = map[ArchType][]string{
|
|||||||
"armv7-a-neon",
|
"armv7-a-neon",
|
||||||
"armv8-a",
|
"armv8-a",
|
||||||
"armv8-2a",
|
"armv8-2a",
|
||||||
"cortex-a7",
|
|
||||||
"cortex-a8",
|
|
||||||
"cortex-a9",
|
|
||||||
"cortex-a15",
|
|
||||||
"cortex-a53",
|
|
||||||
"cortex-a53-a57",
|
|
||||||
"cortex-a55",
|
|
||||||
"cortex-a72",
|
|
||||||
"cortex-a73",
|
|
||||||
"cortex-a75",
|
|
||||||
"cortex-a76",
|
|
||||||
"krait",
|
|
||||||
"kryo",
|
|
||||||
"kryo385",
|
|
||||||
"exynos-m1",
|
|
||||||
"exynos-m2",
|
|
||||||
},
|
},
|
||||||
Arm64: {
|
Arm64: {
|
||||||
"armv8_a",
|
"armv8-a",
|
||||||
"armv8_a_branchprot",
|
"armv8-a-branchprot",
|
||||||
"armv8_2a",
|
"armv8-2a",
|
||||||
"armv8-2a-dotprod",
|
"armv8-2a-dotprod",
|
||||||
"cortex-a53",
|
|
||||||
"cortex-a55",
|
|
||||||
"cortex-a72",
|
|
||||||
"cortex-a73",
|
|
||||||
"cortex-a75",
|
|
||||||
"cortex-a76",
|
|
||||||
"kryo",
|
|
||||||
"kryo385",
|
|
||||||
"exynos-m1",
|
|
||||||
"exynos-m2",
|
|
||||||
},
|
},
|
||||||
X86: {
|
X86: {
|
||||||
"amberlake",
|
"amberlake",
|
||||||
@@ -87,6 +61,41 @@ var archVariants = map[ArchType][]string{
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var cpuVariants = map[ArchType][]string{
|
||||||
|
Arm: {
|
||||||
|
"cortex-a7",
|
||||||
|
"cortex-a8",
|
||||||
|
"cortex-a9",
|
||||||
|
"cortex-a15",
|
||||||
|
"cortex-a53",
|
||||||
|
"cortex-a53.a57",
|
||||||
|
"cortex-a55",
|
||||||
|
"cortex-a72",
|
||||||
|
"cortex-a73",
|
||||||
|
"cortex-a75",
|
||||||
|
"cortex-a76",
|
||||||
|
"krait",
|
||||||
|
"kryo",
|
||||||
|
"kryo385",
|
||||||
|
"exynos-m1",
|
||||||
|
"exynos-m2",
|
||||||
|
},
|
||||||
|
Arm64: {
|
||||||
|
"cortex-a53",
|
||||||
|
"cortex-a55",
|
||||||
|
"cortex-a72",
|
||||||
|
"cortex-a73",
|
||||||
|
"cortex-a75",
|
||||||
|
"cortex-a76",
|
||||||
|
"kryo",
|
||||||
|
"kryo385",
|
||||||
|
"exynos-m1",
|
||||||
|
"exynos-m2",
|
||||||
|
},
|
||||||
|
X86: {},
|
||||||
|
X86_64: {},
|
||||||
|
}
|
||||||
|
|
||||||
var archFeatures = map[ArchType][]string{
|
var archFeatures = map[ArchType][]string{
|
||||||
Arm: {
|
Arm: {
|
||||||
"neon",
|
"neon",
|
||||||
|
@@ -37,10 +37,10 @@ var (
|
|||||||
"": []string{
|
"": []string{
|
||||||
"-march=x86-64",
|
"-march=x86-64",
|
||||||
},
|
},
|
||||||
|
|
||||||
"broadwell": []string{
|
"broadwell": []string{
|
||||||
"-march=broadwell",
|
"-march=broadwell",
|
||||||
},
|
},
|
||||||
|
|
||||||
"haswell": []string{
|
"haswell": []string{
|
||||||
"-march=core-avx2",
|
"-march=core-avx2",
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user