Commit c244ce09 authored by Keith Randall's avatar Keith Randall

[dev.ssa] cmd/compile/internal/ssa: fix complex compares

It was using 64-bit float comparison ops for complex64.
It should use 32-bit float comparison.

Fixes build.

Change-Id: I6452b227257fecc09e04cd092ccf328d1fc9917f
Reviewed-on: https://go-review.googlesource.com/14497
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent db380bf4
......@@ -1477,7 +1477,7 @@ func (s *state) expr(n *Node) *ssa.Value {
a := s.expr(n.Left)
b := s.expr(n.Right)
if n.Left.Type.IsComplex() {
pt := floatForComplex(n.Type)
pt := floatForComplex(n.Left.Type)
op := s.ssaOp(OEQ, pt)
r := s.newValue2(op, Types[TBOOL], s.newValue1(ssa.OpComplexReal, pt, a), s.newValue1(ssa.OpComplexReal, pt, b))
i := s.newValue2(op, Types[TBOOL], s.newValue1(ssa.OpComplexImag, pt, a), s.newValue1(ssa.OpComplexImag, pt, b))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment