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
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 18 deletions

2
go.mod
View file

@ -1,6 +1,6 @@
module kitty
go 1.21
go 1.22
require (
github.com/ALTree/bigfloat v0.2.0

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()
}