Skip to content

Commit 694c00c

Browse files
zygoloidgoogle-labs-jules[bot]CarbonInfraBot
authored
Make Core.Float a class. Add missing builtins for float support. (#5932)
Add missing builtins for float compound assignment, for building a FloatType, and for converting a float literal to FloatType. Switch `Core.Float` to being a class and add impls for the various floating-point operators. --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Carbon Infra Bot <[email protected]>
1 parent f616817 commit 694c00c

File tree

66 files changed

+2158
-583
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+2158
-583
lines changed

core/prelude/types.carbon

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ export import library "prelude/types/int";
1010
export import library "prelude/types/int_literal";
1111
export import library "prelude/types/optional";
1212
export import library "prelude/types/uint";
13-
14-
fn Float(size: IntLiteral()) -> type = "float.make_type";
13+
export import library "prelude/types/float";

core/prelude/types/float.carbon

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
2+
// Exceptions. See /LICENSE for license information.
3+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
5+
package Core library "prelude/types/float";
6+
7+
import library "prelude/destroy";
8+
import library "prelude/operators";
9+
import library "prelude/types/float_literal";
10+
import library "prelude/types/int_literal";
11+
12+
private fn MakeFloat(size: IntLiteral()) -> type = "float.make_type";
13+
14+
class Float(N:! IntLiteral()) {
15+
adapt MakeFloat(N);
16+
}
17+
18+
// Conversions.
19+
// TODO: Support mixed-size conversions.
20+
// TODO: Support int-to-float conversions.
21+
impl forall [N:! IntLiteral()] FloatLiteral() as ImplicitAs(Float(N)) {
22+
fn Convert[self: Self]() -> Float(N) = "float.convert_checked";
23+
}
24+
25+
// TODO: Remove this once ImplicitAs extends As.
26+
impl forall [N:! IntLiteral()] FloatLiteral() as As(Float(N)) {
27+
fn Convert[self: Self]() -> Float(N) = "float.convert_checked";
28+
}
29+
30+
// Comparisons.
31+
// TODO: Support mixed-type comparisons.
32+
final impl forall [N:! IntLiteral()] Float(N) as EqWith(Float(N)) {
33+
fn Equal[self: Self](other: Float(N)) -> bool = "float.eq";
34+
fn NotEqual[self: Self](other: Float(N)) -> bool = "float.neq";
35+
}
36+
37+
final impl forall [N:! IntLiteral()] Float(N) as OrderedWith(Float(N)) {
38+
fn Less[self: Self](other: Float(N)) -> bool = "float.less";
39+
fn LessOrEquivalent[self: Self](other: Float(N)) -> bool = "float.less_eq";
40+
fn Greater[self: Self](other: Float(N)) -> bool = "float.greater";
41+
fn GreaterOrEquivalent[self: Self](other: Float(N)) -> bool = "float.greater_eq";
42+
}
43+
44+
// Arithmetic.
45+
final impl forall [N:! IntLiteral()]
46+
Float(N) as AddWith(Self) where .Result = Self {
47+
fn Op[self: Self](other: Self) -> Self = "float.add";
48+
}
49+
50+
final impl forall [N:! IntLiteral()]
51+
Float(N) as DivWith(Self) where .Result = Self {
52+
fn Op[self: Self](other: Self) -> Self = "float.div";
53+
}
54+
55+
final impl forall [N:! IntLiteral()]
56+
Float(N) as MulWith(Self) where .Result = Self {
57+
fn Op[self: Self](other: Self) -> Self = "float.mul";
58+
}
59+
60+
final impl forall [N:! IntLiteral()]
61+
Float(N) as Negate where .Result = Self {
62+
fn Op[self: Self]() -> Self = "float.negate";
63+
}
64+
65+
final impl forall [N:! IntLiteral()]
66+
Float(N) as SubWith(Self) where .Result = Self {
67+
fn Op[self: Self](other: Self) -> Self = "float.sub";
68+
}
69+
70+
// Compound assignments.
71+
final impl forall [N:! IntLiteral()]
72+
Float(N) as AddAssignWith(Self) {
73+
fn Op[addr self: Self*](other: Self) = "float.add_assign";
74+
}
75+
76+
final impl forall [N:! IntLiteral()]
77+
Float(N) as DivAssignWith(Self) {
78+
fn Op[addr self: Self*](other: Self) = "float.div_assign";
79+
}
80+
81+
final impl forall [N:! IntLiteral()]
82+
Float(N) as MulAssignWith(Self) {
83+
fn Op[addr self: Self*](other: Self) = "float.mul_assign";
84+
}
85+
86+
final impl forall [N:! IntLiteral()]
87+
Float(N) as SubAssignWith(Self) {
88+
fn Op[addr self: Self*](other: Self) = "float.sub_assign";
89+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
2+
// Exceptions. See /LICENSE for license information.
3+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
5+
package Core library "prelude/types/float_literal";
6+
7+
fn FloatLiteral() -> type = "float_literal.make_type";

toolchain/check/eval.cpp

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,20 @@ static auto MakeIntTypeResult(Context& context, SemIR::LocId loc_id,
997997
return MakeConstantResult(context, result, phase);
998998
}
999999

1000+
// Forms a constant float type as an evaluation result. Requires that width_id
1001+
// is constant.
1002+
static auto MakeFloatTypeResult(Context& context, SemIR::LocId loc_id,
1003+
SemIR::InstId width_id, Phase phase)
1004+
-> SemIR::ConstantId {
1005+
auto result = SemIR::FloatType{
1006+
.type_id = GetSingletonType(context, SemIR::TypeType::TypeInstId),
1007+
.bit_width_id = width_id};
1008+
if (!ValidateFloatType(context, loc_id, result)) {
1009+
return SemIR::ErrorInst::ConstantId;
1010+
}
1011+
return MakeConstantResult(context, result, phase);
1012+
}
1013+
10001014
// Performs a conversion between integer types, truncating if the value doesn't
10011015
// fit in the destination type.
10021016
static auto PerformIntConvert(Context& context, SemIR::InstId arg_id,
@@ -1556,6 +1570,10 @@ static auto MakeConstantForBuiltinCall(EvalContext& eval_context,
15561570
case SemIR::BuiltinFunctionKind::PrintChar:
15571571
case SemIR::BuiltinFunctionKind::PrintInt:
15581572
case SemIR::BuiltinFunctionKind::ReadChar:
1573+
case SemIR::BuiltinFunctionKind::FloatAddAssign:
1574+
case SemIR::BuiltinFunctionKind::FloatSubAssign:
1575+
case SemIR::BuiltinFunctionKind::FloatMulAssign:
1576+
case SemIR::BuiltinFunctionKind::FloatDivAssign:
15591577
case SemIR::BuiltinFunctionKind::IntSAddAssign:
15601578
case SemIR::BuiltinFunctionKind::IntSSubAssign:
15611579
case SemIR::BuiltinFunctionKind::IntSMulAssign:
@@ -1625,6 +1643,10 @@ static auto MakeConstantForBuiltinCall(EvalContext& eval_context,
16251643
return context.constant_values().Get(SemIR::CharLiteralType::TypeInstId);
16261644
}
16271645

1646+
case SemIR::BuiltinFunctionKind::FloatLiteralMakeType: {
1647+
return context.constant_values().Get(SemIR::LegacyFloatType::TypeInstId);
1648+
}
1649+
16281650
case SemIR::BuiltinFunctionKind::IntLiteralMakeType: {
16291651
return context.constant_values().Get(SemIR::IntLiteralType::TypeInstId);
16301652
}
@@ -1640,14 +1662,7 @@ static auto MakeConstantForBuiltinCall(EvalContext& eval_context,
16401662
}
16411663

16421664
case SemIR::BuiltinFunctionKind::FloatMakeType: {
1643-
// TODO: Support a symbolic constant width.
1644-
if (phase != Phase::Concrete) {
1645-
break;
1646-
}
1647-
if (!ValidateFloatBitWidth(context, loc_id, arg_ids[0])) {
1648-
return SemIR::ErrorInst::ConstantId;
1649-
}
1650-
return context.constant_values().Get(SemIR::LegacyFloatType::TypeInstId);
1665+
return MakeFloatTypeResult(context, loc_id, arg_ids[0], phase);
16511666
}
16521667

16531668
case SemIR::BuiltinFunctionKind::BoolMakeType: {
@@ -1734,6 +1749,13 @@ static auto MakeConstantForBuiltinCall(EvalContext& eval_context,
17341749
arg_ids[1], call.type_id);
17351750
}
17361751

1752+
// Floating-point conversions.
1753+
case SemIR::BuiltinFunctionKind::FloatConvertChecked: {
1754+
// TODO: Perform a conversion if necessary. For now, all FloatValues are
1755+
// represented as double-precision APFloats, so no conversion is needed.
1756+
return context.constant_values().Get(arg_ids[0]);
1757+
}
1758+
17371759
// Unary float -> float operations.
17381760
case SemIR::BuiltinFunctionKind::FloatNegate: {
17391761
if (phase != Phase::Concrete) {

toolchain/check/handle_literal.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,6 @@ auto HandleParseNode(Context& context, Parse::UnsignedIntTypeLiteralId node_id)
152152

153153
auto HandleParseNode(Context& context, Parse::FloatTypeLiteralId node_id)
154154
-> bool {
155-
auto text =
156-
context.tokens().GetTokenText(context.parse_tree().node_token(node_id));
157-
if (text != "f64") {
158-
return context.TODO(node_id, "Currently only f64 is allowed");
159-
}
160155
auto tok_id = context.parse_tree().node_token(node_id);
161156
auto size_id = context.tokens().GetTypeLiteralSize(tok_id);
162157
auto type_inst_id =

toolchain/check/import_ref.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1828,6 +1828,19 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver,
18281828
.index = inst.index});
18291829
}
18301830

1831+
static auto TryResolveTypedInst(ImportRefResolver& resolver,
1832+
SemIR::FloatType inst) -> ResolveResult {
1833+
CARBON_CHECK(inst.type_id == SemIR::TypeType::TypeId);
1834+
auto bit_width_id = GetLocalConstantInstId(resolver, inst.bit_width_id);
1835+
if (resolver.HasNewWork()) {
1836+
return ResolveResult::Retry();
1837+
}
1838+
1839+
return ResolveAsDeduplicated<SemIR::FloatType>(
1840+
resolver,
1841+
{.type_id = SemIR::TypeType::TypeId, .bit_width_id = bit_width_id});
1842+
}
1843+
18311844
// Make a declaration of a function. This is done as a separate step from
18321845
// importing the function declaration in order to resolve cycles.
18331846
static auto MakeFunctionDecl(ImportContext& context,
@@ -3031,6 +3044,9 @@ static auto TryResolveInstCanonical(ImportRefResolver& resolver,
30313044
case CARBON_KIND(SemIR::FieldDecl inst): {
30323045
return TryResolveTypedInst(resolver, inst, inst_id);
30333046
}
3047+
case CARBON_KIND(SemIR::FloatType inst): {
3048+
return TryResolveTypedInst(resolver, inst);
3049+
}
30343050
case CARBON_KIND(SemIR::FunctionDecl inst): {
30353051
return TryResolveTypedInst(resolver, inst, const_id);
30363052
}

toolchain/check/testdata/basics/numeric_literals.carbon

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ let e: f64 = 5.0e39999999999999999993;
9595
// CHECK:STDOUT: %int_8.b85: Core.IntLiteral = int_value 8 [concrete]
9696
// CHECK:STDOUT: %int_9.988: Core.IntLiteral = int_value 9 [concrete]
9797
// CHECK:STDOUT: %int_2147483647.d89: Core.IntLiteral = int_value 2147483647 [concrete]
98-
// CHECK:STDOUT: %float.2c5: f64 = float_value 0.90000000000000002 [concrete]
99-
// CHECK:STDOUT: %float.613: f64 = float_value 8 [concrete]
100-
// CHECK:STDOUT: %float.707: f64 = float_value 80 [concrete]
101-
// CHECK:STDOUT: %float.213: f64 = float_value 1.0E+7 [concrete]
102-
// CHECK:STDOUT: %float.577: f64 = float_value 1.0E+8 [concrete]
103-
// CHECK:STDOUT: %float.ef9: f64 = float_value 1.0E-8 [concrete]
98+
// CHECK:STDOUT: %float.8ca: Core.FloatLiteral = float_value 0.90000000000000002 [concrete]
99+
// CHECK:STDOUT: %float.fde: Core.FloatLiteral = float_value 8 [concrete]
100+
// CHECK:STDOUT: %float.7a6: Core.FloatLiteral = float_value 80 [concrete]
101+
// CHECK:STDOUT: %float.23b: Core.FloatLiteral = float_value 1.0E+7 [concrete]
102+
// CHECK:STDOUT: %float.b98: Core.FloatLiteral = float_value 1.0E+8 [concrete]
103+
// CHECK:STDOUT: %float.34d: Core.FloatLiteral = float_value 1.0E-8 [concrete]
104104
// CHECK:STDOUT: }
105105
// CHECK:STDOUT:
106106
// CHECK:STDOUT: imports {
@@ -116,12 +116,12 @@ let e: f64 = 5.0e39999999999999999993;
116116
// CHECK:STDOUT: %int_2147483647.loc13: Core.IntLiteral = int_value 2147483647 [concrete = constants.%int_2147483647.d89]
117117
// CHECK:STDOUT: %int_2147483647.loc14: Core.IntLiteral = int_value 2147483647 [concrete = constants.%int_2147483647.d89]
118118
// CHECK:STDOUT: <elided>
119-
// CHECK:STDOUT: %float.loc19: f64 = float_value 0.90000000000000002 [concrete = constants.%float.2c5]
120-
// CHECK:STDOUT: %float.loc20: f64 = float_value 8 [concrete = constants.%float.613]
121-
// CHECK:STDOUT: %float.loc21: f64 = float_value 80 [concrete = constants.%float.707]
122-
// CHECK:STDOUT: %float.loc22: f64 = float_value 1.0E+7 [concrete = constants.%float.213]
123-
// CHECK:STDOUT: %float.loc23: f64 = float_value 1.0E+8 [concrete = constants.%float.577]
124-
// CHECK:STDOUT: %float.loc24: f64 = float_value 1.0E-8 [concrete = constants.%float.ef9]
119+
// CHECK:STDOUT: %float.loc19: Core.FloatLiteral = float_value 0.90000000000000002 [concrete = constants.%float.8ca]
120+
// CHECK:STDOUT: %float.loc20: Core.FloatLiteral = float_value 8 [concrete = constants.%float.fde]
121+
// CHECK:STDOUT: %float.loc21: Core.FloatLiteral = float_value 80 [concrete = constants.%float.7a6]
122+
// CHECK:STDOUT: %float.loc22: Core.FloatLiteral = float_value 1.0E+7 [concrete = constants.%float.23b]
123+
// CHECK:STDOUT: %float.loc23: Core.FloatLiteral = float_value 1.0E+8 [concrete = constants.%float.b98]
124+
// CHECK:STDOUT: %float.loc24: Core.FloatLiteral = float_value 1.0E-8 [concrete = constants.%float.34d]
125125
// CHECK:STDOUT: <elided>
126126
// CHECK:STDOUT: }
127127
// CHECK:STDOUT:

toolchain/check/testdata/basics/type_literals.carbon

Lines changed: 59 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,33 @@ library "[[@TEST_NAME]]";
3737
var test_f64: f64;
3838
//@dump-sem-ir-end
3939

40-
// --- fail_fN_todo_unsupported.carbon
40+
// --- fail_todo_fN_unsupported.carbon
4141
library "[[@TEST_NAME]]";
4242

4343
// TODO: Some or all of these should eventually work.
44-
// CHECK:STDERR: fail_fN_todo_unsupported.carbon:[[@LINE+4]]:15: error: semantics TODO: `Currently only f64 is allowed` [SemanticsTodo]
44+
// CHECK:STDERR: min_prelude/parts/float.carbon:11:9: error: bit width must be 64 [CompileTimeFloatBitWidth]
45+
// CHECK:STDERR: adapt MakeFloat(N);
46+
// CHECK:STDERR: ^~~~~~~~~~~~
47+
// CHECK:STDERR: fail_todo_fN_unsupported.carbon:[[@LINE+4]]:15: note: in `f16` used here [ResolvingSpecificHere]
4548
// CHECK:STDERR: var test_f16: f16;
4649
// CHECK:STDERR: ^~~
4750
// CHECK:STDERR:
4851
var test_f16: f16;
52+
// CHECK:STDERR: min_prelude/parts/float.carbon:11:9: error: bit width must be 64 [CompileTimeFloatBitWidth]
53+
// CHECK:STDERR: adapt MakeFloat(N);
54+
// CHECK:STDERR: ^~~~~~~~~~~~
55+
// CHECK:STDERR: fail_todo_fN_unsupported.carbon:[[@LINE+4]]:15: note: in `f32` used here [ResolvingSpecificHere]
56+
// CHECK:STDERR: var test_f32: f32;
57+
// CHECK:STDERR: ^~~
58+
// CHECK:STDERR:
4959
var test_f32: f32;
60+
// CHECK:STDERR: min_prelude/parts/float.carbon:11:9: error: bit width must be 64 [CompileTimeFloatBitWidth]
61+
// CHECK:STDERR: adapt MakeFloat(N);
62+
// CHECK:STDERR: ^~~~~~~~~~~~
63+
// CHECK:STDERR: fail_todo_fN_unsupported.carbon:[[@LINE+4]]:16: note: in `f128` used here [ResolvingSpecificHere]
64+
// CHECK:STDERR: var test_f128: f128;
65+
// CHECK:STDERR: ^~~~
66+
// CHECK:STDERR:
5067
var test_f128: f128;
5168

5269
// --- string.carbon
@@ -147,14 +164,45 @@ library "[[@TEST_NAME]]";
147164
// CHECK:STDERR: ^~
148165
// CHECK:STDERR:
149166
var test_f0: f0;
150-
// CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:14: error: semantics TODO: `Currently only f64 is allowed` [SemanticsTodo]
167+
// CHECK:STDERR: min_prelude/parts/float.carbon:11:9: error: bit width must be 64 [CompileTimeFloatBitWidth]
168+
// CHECK:STDERR: adapt MakeFloat(N);
169+
// CHECK:STDERR: ^~~~~~~~~~~~
170+
// CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:14: note: in `f1` used here [ResolvingSpecificHere]
151171
// CHECK:STDERR: var test_f1: f1;
152172
// CHECK:STDERR: ^~
153173
// CHECK:STDERR:
154174
var test_f1: f1;
175+
// CHECK:STDERR: min_prelude/parts/float.carbon:11:9: error: bit width must be 64 [CompileTimeFloatBitWidth]
176+
// CHECK:STDERR: adapt MakeFloat(N);
177+
// CHECK:STDERR: ^~~~~~~~~~~~
178+
// CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:15: note: in `f15` used here [ResolvingSpecificHere]
179+
// CHECK:STDERR: var test_f15: f15;
180+
// CHECK:STDERR: ^~~
181+
// CHECK:STDERR:
155182
var test_f15: f15;
183+
// CHECK:STDERR: min_prelude/parts/float.carbon:11:9: error: bit width must be 64 [CompileTimeFloatBitWidth]
184+
// CHECK:STDERR: adapt MakeFloat(N);
185+
// CHECK:STDERR: ^~~~~~~~~~~~
186+
// CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:16: note: in `f100` used here [ResolvingSpecificHere]
187+
// CHECK:STDERR: var test_f100: f100;
188+
// CHECK:STDERR: ^~~~
189+
// CHECK:STDERR:
156190
var test_f100: f100;
191+
// CHECK:STDERR: min_prelude/parts/float.carbon:11:9: error: bit width must be 64 [CompileTimeFloatBitWidth]
192+
// CHECK:STDERR: adapt MakeFloat(N);
193+
// CHECK:STDERR: ^~~~~~~~~~~~
194+
// CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:23: note: in `f1000000000` used here [ResolvingSpecificHere]
195+
// CHECK:STDERR: var test_f1000000000: f1000000000;
196+
// CHECK:STDERR: ^~~~~~~~~~~
197+
// CHECK:STDERR:
157198
var test_f1000000000: f1000000000;
199+
// CHECK:STDERR: min_prelude/parts/float.carbon:11:9: error: bit width must be 64 [CompileTimeFloatBitWidth]
200+
// CHECK:STDERR: adapt MakeFloat(N);
201+
// CHECK:STDERR: ^~~~~~~~~~~~
202+
// CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:26: note: in `f1000000000000` used here [ResolvingSpecificHere]
203+
// CHECK:STDERR: var test_f1000000000000: f1000000000000;
204+
// CHECK:STDERR: ^~~~~~~~~~~~~~
205+
// CHECK:STDERR:
158206
var test_f1000000000000: f1000000000000;
159207

160208
// --- fail_non_type_as_type.carbon
@@ -300,27 +348,24 @@ var x: type = 42;
300348
// CHECK:STDOUT:
301349
// CHECK:STDOUT: constants {
302350
// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete]
303-
// CHECK:STDOUT: %Float.type: type = fn_type @Float [concrete]
304-
// CHECK:STDOUT: %Float: %Float.type = struct_value () [concrete]
305-
// CHECK:STDOUT: %pattern_type.3de: type = pattern_type f64 [concrete]
351+
// CHECK:STDOUT: %f64.d77: type = class_type @Float, @Float(%int_64) [concrete]
352+
// CHECK:STDOUT: %pattern_type.0ae: type = pattern_type %f64.d77 [concrete]
306353
// CHECK:STDOUT: }
307354
// CHECK:STDOUT:
308355
// CHECK:STDOUT: imports {
309356
// CHECK:STDOUT: }
310357
// CHECK:STDOUT:
311358
// CHECK:STDOUT: file {
312359
// CHECK:STDOUT: name_binding_decl {
313-
// CHECK:STDOUT: %test_f64.patt: %pattern_type.3de = binding_pattern test_f64 [concrete]
314-
// CHECK:STDOUT: %test_f64.var_patt: %pattern_type.3de = var_pattern %test_f64.patt [concrete]
360+
// CHECK:STDOUT: %test_f64.patt: %pattern_type.0ae = binding_pattern test_f64 [concrete]
361+
// CHECK:STDOUT: %test_f64.var_patt: %pattern_type.0ae = var_pattern %test_f64.patt [concrete]
315362
// CHECK:STDOUT: }
316-
// CHECK:STDOUT: %test_f64.var: ref f64 = var %test_f64.var_patt [concrete]
317-
// CHECK:STDOUT: %.loc4_15.1: type = splice_block %.loc4_15.3 [concrete = f64] {
363+
// CHECK:STDOUT: %test_f64.var: ref %f64.d77 = var %test_f64.var_patt [concrete]
364+
// CHECK:STDOUT: %.loc4: type = splice_block %f64 [concrete = constants.%f64.d77] {
318365
// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
319-
// CHECK:STDOUT: %Float.call: init type = call constants.%Float(%int_64) [concrete = f64]
320-
// CHECK:STDOUT: %.loc4_15.2: type = value_of_initializer %Float.call [concrete = f64]
321-
// CHECK:STDOUT: %.loc4_15.3: type = converted %Float.call, %.loc4_15.2 [concrete = f64]
366+
// CHECK:STDOUT: %f64: type = class_type @Float, @Float(constants.%int_64) [concrete = constants.%f64.d77]
322367
// CHECK:STDOUT: }
323-
// CHECK:STDOUT: %test_f64: ref f64 = bind_name test_f64, %test_f64.var [concrete = %test_f64.var]
368+
// CHECK:STDOUT: %test_f64: ref %f64.d77 = bind_name test_f64, %test_f64.var [concrete = %test_f64.var]
324369
// CHECK:STDOUT: }
325370
// CHECK:STDOUT:
326371
// CHECK:STDOUT: --- string.carbon

0 commit comments

Comments
 (0)