Also zero upper at start of function

This commit is contained in:
Kovid Goyal
2024-02-02 05:58:54 +05:30
parent db2e0e816d
commit 5a5e31c38b

View File

@@ -1048,6 +1048,10 @@ func (s *Function) OutputASM(w io.Writer) {
s.print_signature(w)
fmt.Fprintf(w, "\nTEXT ·%s(SB), NOSPLIT, $0-%d\n", s.Name, s.Size)
if s.Used256BitReg {
fmt.Fprintln(w, "\tVZEROUPPER // zero upper bits of AVX registers to avoid dependencies when switching between SSE and AVX code")
}
s.Return()
for _, i := range s.Instructions {
fmt.Fprintln(w, i)