2019-01-24 15:44:08 -08:00
|
|
|
use wasmer_runtime_core::vm::Ctx;
|
|
|
|
|
2018-12-13 19:28:30 +01:00
|
|
|
/// emscripten: _llvm_log10_f64
|
2019-02-02 15:28:50 -08:00
|
|
|
pub fn _llvm_log10_f64(value: f64, _ctx: &mut Ctx) -> f64 {
|
2018-12-13 19:28:30 +01:00
|
|
|
debug!("emscripten::_llvm_log10_f64");
|
|
|
|
value.log10()
|
|
|
|
}
|
|
|
|
|
|
|
|
/// emscripten: _llvm_log2_f64
|
2019-02-02 15:28:50 -08:00
|
|
|
pub fn _llvm_log2_f64(value: f64, _ctx: &mut Ctx) -> f64 {
|
2018-12-13 19:28:30 +01:00
|
|
|
debug!("emscripten::_llvm_log2_f64");
|
|
|
|
value.log2()
|
|
|
|
}
|
|
|
|
|
2019-02-02 15:28:50 -08:00
|
|
|
pub fn _llvm_log10_f32(_value: f64, _ctx: &mut Ctx) -> f64 {
|
2019-01-26 17:02:51 -06:00
|
|
|
debug!("emscripten::_llvm_log10_f32");
|
2019-01-27 00:33:58 -06:00
|
|
|
-1.0
|
2019-01-26 17:02:51 -06:00
|
|
|
}
|
|
|
|
|
2019-02-02 15:28:50 -08:00
|
|
|
pub fn _llvm_log2_f32(_value: f64, _ctx: &mut Ctx) -> f64 {
|
2019-01-26 17:02:51 -06:00
|
|
|
debug!("emscripten::_llvm_log10_f32");
|
2019-01-27 00:33:58 -06:00
|
|
|
-1.0
|
|
|
|
}
|
|
|
|
|
2019-02-02 15:28:50 -08:00
|
|
|
pub fn _emscripten_random(_ctx: &mut Ctx) -> f64 {
|
2019-01-27 00:33:58 -06:00
|
|
|
debug!("emscripten::_emscripten_random");
|
|
|
|
-1.0
|
2019-01-26 17:02:51 -06:00
|
|
|
}
|
|
|
|
|
2018-12-13 19:28:30 +01:00
|
|
|
// emscripten: f64-rem
|
2019-02-02 15:28:50 -08:00
|
|
|
pub fn f64_rem(x: f64, y: f64, _ctx: &mut Ctx) -> f64 {
|
2018-12-13 19:28:30 +01:00
|
|
|
debug!("emscripten::f64-rem");
|
|
|
|
x % y
|
|
|
|
}
|
2019-01-23 10:54:03 -08:00
|
|
|
|
|
|
|
// emscripten: global.Math pow
|
2019-02-02 15:28:50 -08:00
|
|
|
pub fn pow(x: f64, y: f64, _ctx: &mut Ctx) -> f64 {
|
2019-01-23 10:54:03 -08:00
|
|
|
x.powf(y)
|
|
|
|
}
|