llgo/ssa: float Const fix; cl: replaceGoName runtime => llgo/internal/runtime

This commit is contained in:
xushiwei
2024-06-13 00:56:18 +08:00
parent 7dd740f51a
commit 18eecbe9f4
3 changed files with 1423 additions and 5 deletions

View File

@@ -194,9 +194,8 @@ func (b Builder) Const(v constant.Value, typ Type) Expr {
return prog.IntVal(v, typ)
}
case kind == types.Float32 || kind == types.Float64:
if v, exact := constant.Float64Val(v); exact {
return prog.FloatVal(v, typ)
}
v, _ := constant.Float64Val(v)
return prog.FloatVal(v, typ)
case kind == types.String:
return Expr{b.Str(constant.StringVal(v)).impl, typ}
}