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/jit | |
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/jit')
-rw-r--r-- | src/jit/bcsave.lua | 8 | ||||
-rw-r--r-- | src/jit/dis_arm64be.lua | 12 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/jit/bcsave.lua b/src/jit/bcsave.lua index 9ee22a01..c17c88e0 100644 --- a/src/jit/bcsave.lua +++ b/src/jit/bcsave.lua | |||
@@ -63,8 +63,8 @@ local map_type = { | |||
63 | } | 63 | } |
64 | 64 | ||
65 | local map_arch = { | 65 | local map_arch = { |
66 | x86 = true, x64 = true, arm = true, arm64 = true, ppc = true, | 66 | x86 = true, x64 = true, arm = true, arm64 = true, arm64be = true, |
67 | mips = true, mipsel = true, | 67 | ppc = true, mips = true, mipsel = true, |
68 | } | 68 | } |
69 | 69 | ||
70 | local map_os = { | 70 | local map_os = { |
@@ -200,7 +200,7 @@ typedef struct { | |||
200 | ]] | 200 | ]] |
201 | local symname = LJBC_PREFIX..ctx.modname | 201 | local symname = LJBC_PREFIX..ctx.modname |
202 | local is64, isbe = false, false | 202 | local is64, isbe = false, false |
203 | if ctx.arch == "x64" or ctx.arch == "arm64" then | 203 | if ctx.arch == "x64" or ctx.arch == "arm64" or ctx.arch == "arm64be" then |
204 | is64 = true | 204 | is64 = true |
205 | elseif ctx.arch == "ppc" or ctx.arch == "mips" then | 205 | elseif ctx.arch == "ppc" or ctx.arch == "mips" then |
206 | isbe = true | 206 | isbe = true |
@@ -237,7 +237,7 @@ typedef struct { | |||
237 | hdr.eendian = isbe and 2 or 1 | 237 | hdr.eendian = isbe and 2 or 1 |
238 | hdr.eversion = 1 | 238 | hdr.eversion = 1 |
239 | hdr.type = f16(1) | 239 | hdr.type = f16(1) |
240 | hdr.machine = f16(({ x86=3, x64=62, arm=40, arm64=183, ppc=20, mips=8, mipsel=8 })[ctx.arch]) | 240 | hdr.machine = f16(({ x86=3, x64=62, arm=40, arm64=183, arm64be=183, ppc=20, mips=8, mipsel=8 })[ctx.arch]) |
241 | if ctx.arch == "mips" or ctx.arch == "mipsel" then | 241 | if ctx.arch == "mips" or ctx.arch == "mipsel" then |
242 | hdr.flags = f32(0x50001006) | 242 | hdr.flags = f32(0x50001006) |
243 | end | 243 | end |
diff --git a/src/jit/dis_arm64be.lua b/src/jit/dis_arm64be.lua new file mode 100644 index 00000000..7eb389e2 --- /dev/null +++ b/src/jit/dis_arm64be.lua | |||
@@ -0,0 +1,12 @@ | |||
1 | ---------------------------------------------------------------------------- | ||
2 | -- LuaJIT ARM64BE disassembler wrapper module. | ||
3 | -- | ||
4 | -- Copyright (C) 2005-2017 Mike Pall. All rights reserved. | ||
5 | -- Released under the MIT license. See Copyright Notice in luajit.h | ||
6 | ---------------------------------------------------------------------------- | ||
7 | -- ARM64 instructions are always little-endian. So just forward to the | ||
8 | -- common ARM64 disassembler module. All the interesting stuff is there. | ||
9 | ------------------------------------------------------------------------------ | ||
10 | |||
11 | return require((string.match(..., ".*%.") or "").."dis_arm64") | ||
12 | |||