Skip to content

Commit e408218

Browse files
committed
Refine declaration of jit-cache
1 parent 913a15c commit e408218

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/jit.h

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <stdint.h>
99

10+
#include "common.h"
1011
#include "riscv_private.h"
1112
#include "utils.h"
1213

@@ -56,20 +57,14 @@ typedef void (*exec_t2c_func_t)(riscv_t *);
5657
#endif
5758

5859
#if RV32_HAS(JIT_CACHE)
59-
#if !defined(__x86_64__) && !defined(__aarch64__)
60-
/* make sure LLVM can access the correct address of structure member */
61-
#error "The JIT-cache only supports 64-bit machine (LP64)."
62-
#endif
63-
6460
#define MAX_JIT_CACHE_TABLE_ENTRIES (1 << 12)
6561

6662
/* clang-format off */
6763
struct jit_cache {
68-
__attribute__((aligned(4))) uint32_t pc; /* program counter of ELF */
69-
__attribute__((aligned(4))) uint32_t from; /* from whether t1c or t2c,
70-
easily to build LLVM IR
71-
because of the alignment
72-
*/
64+
__ALIGNED(4) uint32_t pc; /* program counter of ELF */
65+
__ALIGNED(4) uint32_t from; /* from whether t1c or t2c, ensure the correct
66+
alignment for accessing member in LLVM IR
67+
*/
7368
void *entry; /* entry of JIT-ed code */
7469
};
7570
/* clang-format on */

0 commit comments

Comments
 (0)