diff --git a/bench/asmgate/baseline.txt b/bench/asmgate/baseline.txt index 6003ce6..0d4a421 100644 --- a/bench/asmgate/baseline.txt +++ b/bench/asmgate/baseline.txt @@ -1,8 +1,8 @@ # Stack accesses per hot opcode in (*executor).fast, outside write-barrier slow paths. # Opcodes not listed must have none. Written by go run ./bench/asmgate -update. amd64-v1 head 1 -amd64-v1 opGetField 6 -amd64-v1 opGetTable,opGetIndex 3 +amd64-v1 opGetField 7 +amd64-v1 opGetTable,opGetIndex 2 amd64-v1 opJmp 3 amd64-v1 opSelf 1 amd64-v3 head 2 diff --git a/checked_gen.go b/checked_gen.go index 21b1580..3810d8e 100644 --- a/checked_gen.go +++ b/checked_gen.go @@ -612,13 +612,14 @@ dispatch: if m != 0 && (m^b) < 0 { // round towards minus infinity m += b } - r := float64(m) + // the result's bits, so that no float lives across the branch, which spills it + r := math.Float64bits(float64(m)) if m == 0 { // as fmod: a zero remainder keeps the dividend's sign, which is bit 63 of an // integer and of a float alike - r = math.Float64frombits(x.n & (1 << 63)) + r = x.n & (1 << 63) } - setFloat(®s[uint8(i>>8)], r) + setFloat(®s[uint8(i>>8)], math.Float64frombits(r)) } else { e = exSlowOp break dispatch diff --git a/fast.go b/fast.go index b236c55..fa5730a 100644 --- a/fast.go +++ b/fast.go @@ -723,13 +723,14 @@ dispatch: if m != 0 && (m^b) < 0 { // round towards minus infinity m += b } - r := float64(m) + // the result's bits, so that no float lives across the branch, which spills it + r := math.Float64bits(float64(m)) if m == 0 { // as fmod: a zero remainder keeps the dividend's sign, which is bit 63 of an // integer and of a float alike - r = math.Float64frombits(x.n & (1 << 63)) + r = x.n & (1 << 63) } - setFloat(®s[uint8(i>>8)], r) + setFloat(®s[uint8(i>>8)], math.Float64frombits(r)) } else { e = exSlowOp break dispatch