diff -urp webkitgtk-2.46.0.orig/Source/JavaScriptCore/runtime/MathCommon.cpp webkitgtk-2.46.0/Source/JavaScriptCore/runtime/MathCommon.cpp
--- webkitgtk-2.46.0.orig/Source/JavaScriptCore/runtime/MathCommon.cpp	2024-08-19 01:28:35.815380600 -0500
+++ webkitgtk-2.46.0/Source/JavaScriptCore/runtime/MathCommon.cpp	2024-10-04 11:04:26.482195956 -0500
@@ -635,11 +635,6 @@ JSC_DEFINE_NOEXCEPT_JIT_OPERATION(f64_ne
     return std::nearbyint(operand);
 }
 
-JSC_DEFINE_NOEXCEPT_JIT_OPERATION(f32_roundeven, float, (float operand)) { return roundevenf(operand); }
-JSC_DEFINE_NOEXCEPT_JIT_OPERATION(f64_roundeven, double, (double operand)) { return roundeven(operand); }
-JSC_DEFINE_NOEXCEPT_JIT_OPERATION(f32_trunc, float, (float operand)) { return std::trunc(operand); }
-JSC_DEFINE_NOEXCEPT_JIT_OPERATION(f64_trunc, double, (double operand)) { return std::trunc(operand); }
-
 JSC_DEFINE_NOEXCEPT_JIT_OPERATION(i32_div_s, int32_t, (int32_t a, int32_t b)) { return a / b; }
 JSC_DEFINE_NOEXCEPT_JIT_OPERATION(i32_div_u, uint32_t, (uint32_t a, uint32_t b)) { return a / b; }
 JSC_DEFINE_NOEXCEPT_JIT_OPERATION(i32_rem_s, int32_t, (int32_t a, int32_t b)) { return a % b; }
diff -urp webkitgtk-2.46.0.orig/Source/JavaScriptCore/runtime/MathCommon.h webkitgtk-2.46.0/Source/JavaScriptCore/runtime/MathCommon.h
--- webkitgtk-2.46.0.orig/Source/JavaScriptCore/runtime/MathCommon.h	2024-08-19 01:28:35.815380600 -0500
+++ webkitgtk-2.46.0/Source/JavaScriptCore/runtime/MathCommon.h	2024-10-04 11:04:26.482195956 -0500
@@ -378,10 +378,6 @@ JSC_DECLARE_NOEXCEPT_JIT_OPERATION(round
 
 JSC_DECLARE_NOEXCEPT_JIT_OPERATION(f32_nearest, float, (float));
 JSC_DECLARE_NOEXCEPT_JIT_OPERATION(f64_nearest, double, (double));
-JSC_DECLARE_NOEXCEPT_JIT_OPERATION(f32_roundeven, float, (float));
-JSC_DECLARE_NOEXCEPT_JIT_OPERATION(f64_roundeven, double, (double));
-JSC_DECLARE_NOEXCEPT_JIT_OPERATION(f32_trunc, float, (float));
-JSC_DECLARE_NOEXCEPT_JIT_OPERATION(f64_trunc, double, (double));
 
 JSC_DECLARE_NOEXCEPT_JIT_OPERATION(i32_div_s, int32_t, (int32_t, int32_t));
 JSC_DECLARE_NOEXCEPT_JIT_OPERATION(i32_div_u, uint32_t, (uint32_t, uint32_t));
diff -urp webkitgtk-2.46.0.orig/Source/JavaScriptCore/wasm/WasmOMGIRGenerator32_64.cpp webkitgtk-2.46.0/Source/JavaScriptCore/wasm/WasmOMGIRGenerator32_64.cpp
--- webkitgtk-2.46.0.orig/Source/JavaScriptCore/wasm/WasmOMGIRGenerator32_64.cpp	2024-08-19 01:28:35.871379000 -0500
+++ webkitgtk-2.46.0/Source/JavaScriptCore/wasm/WasmOMGIRGenerator32_64.cpp	2024-10-04 11:04:26.485529339 -0500
@@ -5579,36 +5579,52 @@ auto OMGIRGenerator::addF32ConvertUI64(E
 auto OMGIRGenerator::addF64Nearest(ExpressionType argVar, ExpressionType& result) -> PartialResult
 {
     Value* arg = get(argVar);
-    Value* callee = m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction<OperationPtrTag>(Math::f64_roundeven));
-    Value* call = m_currentBlock->appendNew<CCallValue>(m_proc, B3::Double, origin(), callee, arg);
-    result = push(call);
+    PatchpointValue* patchpoint = m_currentBlock->appendNew<PatchpointValue>(m_proc, Double, origin());
+    patchpoint->append(arg, ValueRep::SomeRegister);
+    patchpoint->setGenerator([=] (CCallHelpers& jit, const StackmapGenerationParams& params) {
+        jit.roundTowardNearestIntDouble(params[1].fpr(), params[0].fpr());
+    });
+    patchpoint->effects = Effects::none();
+    result = push(patchpoint);
     return { };
 }
 
 auto OMGIRGenerator::addF32Nearest(ExpressionType argVar, ExpressionType& result) -> PartialResult
 {
     Value* arg = get(argVar);
-    Value* callee = m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction<OperationPtrTag>(Math::f32_roundeven));
-    Value* call = m_currentBlock->appendNew<CCallValue>(m_proc, B3::Float, origin(), callee, arg);
-    result = push(call);
+    PatchpointValue* patchpoint = m_currentBlock->appendNew<PatchpointValue>(m_proc, Float, origin());
+    patchpoint->append(arg, ValueRep::SomeRegister);
+    patchpoint->setGenerator([=] (CCallHelpers& jit, const StackmapGenerationParams& params) {
+        jit.roundTowardNearestIntFloat(params[1].fpr(), params[0].fpr());
+    });
+    patchpoint->effects = Effects::none();
+    result = push(patchpoint);
     return { };
 }
 
 auto OMGIRGenerator::addF64Trunc(ExpressionType argVar, ExpressionType& result) -> PartialResult
 {
     Value* arg = get(argVar);
-    Value* callee = m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction<OperationPtrTag>(Math::f64_trunc));
-    Value* call = m_currentBlock->appendNew<CCallValue>(m_proc, B3::Double, origin(), callee, arg);
-    result = push(call);
+    PatchpointValue* patchpoint = m_currentBlock->appendNew<PatchpointValue>(m_proc, Double, origin());
+    patchpoint->append(arg, ValueRep::SomeRegister);
+    patchpoint->setGenerator([=] (CCallHelpers& jit, const StackmapGenerationParams& params) {
+        jit.roundTowardZeroDouble(params[1].fpr(), params[0].fpr());
+    });
+    patchpoint->effects = Effects::none();
+    result = push(patchpoint);
     return { };
 }
 
 auto OMGIRGenerator::addF32Trunc(ExpressionType argVar, ExpressionType& result) -> PartialResult
 {
     Value* arg = get(argVar);
-    Value* callee = m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction<OperationPtrTag>(Math::f32_trunc));
-    Value* call = m_currentBlock->appendNew<CCallValue>(m_proc, B3::Float, origin(), callee, arg);
-    result = push(call);
+    PatchpointValue* patchpoint = m_currentBlock->appendNew<PatchpointValue>(m_proc, Float, origin());
+    patchpoint->append(arg, ValueRep::SomeRegister);
+    patchpoint->setGenerator([=] (CCallHelpers& jit, const StackmapGenerationParams& params) {
+        jit.roundTowardZeroFloat(params[1].fpr(), params[0].fpr());
+    });
+    patchpoint->effects = Effects::none();
+    result = push(patchpoint);
     return { };
 }
 
