diff options
author | David Chase <drchase@google.com> | 2016-08-10 11:44:57 -0700 |
---|---|---|
committer | David Chase <drchase@google.com> | 2016-08-15 14:47:49 +0000 |
commit | d08010f94e06e5d5b6d01c248ba2a976b75d95a2 (patch) | |
tree | df74490d9fecdccb5f75f7786ffa19f892cdb5ed /src/cmd/compile/internal/gc/ssa.go | |
parent | d99cee79b98dfb6c1cd8e64c96845ee29aa28b4c (diff) | |
download | go-d08010f94e06e5d5b6d01c248ba2a976b75d95a2.tar.gz go-d08010f94e06e5d5b6d01c248ba2a976b75d95a2.zip |
[dev.ssa] cmd/compile: PPC64, FP to/from int conversions.dev.ssa
Passes ssa_test.
Requires a few new instructions and some scratchpad
memory to move data between G and F registers.
Also fixed comparisons to be correct in case of NaN.
Added missing instructions for run.bash.
Removed some FP registers that are apparently "reserved"
(but that are also apparently also unused except for a
gratuitous multiplication by two when y = x+x would work
just as well).
Currently failing stack splits.
Updates #16010.
Change-Id: I73b161bfff54445d72bd7b813b1479f89fc72602
Reviewed-on: https://go-review.googlesource.com/26813
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/compile/internal/gc/ssa.go')
-rw-r--r-- | src/cmd/compile/internal/gc/ssa.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index 2e7d45d543..997e972e0a 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -3953,8 +3953,9 @@ type SSAGenState struct { bstart []*obj.Prog // 387 port: maps from SSE registers (REG_X?) to 387 registers (REG_F?) - SSEto387 map[int16]int16 - Scratch387 *Node + SSEto387 map[int16]int16 + // Some architectures require a 64-bit temporary for FP-related register shuffling. Examples include x86-387, PPC, and Sparc V8. + ScratchFpMem *Node } // Pc returns the current Prog. @@ -3993,7 +3994,9 @@ func genssa(f *ssa.Func, ptxt *obj.Prog, gcargs, gclocals *Sym) { if Thearch.Use387 { s.SSEto387 = map[int16]int16{} - s.Scratch387 = temp(Types[TUINT64]) + } + if f.Config.NeedsFpScratch { + s.ScratchFpMem = temp(Types[TUINT64]) } // Emit basic blocks |