1
0
mirror of https://github.com/golang/go synced 2024-10-05 16:41:21 -06:00

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

Change-Id: Iacd302350cf0a8a8164d937e5c4ac55e6a07d380
Reviewed-on: https://go-review.googlesource.com/13942
Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
Todd Neal 2015-08-25 19:21:45 -05:00
parent ee50cb2061
commit 752fe4dcb5

View File

@ -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():