cv.Xoffset = offset
offset += cv.Type.Width
- if v.Name.Byval && v.Type.Width <= int64(2*Widthptr) && Thearch.Thechar == '6' {
- // If it is a small variable captured by value, downgrade it to PAUTO.
- // This optimization is currently enabled only for amd64, see:
- // https://github.com/golang/go/issues/9865
+ if v.Name.Byval && v.Type.Width <= int64(2*Widthptr) {
+ // If it is a small variable captured by value, downgrade it to PAUTO.
v.Class = PAUTO
-
v.Ullman = 1
xfunc.Func.Dcl = list(xfunc.Func.Dcl, v)
body = list(body, Nod(OAS, v, cv))
x86.REG_AX, // for divide
x86.REG_CX, // for shift
- x86.REG_DX, // for divide
+ x86.REG_DX, // for divide, context
x86.REG_SP, // for stack
}
gins(x86.AMOVL, &flo, &tlo)
gins(x86.AMOVL, &fhi, &thi)
} else {
+ // Implementation of conversion-free x = y for int64 or uint64 x.
+ // This is generated by the code that copies small values out of closures,
+ // and that code has DX live, so avoid DX and use CX instead.
var r1 gc.Node
gc.Nodreg(&r1, gc.Types[gc.TUINT32], x86.REG_AX)
var r2 gc.Node
- gc.Nodreg(&r2, gc.Types[gc.TUINT32], x86.REG_DX)
+ gc.Nodreg(&r2, gc.Types[gc.TUINT32], x86.REG_CX)
gins(x86.AMOVL, &flo, &r1)
gins(x86.AMOVL, &fhi, &r2)
gins(x86.AMOVL, &r1, &tlo)