aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/gc/testdata
diff options
context:
space:
mode:
authorTodd Neal <todd@tneal.org>2015-09-01 21:25:24 -0500
committerTodd Neal <todd@tneal.org>2015-09-02 10:41:55 +0000
commit5cb352edeba36e862995dd82fe7312368e6e8571 (patch)
tree2c73946382a94134e17dc6d1b1d3753e773de31b /src/cmd/compile/internal/gc/testdata
parent634b50c6e138669d5518c0c02d3bfba79e1278ab (diff)
downloadgo-5cb352edeba36e862995dd82fe7312368e6e8571.tar.xz
[dev.ssa] cmd/compile: fix liblink rewrite of -0.0
liblink was rewriting xor by a negative zero (used by SSA for negation) as XORPS reg,reg. Fixes strconv. Change-Id: I627a0a7366618e6b07ba8f0ad0db0e102340c5e3 Reviewed-on: https://go-review.googlesource.com/14200 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/gc/testdata')
-rw-r--r--src/cmd/compile/internal/gc/testdata/fp_ssa.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/gc/testdata/fp_ssa.go b/src/cmd/compile/internal/gc/testdata/fp_ssa.go
index 6193983e4c..ee3163abb3 100644
--- a/src/cmd/compile/internal/gc/testdata/fp_ssa.go
+++ b/src/cmd/compile/internal/gc/testdata/fp_ssa.go
@@ -105,6 +105,12 @@ func div64_ssa(a, b float64) float64 {
return a / b
}
+func neg64_ssa(a, b float64) float64 {
+ switch {
+ }
+ return -a + -1*b
+}
+
func add32_ssa(a, b float32) float32 {
switch {
}
@@ -128,6 +134,12 @@ func div32_ssa(a, b float32) float32 {
return a / b
}
+func neg32_ssa(a, b float32) float32 {
+ switch {
+ }
+ return -a + -1*b
+}
+
func conv2Float64_ssa(a int8, b uint8, c int16, d uint16,
e int32, f uint32, g int64, h uint64, i float32) (aa, bb, cc, dd, ee, ff, gg, hh, ii float64) {
switch {
@@ -1548,11 +1560,13 @@ func main() {
fails += fail64("*", mul64_ssa, a, b, 12.0)
fails += fail64("-", sub64_ssa, a, b, -1.0)
fails += fail64("/", div64_ssa, a, b, 0.75)
+ fails += fail64("neg", neg64_ssa, a, b, -7)
fails += fail32("+", add32_ssa, c, d, 7.0)
fails += fail32("*", mul32_ssa, c, d, 12.0)
fails += fail32("-", sub32_ssa, c, d, -1.0)
fails += fail32("/", div32_ssa, c, d, 0.75)
+ fails += fail32("neg", neg32_ssa, c, d, -7)
// denorm-squared should underflow to zero.
fails += fail32("*", mul32_ssa, tiny, tiny, 0)