Correct f64 -> u128/i128 generation

This commit is contained in:
gingerBill
2021-09-25 15:38:56 +01:00
parent ebc09d5e4e
commit fa0d58f96e
4 changed files with 19 additions and 1 deletions
+14
View File
@@ -763,3 +763,17 @@ floattidf_unsigned :: proc(a: u128) -> f64 {
fb[1] = u32(a) // mantissa-low
return transmute(f64)fb
}
@(link_name="__fixunsdfti")
fixunsdfti :: proc(a: f64) -> u128 {
x := u64(a)
return u128(x)
}
@(link_name="__fixunsdfdi")
fixunsdfdi :: proc(a: f64) -> i128 {
x := i64(a)
return i128(x)
}