]> Cypherpunks repositories - gostls13.git/commit
[dev.ssa] cmd/compile: add complex arithmetic
authorDavid Chase <drchase@google.com>
Fri, 28 Aug 2015 18:24:10 +0000 (14:24 -0400)
committerDavid Chase <drchase@google.com>
Tue, 1 Sep 2015 17:47:58 +0000 (17:47 +0000)
commit3a9d0ac3c807de9c6b91a91fa1e37f75da1941a8
treeb048779c9bebb444857a841e6a480e681b6d1c2b
parent65677cabfd3a348e1a5b8deca556cf80b998efca
[dev.ssa] cmd/compile: add complex arithmetic

Still to do:
details, more testing corner cases. (e.g. negative zero)
Includes small cleanups for previous CL.

Note: complex division is currently done in the runtime,
so the division code here is apparently not yet necessary
and also not tested.  Seems likely better to open code
division and expose the widening/narrowing to optimization.

Complex64 multiplication and division is done in wide
format to avoid cancellation errors; for division, this
also happens to be compatible with pre-SSA practice
(which uses a single complex128 division function).

It would-be-nice to widen for complex128 multiplication
intermediates as well, but that is trickier to implement
without a handy wider-precision format.

Change-Id: I595a4300f68868fb7641852a54674c6b2b78855e
Reviewed-on: https://go-review.googlesource.com/14028
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/gc/testdata/fp_ssa.go
src/cmd/compile/internal/ssa/decompose.go
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/gen/AMD64Ops.go
src/cmd/compile/internal/ssa/gen/genericOps.go
src/cmd/compile/internal/ssa/gen/rulegen.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewriteAMD64.go
src/cmd/compile/internal/ssa/rewritegeneric.go