-
Notifications
You must be signed in to change notification settings - Fork 9
/
lightning-wrapper.h
36 lines (27 loc) · 869 Bytes
/
lightning-wrapper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2022 Paul Cercueil <paul@crapouillou.net>
*/
#ifndef __LIGHTNING_WRAPPER_H__
#define __LIGHTNING_WRAPPER_H__
#include <lightning.h>
#include "lightrec-config.h"
#if __WORDSIZE == 32
#define jit_ldxi_ui(u,v,w) jit_ldxi_i(u,v,w)
#define jit_stxi_ui(u,v,w) jit_stxi_i(u,v,w)
#define jit_extr_i(u,v) jit_movr(u,v)
#define jit_extr_ui(u,v) jit_movr(u,v)
#define jit_retval_ui(u) jit_retval(u)
#define jit_getarg_ui(u,v) jit_getarg_i(u,v)
#endif
#define jit_b() jit_beqr(0, 0)
#if defined(__sh__) && OPT_SH4_USE_GBR
#define jit_add_state(u,v) \
do { \
jit_new_node_ww(jit_code_movr,_R0,LIGHTREC_REG_STATE); \
jit_new_node_www(jit_code_addr,u,v,_R0); \
} while (0)
#else
#define jit_add_state(u,v) jit_addr(u,v,LIGHTREC_REG_STATE)
#endif
#endif /* __LIGHTNING_WRAPPER_H__ */