diff options
author | Mike Pall <mike> | 2017-03-30 11:17:15 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2017-03-30 11:30:01 +0200 |
commit | 3143b218946395834f0bfef741061ac6ef3f5b56 (patch) | |
tree | 07721c6a94616eda13799a6027b00f3e3fc999a4 /src/lj_target_arm64.h | |
parent | 78f5f1cef19502289604299e4e6d00e14411f764 (diff) | |
download | luajit-3143b218946395834f0bfef741061ac6ef3f5b56.tar.gz luajit-3143b218946395834f0bfef741061ac6ef3f5b56.tar.bz2 luajit-3143b218946395834f0bfef741061ac6ef3f5b56.zip |
ARM64: Add big-endian support.
Contributed by Djordje Kovacevic and Stefan Pejic from RT-RK.com.
Sponsored by Cisco Systems, Inc.
Diffstat (limited to 'src/lj_target_arm64.h')
-rw-r--r-- | src/lj_target_arm64.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lj_target_arm64.h b/src/lj_target_arm64.h index 3f6bb39b..520023ae 100644 --- a/src/lj_target_arm64.h +++ b/src/lj_target_arm64.h | |||
@@ -107,7 +107,7 @@ typedef struct { | |||
107 | /* Return the address of a per-trace exit stub. */ | 107 | /* Return the address of a per-trace exit stub. */ |
108 | static LJ_AINLINE uint32_t *exitstub_trace_addr_(uint32_t *p, uint32_t exitno) | 108 | static LJ_AINLINE uint32_t *exitstub_trace_addr_(uint32_t *p, uint32_t exitno) |
109 | { | 109 | { |
110 | while (*p == 0xd503201f) p++; /* Skip A64I_NOP. */ | 110 | while (*p == (LJ_LE ? 0xd503201f : 0x1f2003d5)) p++; /* Skip A64I_NOP. */ |
111 | return p + 3 + exitno; | 111 | return p + 3 + exitno; |
112 | } | 112 | } |
113 | /* Avoid dependence on lj_jit.h if only including lj_target.h. */ | 113 | /* Avoid dependence on lj_jit.h if only including lj_target.h. */ |
@@ -116,6 +116,13 @@ static LJ_AINLINE uint32_t *exitstub_trace_addr_(uint32_t *p, uint32_t exitno) | |||
116 | 116 | ||
117 | /* -- Instructions -------------------------------------------------------- */ | 117 | /* -- Instructions -------------------------------------------------------- */ |
118 | 118 | ||
119 | /* ARM64 instructions are always little-endian. Swap for ARM64BE. */ | ||
120 | #if LJ_BE | ||
121 | #define A64I_LE(x) (lj_bswap(x)) | ||
122 | #else | ||
123 | #define A64I_LE(x) (x) | ||
124 | #endif | ||
125 | |||
119 | /* Instruction fields. */ | 126 | /* Instruction fields. */ |
120 | #define A64F_D(r) (r) | 127 | #define A64F_D(r) (r) |
121 | #define A64F_N(r) ((r) << 5) | 128 | #define A64F_N(r) ((r) << 5) |