From a2a3fc7ef78f14a9a72258c055b3d71420f9e102 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Thu, 12 Dec 2024 16:53:08 -0800 Subject: [PATCH] Remove rint from jsmath library. NFC We also use `__builtin_rint` (which lowers to a single f64.nearest instruction) when compiling the musl version of rint.c so there there is no need to use a JS call for this case. --- system/lib/jsmath.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/system/lib/jsmath.c b/system/lib/jsmath.c index 87cbc9b3ce336..36bc9829db5e7 100644 --- a/system/lib/jsmath.c +++ b/system/lib/jsmath.c @@ -45,9 +45,3 @@ CALL_JS_2_TRIPLE(pow) CALL_JS_1_IMPL_TRIPLE(round, { return x >= 0 ? Math.floor(x + 0.5) : Math.ceil(x - 0.5); }) -CALL_JS_1_IMPL_TRIPLE(rint, { - function round(x) { - return x >= 0 ? Math.floor(x + 0.5) : Math.ceil(x - 0.5); - } - return (x - Math.floor(x) != .5) ? round(x) : round(x / 2) * 2; -})