diff --git a/src/xrpld/app/wasm/ParamsHelper.h b/src/xrpld/app/wasm/ParamsHelper.h index 8bdf11e618..7f18389552 100644 --- a/src/xrpld/app/wasm/ParamsHelper.h +++ b/src/xrpld/app/wasm/ParamsHelper.h @@ -52,7 +52,7 @@ typedef WasmResult EscrowResult; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -enum WasmTypes { WT_I32, WT_I64, WT_F32, WT_F64, WT_U8V }; +enum WasmTypes { WT_I32, WT_I64, WT_U8V }; struct WasmImportFunc { @@ -86,10 +86,6 @@ WasmImpArgs(WasmImportFunc& e) e.params.push_back(WT_I32); else if constexpr (std::is_same_v) e.params.push_back(WT_I64); - else if constexpr (std::is_same_v) - e.params.push_back(WT_F32); - else if constexpr (std::is_same_v) - e.params.push_back(WT_F64); else static_assert(std::is_pointer_v, "Unsupported argument type"); @@ -108,10 +104,6 @@ WasmImpRet(WasmImportFunc& e) e.result = WT_I32; else if constexpr (std::is_same_v) e.result = WT_I64; - else if constexpr (std::is_same_v) - e.result = WT_F32; - else if constexpr (std::is_same_v) - e.result = WT_F64; else if constexpr (std::is_void_v) e.result.reset(); #if (defined(__GNUC__) && (__GNUC__ >= 14)) || \ @@ -189,21 +181,23 @@ wasmParamsHlp(std::vector& v, std::int64_t p, Types&&... args) wasmParamsHlp(v, std::forward(args)...); } -template -inline void -wasmParamsHlp(std::vector& v, float p, Types&&... args) -{ - v.push_back({.type = WT_F32, .of = {.f32 = p}}); - wasmParamsHlp(v, std::forward(args)...); -} +// We are not supporting float/double for now +// Leaving this code here so that it is easier to add later if needed +// template +// inline void +// wasmParamsHlp(std::vector& v, float p, Types&&... args) +// { +// v.push_back({.type = WT_F32, .of = {.f32 = p}}); +// wasmParamsHlp(v, std::forward(args)...); +// } -template -inline void -wasmParamsHlp(std::vector& v, double p, Types&&... args) -{ - v.push_back({.type = WT_F64, .of = {.f64 = p}}); - wasmParamsHlp(v, std::forward(args)...); -} +// template +// inline void +// wasmParamsHlp(std::vector& v, double p, Types&&... args) +// { +// v.push_back({.type = WT_F64, .of = {.f64 = p}}); +// wasmParamsHlp(v, std::forward(args)...); +// } template inline void diff --git a/src/xrpld/app/wasm/detail/WamrVM.cpp b/src/xrpld/app/wasm/detail/WamrVM.cpp index e47a618f12..4d94e1cb8f 100644 --- a/src/xrpld/app/wasm/detail/WamrVM.cpp +++ b/src/xrpld/app/wasm/detail/WamrVM.cpp @@ -425,12 +425,6 @@ ModuleWrapper::makeImpParams(wasm_valtype_vec_t& v, WasmImportFunc const& imp) case WT_I64: v.data[i] = wasm_valtype_new_i64(); break; - case WT_F32: - v.data[i] = wasm_valtype_new_f32(); - break; - case WT_F64: - v.data[i] = wasm_valtype_new_f64(); - break; default: throw std::runtime_error("invalid import type"); } @@ -452,12 +446,6 @@ ModuleWrapper::makeImpReturn(wasm_valtype_vec_t& v, WasmImportFunc const& imp) case WT_I64: v.data[0] = wasm_valtype_new_i64(); break; - case WT_F32: - v.data[0] = wasm_valtype_new_f32(); - break; - case WT_F64: - v.data[0] = wasm_valtype_new_f64(); - break; default: throw std::runtime_error("invalid return type"); } @@ -680,12 +668,6 @@ WamrEngine::convertParams(std::vector const& params) case WT_I64: v.push_back(WASM_I64_VAL(p.of.i64)); break; - case WT_F32: - v.push_back(WASM_F32_VAL(p.of.f32)); - break; - case WT_F64: - v.push_back(WASM_F64_VAL(p.of.f64)); - break; case WT_U8V: { auto const sz = p.of.u8v.sz; auto const ptr = allocate(sz);