Merge pull request #3525 from rtfeldman/3522

Num.toStr for f32, f64, Dec
This commit is contained in:
Richard Feldman 2022-07-13 21:30:05 -04:00 committed by GitHub
commit da7c7ac5f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 159 additions and 45 deletions

View file

@ -2029,15 +2029,15 @@ impl<'a> LowLevelCall<'a> {
FloatWidth::F32 => {
self.load_args(backend);
backend.code_builder.f64_promote_f32();
self.load_args_and_call_zig(backend, bitcode::STR_FROM_FLOAT);
self.load_args_and_call_zig(backend, &bitcode::STR_FROM_FLOAT[width]);
}
FloatWidth::F64 => {
self.load_args_and_call_zig(backend, bitcode::STR_FROM_FLOAT);
self.load_args_and_call_zig(backend, &bitcode::STR_FROM_FLOAT[width]);
}
FloatWidth::F128 => todo!("F128 to Str"),
},
Layout::Builtin(Builtin::Decimal) => {
todo!("Decimal to Str")
self.load_args_and_call_zig(backend, bitcode::DEC_TO_STR)
}
x => internal_error!("NumToStr is not defined for {:?}", x),
}