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/host | |
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/host')
-rw-r--r-- | src/host/buildvm_asm.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/host/buildvm_asm.c b/src/host/buildvm_asm.c index addf281f..1a633602 100644 --- a/src/host/buildvm_asm.c +++ b/src/host/buildvm_asm.c | |||
@@ -93,10 +93,14 @@ static void emit_asm_words(BuildCtx *ctx, uint8_t *p, int n) | |||
93 | { | 93 | { |
94 | int i; | 94 | int i; |
95 | for (i = 0; i < n; i += 4) { | 95 | for (i = 0; i < n; i += 4) { |
96 | uint32_t ins = *(uint32_t *)(p+i); | ||
97 | #if LJ_TARGET_ARM64 && LJ_BE | ||
98 | ins = lj_bswap(ins); /* ARM64 instructions are always little-endian. */ | ||
99 | #endif | ||
96 | if ((i & 15) == 0) | 100 | if ((i & 15) == 0) |
97 | fprintf(ctx->fp, "\t.long 0x%08x", *(uint32_t *)(p+i)); | 101 | fprintf(ctx->fp, "\t.long 0x%08x", ins); |
98 | else | 102 | else |
99 | fprintf(ctx->fp, ",0x%08x", *(uint32_t *)(p+i)); | 103 | fprintf(ctx->fp, ",0x%08x", ins); |
100 | if ((i & 15) == 12) putc('\n', ctx->fp); | 104 | if ((i & 15) == 12) putc('\n', ctx->fp); |
101 | } | 105 | } |
102 | if ((n & 15) != 0) putc('\n', ctx->fp); | 106 | if ((n & 15) != 0) putc('\n', ctx->fp); |