/*
- * Copyright (C) 2012-2019 Free Software Foundation, Inc.
+ * Copyright (C) 2012-2022 Free Software Foundation, Inc.
*
* This file is part of GNU lightning.
*
#define jit_cc_a2_int 0x00100000 /* arg2 is immediate word */
#define jit_cc_a2_flt 0x00200000 /* arg2 is immediate float */
#define jit_cc_a2_dbl 0x00400000 /* arg2 is immediate double */
+#define jit_cc_a2_rlh 0x00800000 /* arg2 is a register pair */
#if __ia64__ || (__sparc__ && __WORDSIZE == 64)
extern void
# if DISASSEMBLER
typedef struct jit_data_info jit_data_info_t;
# endif
+#elif __riscv
+typedef struct jit_const jit_const_t;
#endif
union jit_data {
jit_node_t *label;
jit_regset_t reglive;
jit_regset_t regmask;
+ jit_bool_t again; /* Flag need to rebuild regset masks
+ * due to changes in live and unknown
+ * state. */
};
struct jit_value {
jit_uword_t code; /* pointer in code buffer */
jit_word_t length; /* length of constant vector */
};
+#elif __riscv && __WORDSIZE == 64
+struct jit_const {
+ jit_word_t value;
+ jit_word_t address;
+ jit_const_t *next;
+};
#endif
struct jit_function {
jit_word_t length;
} prolog;
jit_bool_t jump;
+#elif __riscv && __WORDSIZE == 64
+ struct {
+ /* Hash table for constants to be resolved and patched */
+ struct {
+ jit_const_t **table; /* very simple hash table */
+ jit_word_t size; /* number of vectors in table */
+ jit_word_t count; /* number of distinct entries */
+ } hash;
+ struct {
+ jit_const_t **ptr; /* keep a single pointer */
+ jit_const_t *list; /* free list */
+ jit_word_t length; /* length of pool */
+ } pool;
+ /* Linear list for constants that cannot be encoded easily */
+ struct {
+ jit_word_t *instrs; /* list of direct movi instructions */
+ jit_word_t *values; /* list of direct movi constants */
+ jit_word_t offset; /* offset in instrs/values vector */
+ jit_word_t length; /* length of instrs/values vector */
+ } vector;
+ } consts;
#endif
#if GET_JIT_SIZE
/* Temporary storage to calculate instructions length */