Use go 1.22 for building

It supports PCALIGN on non ARM arches as well
This commit is contained in:
Kovid Goyal
2024-02-11 20:29:37 +05:30
parent 2f727e6561
commit 720618bc37
2 changed files with 5 additions and 18 deletions

View File

@@ -1053,24 +1053,11 @@ func (s *Function) Return() {
}
func (s *Function) end_function() {
v := strings.Split(runtime.Version()[2:], ".")[:2]
atoi := func(x string) (v int) {
if v, err := strconv.Atoi(x); err != nil {
panic(err)
} else {
return v
}
}
ver := struct {
major, minor int
}{atoi(v[0]), atoi(v[1])}
if s.ISA.Goarch == ARM64 || (ver.major > 1 || ver.minor > 21) {
amt := 16
if s.Used256BitReg {
amt = 32
}
s.instr(fmt.Sprintf("PCALIGN $%d\n", amt))
amt := 16
if s.Used256BitReg {
amt = 32
}
s.instr(fmt.Sprintf("PCALIGN $%d\n", amt))
s.Return()
}