Add conditional move opcodes - lightning.git - Portable just-in-time compiler library

index : lightning.git
Portable just-in-time compiler library
summary refs log tree commit diff
path: root/lib/jit_arm-sz.c
diff options
context:
space:
mode:
authorPaul Cercueil <paul@crapouillou.net>2022年02月07日 13:13:38 +0000
committerpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2022年05月12日 23:30:10 -0300
commit82fa69dc1d227e04c1241c2b4990e92b892a5613 (patch)
treef601c598c10ae62dc3def45b27caeb23a400753b /lib/jit_arm-sz.c
parent1f34acbd216a2775c46f2c46c38d657c4d9d0d79 (diff)
downloadlightning-82fa69dc1d227e04c1241c2b4990e92b892a5613.tar.gz
Add conditional move opcodes
Add jit_movnr(r0, r1, r2) and jit_movzr(r0, r1, r2). jit_movnr() corresponds to the following operation: r0 = r2 ? r1 : r0 jit_movzr() corresponds to the following operation: r0 = r2 ? r0 : r1 Add implementations for x86/x86_64, MIPS, PowerPC, ARM and Aarch64. The x86 implementation uses the CMOV feature, which was added in i686. I don't think anybody will try to run Lightning on anything more ancient, so this should be fine. Otherwise, a simple implementation based on branches can be added later. This could be used as well for architectures that lack conditional moves, like it's currently done on PowerPC for instance. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Diffstat (limited to 'lib/jit_arm-sz.c')
-rw-r--r--lib/jit_arm-sz.c 2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/jit_arm-sz.c b/lib/jit_arm-sz.c
index 9f0d012..6368c13 100644
--- a/lib/jit_arm-sz.c
+++ b/lib/jit_arm-sz.c
@@ -804,5 +804,7 @@
12, /* movi_d_ww */
0, /* movr_d_w */
0, /* movi_d_w */
+ 8, /* movnr */
+ 8, /* movzr */
#endif /* __ARM_PCS_VFP */
#endif /* __WORDSIZE */
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月30日 09:00:01 +0000

AltStyle によって変換されたページ (->オリジナル) /