Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bench/asmgate/baseline.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 4 additions & 3 deletions checked_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions fast.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(&regs[uint8(i>>8)], r)
setFloat(&regs[uint8(i>>8)], math.Float64frombits(r))
} else {
e = exSlowOp
break dispatch
Expand Down
Loading