From 4269b6d3d0aeff1cf1bae3eac5f40cceb75576e0 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sat, 26 Aug 2023 17:13:56 +0300 Subject: apply fixes to make jit-comparison easier --- ops/branchi/bani.c | 8 ++++++++ ops/branchi/source.mk | 2 ++ ops/peeko.c | 9 +++++++++ ops/popo.c | 9 +++++++++ ops/pusha.c | 9 +++++++++ ops/source.mk | 1 + 6 files changed, 38 insertions(+) create mode 100644 ops/branchi/bani.c create mode 100644 ops/branchi/source.mk create mode 100644 ops/peeko.c create mode 100644 ops/popo.c create mode 100644 ops/pusha.c (limited to 'ops') diff --git a/ops/branchi/bani.c b/ops/branchi/bani.c new file mode 100644 index 0000000..15708eb --- /dev/null +++ b/ops/branchi/bani.c @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: copyleft-next-0.3.1 */ + +#include "../common.h" + +DEFINE_OP(bani) +{ + BRANCH(IMM(), a != 0, sp, a, x, y, o); +} diff --git a/ops/branchi/source.mk b/ops/branchi/source.mk new file mode 100644 index 0000000..1c5424e --- /dev/null +++ b/ops/branchi/source.mk @@ -0,0 +1,2 @@ +IMM_SRC != echo ops/branchi/*.c +IMM_SOURCES += $(IMM_SRC) diff --git a/ops/peeko.c b/ops/peeko.c new file mode 100644 index 0000000..06e6f2c --- /dev/null +++ b/ops/peeko.c @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: copyleft-next-0.3.1 */ + +#include "common.h" + +DEFINE_OP(peeko) +{ + UNUSED(o); + NEXT_OP(sp, a, x, y, *(sp - 1)); +} diff --git a/ops/popo.c b/ops/popo.c new file mode 100644 index 0000000..5a90524 --- /dev/null +++ b/ops/popo.c @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: copyleft-next-0.3.1 */ + +#include "common.h" + +DEFINE_OP(popo) +{ + UNUSED(o); + NEXT_OP(sp - 1, a, x, y, *(sp - 1)); +} diff --git a/ops/pusha.c b/ops/pusha.c new file mode 100644 index 0000000..8898a77 --- /dev/null +++ b/ops/pusha.c @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: copyleft-next-0.3.1 */ + +#include "common.h" + +DEFINE_OP(pusha) +{ + *sp = a; + NEXT_OP(sp + 1, a, x, y, o); +} diff --git a/ops/source.mk b/ops/source.mk index 0a90169..8db98bc 100644 --- a/ops/source.mk +++ b/ops/source.mk @@ -6,3 +6,4 @@ include ops/bs/source.mk include ops/li/source.mk include ops/sl/source.mk include ops/sr/source.mk +include ops/branchi/source.mk -- cgit v1.3