]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: add saturating conversions on wasm
authorRichard Musiol <mail@richard-musiol.de>
Sun, 24 Mar 2019 11:14:27 +0000 (12:14 +0100)
committerRichard Musiol <neelance@gmail.com>
Thu, 4 Apr 2019 16:10:12 +0000 (16:10 +0000)
commitcf8cc7f63c7ddefb666a6e8d99a4843d3277db9f
treeedc59cd956160ff6683a60e8848cacf841a20a3b
parent1abf3aa55bb8b346bb1575ac8db5022f215df65a
cmd/compile: add saturating conversions on wasm

This change adds the GOWASM option "satconv" to enable the generation
of experimental saturating (non-trapping) float-to-int conversions.
It improves the performance of the conversion by 42%.

Previously the conversions had already been augmented with helper
functions to have saturating behavior. Now Wasm.rules is always using
the new operation names and wasm/ssa.go is falling back to the helpers
if the feature is not enabled.

The feature is in phase 4 of the WebAssembly proposal process:
https://github.com/WebAssembly/meetings/blob/master/process/phases.md

More information on the feature can be found at:
https://github.com/WebAssembly/nontrapping-float-to-int-conversions/blob/master/proposals/nontrapping-float-to-int-conversion/Overview.md

Change-Id: Ic6c3688017054ede804b02b6b0ffd4a02ef33ad7
Reviewed-on: https://go-review.googlesource.com/c/go/+/170119
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
12 files changed:
doc/install-source.html
src/cmd/compile/internal/ssa/gen/Wasm.rules
src/cmd/compile/internal/ssa/gen/WasmOps.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewriteWasm.go
src/cmd/compile/internal/wasm/ssa.go
src/cmd/go/alldocs.go
src/cmd/go/internal/help/helpdoc.go
src/cmd/internal/obj/wasm/a.out.go
src/cmd/internal/obj/wasm/anames.go
src/cmd/internal/obj/wasm/wasmobj.go
src/cmd/internal/objabi/util.go