2019-01-24 23:44:08 +00:00
|
|
|
use wasmer_runtime_core::vm::Ctx;
|
|
|
|
|
2018-12-13 18:28:30 +00:00
|
|
|
/// emscripten: _llvm_log10_f64
|
2019-01-24 23:44:08 +00:00
|
|
|
pub extern "C" fn _llvm_log10_f64(value: f64, _ctx: &mut Ctx) -> f64 {
|
2018-12-13 18:28:30 +00:00
|
|
|
debug!("emscripten::_llvm_log10_f64");
|
|
|
|
value.log10()
|
|
|
|
}
|
|
|
|
|
|
|
|
/// emscripten: _llvm_log2_f64
|
2019-01-24 23:44:08 +00:00
|
|
|
pub extern "C" fn _llvm_log2_f64(value: f64, _ctx: &mut Ctx) -> f64 {
|
2018-12-13 18:28:30 +00:00
|
|
|
debug!("emscripten::_llvm_log2_f64");
|
|
|
|
value.log2()
|
|
|
|
}
|
|
|
|
|
|
|
|
// emscripten: f64-rem
|
2019-01-24 23:44:08 +00:00
|
|
|
pub extern "C" fn f64_rem(x: f64, y: f64, _ctx: &mut Ctx) -> f64 {
|
2018-12-13 18:28:30 +00:00
|
|
|
debug!("emscripten::f64-rem");
|
|
|
|
x % y
|
|
|
|
}
|
2019-01-23 18:54:03 +00:00
|
|
|
|
|
|
|
// emscripten: global.Math pow
|
2019-01-24 23:44:08 +00:00
|
|
|
pub extern "C" fn pow(x: f64, y: f64, _ctx: &mut Ctx) -> f64 {
|
2019-01-23 18:54:03 +00:00
|
|
|
x.powf(y)
|
|
|
|
}
|