[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Lightning] [PATCH] Allow *_ui macros on 32-bit CPUs
From: |
Paul Cercueil |
Subject: |
[Lightning] [PATCH] Allow *_ui macros on 32-bit CPUs |
Date: |
Mon, 2 Sep 2019 11:48:27 +0200 |
If you want for instance to retrieve a unsigned 32-bit value returned by
a function that was just called, you previously needed to write the
following:
#if __WORDSIZE == 64
jit_retval_ui(JIT_R0);
#else
jit_retval(JIT_R0);
#endif
Make it simpler by adding the *_ui macros on 32-bit CPUs, where they
simply point to their corresponding *_i variant.
Signed-off-by: Paul Cercueil <address@hidden>
---
include/lightning.h.in | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/lightning.h.in b/include/lightning.h.in
index 9030fa8..a78ca17 100644
--- a/include/lightning.h.in
+++ b/include/lightning.h.in
@@ -207,6 +207,7 @@ typedef enum {
#define jit_getarg_i(u,v) _jit_getarg_i(_jit,u,v)
#if __WORDSIZE == 32
# define jit_getarg(u,v) jit_getarg_i(u,v)
+# define jit_getarg_ui(u,v) jit_getarg_i(u,v)
#else
# define jit_getarg(u,v) jit_getarg_l(u,v)
# define jit_getarg_ui(u,v) _jit_getarg_ui(_jit,u,v)
@@ -378,7 +379,9 @@ typedef enum {
jit_code_ldr_i, jit_code_ldi_i,
#if __WORDSIZE == 32
# define jit_ldr(u,v) jit_ldr_i(u,v)
+# define jit_ldr_ui(u,v) jit_ldr_i(u,v)
# define jit_ldi(u,v) jit_ldi_i(u,v)
+# define jit_ldi_ui(u,v) jit_ldi_i(u,v)
#else
# define jit_ldr(u,v) jit_ldr_l(u,v)
# define jit_ldi(u,v) jit_ldi_l(u,v)
@@ -407,7 +410,9 @@ typedef enum {
jit_code_ldxr_i, jit_code_ldxi_i,
#if __WORDSIZE == 32
# define jit_ldxr(u,v,w) jit_ldxr_i(u,v,w)
+# define jit_ldxr_ui(u,v,w) jit_ldxr_i(u,v,w)
# define jit_ldxi(u,v,w) jit_ldxi_i(u,v,w)
+# define jit_ldxi_ui(u,v,w) jit_ldxi_i(u,v,w)
#else
# define jit_ldxr_ui(u,v,w) jit_new_node_www(jit_code_ldxr_ui,u,v,w)
# define jit_ldxi_ui(u,v,w) jit_new_node_www(jit_code_ldxi_ui,u,v,w)
@@ -551,6 +556,7 @@ typedef enum {
#define jit_retval_i(u) _jit_retval_i(_jit,u)
#if __WORDSIZE == 32
# define jit_retval(u) jit_retval_i(u)
+# define jit_retval_ui(u) jit_retval_i(u)
#else
# define jit_retval(u) jit_retval_l(u)
# define jit_retval_ui(u) _jit_retval_ui(_jit,u)
--
2.23.0.rc1
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Lightning] [PATCH] Allow *_ui macros on 32-bit CPUs,
Paul Cercueil <=