[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[COMMITTED] pvm: add a couple of peephole optimizations
From: |
Jose E. Marchesi |
Subject: |
[COMMITTED] pvm: add a couple of peephole optimizations |
Date: |
Sat, 21 Sep 2024 01:13:11 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
2024-09-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (dup-wap-to-dup): New rewrite.
(swap-tuck-to-over): Likewise.
---
ChangeLog | 5 +++++
libpoke/pvm.jitter | 12 ++++++++++++
2 files changed, 17 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index a462817d..76c8f970 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-09-21 Jose E. Marchesi <jemarch@gnu.org>
+
+ * libpoke/pvm.jitter (dup-wap-to-dup): New rewrite.
+ (swap-tuck-to-over): Likewise.
+
2024-09-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_struct_type_field): Fix
diff --git a/libpoke/pvm.jitter b/libpoke/pvm.jitter
index f10c30bd..247f77f9 100644
--- a/libpoke/pvm.jitter
+++ b/libpoke/pvm.jitter
@@ -7293,6 +7293,18 @@ end
## Peephole optimizations
+rule dup-swap-to-dup rewrite
+ dup; swap
+into
+ dup
+end
+
+rule swap-tuck-to-over rewrite
+ swap; tuck
+into
+ over
+end
+
rule swap-drop-to-nip rewrite
swap; drop
into
--
2.30.2
- [COMMITTED] pvm: add a couple of peephole optimizations,
Jose E. Marchesi <=