Commit 752fe4dc authored by Todd Neal's avatar Todd Neal

[dev.ssa] cmd/compile: support float zeroing

Change-Id: Iacd302350cf0a8a8164d937e5c4ac55e6a07d380
Reviewed-on: https://go-review.googlesource.com/13942Reviewed-by: default avatarDavid Chase <drchase@google.com>
parent ee50cb20
......@@ -1646,6 +1646,15 @@ func (s *state) zeroVal(t *Type) *ssa.Value {
default:
s.Fatalf("bad sized integer type %s", t)
}
case t.IsFloat():
switch t.Size() {
case 4:
return s.constFloat32(t, 0)
case 8:
return s.constFloat64(t, 0)
default:
s.Fatalf("bad sized float type %s", t)
}
case t.IsString():
return s.entryNewValue0A(ssa.OpConstString, t, "")
case t.IsPtr():
......
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