Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cda344f1 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix typos in arch_list and do variant validation"

parents bc83b504 2c2afe26
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -864,6 +864,10 @@ func createArchPropTypeDesc(props reflect.Type) []archPropTypeDesc {
				archVariant := variantReplacer.Replace(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] {
				feature := variantReplacer.Replace(feature)
				variants = append(variants, proptools.FieldNameForProperty(feature))
@@ -1741,6 +1745,18 @@ func decodeArch(os OsType, arch string, archVariant, cpuVariant *string, abi []s
		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.
	for i := 0; i < len(a.Abi); i++ {
		if a.Abi[i] == "" {
+38 −29
Original line number Diff line number Diff line
@@ -22,38 +22,12 @@ var archVariants = map[ArchType][]string{
		"armv7-a-neon",
		"armv8-a",
		"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: {
		"armv8_a",
		"armv8_a_branchprot",
		"armv8_2a",
		"armv8-a",
		"armv8-a-branchprot",
		"armv8-2a",
		"armv8-2a-dotprod",
		"cortex-a53",
		"cortex-a55",
		"cortex-a72",
		"cortex-a73",
		"cortex-a75",
		"cortex-a76",
		"kryo",
		"kryo385",
		"exynos-m1",
		"exynos-m2",
	},
	X86: {
		"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{
	Arm: {
		"neon",
+1 −1
Original line number Diff line number Diff line
@@ -37,10 +37,10 @@ var (
		"": []string{
			"-march=x86-64",
		},

		"broadwell": []string{
			"-march=broadwell",
		},

		"haswell": []string{
			"-march=core-avx2",
		},