From 900fabee73c16bda1542b96d564936e6318d6f58 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Wed, 12 Nov 2025 00:31:30 +0100 Subject: Add i32_{gt,le}_{s,u} --- src/op/i32_le_s.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/op/i32_le_s.c (limited to 'src/op/i32_le_s.c') diff --git a/src/op/i32_le_s.c b/src/op/i32_le_s.c new file mode 100644 index 0000000..d1534a9 --- /dev/null +++ b/src/op/i32_le_s.c @@ -0,0 +1,23 @@ +/* + * nanowasm, a tiny WebAssembly/Wasm interpreter + * Copyright (C) 2023-2025 Xavier Del Campo Romero + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#include +#include + +static int le_s(const struct nw_i_sm_arithm_out *const o, + union nw_value *const res) +{ + res->i32 = o->left.i32 <= o->right.i32; + return 0; +} + +void nwp_op_i32_le_s(struct nw_interp *const i) +{ + nwp_arithm(i, NW_TYPE_I32, le_s); +} -- cgit v1.2.3