about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbeetrees <b@beetr.ee>2025-05-24 13:45:12 +0100
committerbeetrees <b@beetr.ee>2025-05-24 13:45:12 +0100
commitf0fb19ccc87e18402079fbe3106d8090cc8d9f64 (patch)
tree4cbb0edd9e822ed1d14b4ac1770e58569784a220
parentdcd3168c97c6024b24f80abbb2407c81d9b0a25a (diff)
downloadrust-f0fb19ccc87e18402079fbe3106d8090cc8d9f64.tar.gz
rust-f0fb19ccc87e18402079fbe3106d8090cc8d9f64.zip
Add missing float libcalls to `compiler_builtins.rs`
-rw-r--r--src/compiler_builtins.rs36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/compiler_builtins.rs b/src/compiler_builtins.rs
index 5b6d0ef6ddf..8886317c12b 100644
--- a/src/compiler_builtins.rs
+++ b/src/compiler_builtins.rs
@@ -46,15 +46,49 @@ builtin_functions! {
     fn __rust_u128_mulo(a: u128, b: u128, oflow: &mut i32) -> u128;
     fn __rust_i128_mulo(a: i128, b: i128, oflow: &mut i32) -> i128;
 
-    // floats
+    // integer -> float
     fn __floattisf(i: i128) -> f32;
     fn __floattidf(i: i128) -> f64;
     fn __floatuntisf(i: u128) -> f32;
     fn __floatuntidf(i: u128) -> f64;
+    // float -> integer
     fn __fixsfti(f: f32) -> i128;
     fn __fixdfti(f: f64) -> i128;
     fn __fixunssfti(f: f32) -> u128;
     fn __fixunsdfti(f: f64) -> u128;
+    // float binops
+    fn fmodf(a: f32, b: f32) -> f32;
+    fn fmod(a: f64, b: f64) -> f64;
+    // Cranelift float libcalls
+    fn fmaf(a: f32, b: f32, c: f32) -> f32;
+    fn fma(a: f64, b: f64, c: f64) -> f64;
+    fn floorf(f: f32) -> f32;
+    fn floor(f: f64) -> f64;
+    fn ceilf(f: f32) -> f32;
+    fn ceil(f: f64) -> f64;
+    fn truncf(f: f32) -> f32;
+    fn trunc(f: f64) -> f64;
+    fn nearbyintf(f: f32) -> f32;
+    fn nearbyint(f: f64) -> f64;
+    // float intrinsics
+    fn __powisf2(a: f32, b: i32) -> f32;
+    fn __powidf2(a: f64, b: i32) -> f64;
+    fn powf(a: f32, b: f32) -> f32;
+    fn pow(a: f64, b: f64) -> f64;
+    fn expf(f: f32) -> f32;
+    fn exp(f: f64) -> f64;
+    fn exp2f(f: f32) -> f32;
+    fn exp2(f: f64) -> f64;
+    fn logf(f: f32) -> f32;
+    fn log(f: f64) -> f64;
+    fn log2f(f: f32) -> f32;
+    fn log2(f: f64) -> f64;
+    fn log10f(f: f32) -> f32;
+    fn log10(f: f64) -> f64;
+    fn sinf(f: f32) -> f32;
+    fn sin(f: f64) -> f64;
+    fn cosf(f: f32) -> f32;
+    fn cos(f: f64) -> f64;
 
     // allocator
     // NOTE: These need to be mentioned here despite not being part of compiler_builtins because