diff options
author | Mike Pall <mike> | 2018-06-24 14:08:59 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2018-06-24 14:08:59 +0200 |
commit | 9da06535092d6d9dec442641a26c64bce5574322 (patch) | |
tree | 80d9e6c3b8dd3f8e1fed3246257d915743cd27e3 /src/lj_target_arm64.h | |
parent | c785131ca5a6d24adc519e5e0bf1b69b671d912f (diff) | |
download | luajit-9da06535092d6d9dec442641a26c64bce5574322.tar.gz luajit-9da06535092d6d9dec442641a26c64bce5574322.tar.bz2 luajit-9da06535092d6d9dec442641a26c64bce5574322.zip |
ARM64: Fix exit stub patching.
Contributed by Javier Guerra Giraldez.
Diffstat (limited to '')
-rw-r--r-- | src/lj_target_arm64.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lj_target_arm64.h b/src/lj_target_arm64.h index 520023ae..a207a2ba 100644 --- a/src/lj_target_arm64.h +++ b/src/lj_target_arm64.h | |||
@@ -132,9 +132,9 @@ static LJ_AINLINE uint32_t *exitstub_trace_addr_(uint32_t *p, uint32_t exitno) | |||
132 | #define A64F_IMMR(x) ((x) << 16) | 132 | #define A64F_IMMR(x) ((x) << 16) |
133 | #define A64F_U16(x) ((x) << 5) | 133 | #define A64F_U16(x) ((x) << 5) |
134 | #define A64F_U12(x) ((x) << 10) | 134 | #define A64F_U12(x) ((x) << 10) |
135 | #define A64F_S26(x) (x) | 135 | #define A64F_S26(x) (((uint32_t)(x) & 0x03ffffffu)) |
136 | #define A64F_S19(x) (((uint32_t)(x) & 0x7ffffu) << 5) | 136 | #define A64F_S19(x) (((uint32_t)(x) & 0x7ffffu) << 5) |
137 | #define A64F_S14(x) ((x) << 5) | 137 | #define A64F_S14(x) (((uint32_t)(x) & 0x3fffu) << 5) |
138 | #define A64F_S9(x) ((x) << 12) | 138 | #define A64F_S9(x) ((x) << 12) |
139 | #define A64F_BIT(x) ((x) << 19) | 139 | #define A64F_BIT(x) ((x) << 19) |
140 | #define A64F_SH(sh, x) (((sh) << 22) | ((x) << 10)) | 140 | #define A64F_SH(sh, x) (((sh) << 22) | ((x) << 10)) |
@@ -145,6 +145,9 @@ static LJ_AINLINE uint32_t *exitstub_trace_addr_(uint32_t *p, uint32_t exitno) | |||
145 | #define A64F_LSL16(x) (((x) / 16) << 21) | 145 | #define A64F_LSL16(x) (((x) / 16) << 21) |
146 | #define A64F_BSH(sh) ((sh) << 10) | 146 | #define A64F_BSH(sh) ((sh) << 10) |
147 | 147 | ||
148 | /* Check for valid field range. */ | ||
149 | #define A64F_S_OK(x, b) ((((x) + (1 << (b-1))) >> (b)) == 0) | ||
150 | |||
148 | typedef enum A64Ins { | 151 | typedef enum A64Ins { |
149 | A64I_S = 0x20000000, | 152 | A64I_S = 0x20000000, |
150 | A64I_X = 0x80000000, | 153 | A64I_X = 0x80000000, |