immunio 1.1.2 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/immunio/version.rb +1 -1
- data/lua-hooks/Makefile +56 -109
- data/lua-hooks/ext/all.c +3 -14
- data/lua-hooks/ext/libinjection/module.mk +5 -0
- data/lua-hooks/ext/lpeg/module.mk +6 -0
- data/lua-hooks/ext/lua-cmsgpack/module.mk +2 -0
- data/lua-hooks/ext/lua-snapshot/module.mk +2 -0
- data/lua-hooks/ext/luajit/COPYRIGHT +1 -1
- data/lua-hooks/ext/luajit/Makefile +2 -2
- data/lua-hooks/ext/luajit/README +2 -2
- data/lua-hooks/ext/luajit/doc/bluequad-print.css +1 -1
- data/lua-hooks/ext/luajit/doc/bluequad.css +1 -1
- data/lua-hooks/ext/luajit/doc/changes.html +15 -2
- data/lua-hooks/ext/luajit/doc/contact.html +3 -3
- data/lua-hooks/ext/luajit/doc/ext_c_api.html +2 -2
- data/lua-hooks/ext/luajit/doc/ext_ffi.html +2 -2
- data/lua-hooks/ext/luajit/doc/ext_ffi_api.html +2 -2
- data/lua-hooks/ext/luajit/doc/ext_ffi_semantics.html +4 -2
- data/lua-hooks/ext/luajit/doc/ext_ffi_tutorial.html +2 -2
- data/lua-hooks/ext/luajit/doc/ext_jit.html +2 -2
- data/lua-hooks/ext/luajit/doc/ext_profiler.html +2 -2
- data/lua-hooks/ext/luajit/doc/extensions.html +9 -2
- data/lua-hooks/ext/luajit/doc/faq.html +2 -2
- data/lua-hooks/ext/luajit/doc/install.html +22 -18
- data/lua-hooks/ext/luajit/doc/luajit.html +3 -3
- data/lua-hooks/ext/luajit/doc/running.html +2 -2
- data/lua-hooks/ext/luajit/doc/status.html +2 -2
- data/lua-hooks/ext/luajit/dynasm/dasm_arm.h +1 -1
- data/lua-hooks/ext/luajit/dynasm/dasm_arm.lua +4 -4
- data/lua-hooks/ext/luajit/dynasm/dasm_arm64.h +1 -1
- data/lua-hooks/ext/luajit/dynasm/dasm_arm64.lua +4 -4
- data/lua-hooks/ext/luajit/dynasm/dasm_mips.h +1 -1
- data/lua-hooks/ext/luajit/dynasm/dasm_mips.lua +4 -4
- data/lua-hooks/ext/luajit/dynasm/dasm_ppc.h +1 -1
- data/lua-hooks/ext/luajit/dynasm/dasm_ppc.lua +4 -4
- data/lua-hooks/ext/luajit/dynasm/dasm_proto.h +3 -3
- data/lua-hooks/ext/luajit/dynasm/dasm_x64.lua +1 -1
- data/lua-hooks/ext/luajit/dynasm/dasm_x86.h +34 -7
- data/lua-hooks/ext/luajit/dynasm/dasm_x86.lua +427 -102
- data/lua-hooks/ext/luajit/dynasm/dynasm.lua +5 -5
- data/lua-hooks/ext/luajit/etc/luajit.1 +1 -1
- data/lua-hooks/ext/luajit/etc/luajit.pc +1 -1
- data/lua-hooks/ext/luajit/src/Makefile +36 -21
- data/lua-hooks/ext/luajit/src/Makefile.dep +3 -1
- data/lua-hooks/ext/luajit/src/host/buildvm.c +1 -1
- data/lua-hooks/ext/luajit/src/host/buildvm.h +1 -1
- data/lua-hooks/ext/luajit/src/host/buildvm_asm.c +10 -1
- data/lua-hooks/ext/luajit/src/host/buildvm_fold.c +1 -1
- data/lua-hooks/ext/luajit/src/host/buildvm_lib.c +1 -1
- data/lua-hooks/ext/luajit/src/host/buildvm_peobj.c +1 -1
- data/lua-hooks/ext/luajit/src/host/genlibbc.lua +1 -1
- data/lua-hooks/ext/luajit/src/host/genminilua.lua +1 -1
- data/lua-hooks/ext/luajit/src/jit/bc.lua +1 -1
- data/lua-hooks/ext/luajit/src/jit/bcsave.lua +2 -2
- data/lua-hooks/ext/luajit/src/jit/dis_arm.lua +1 -1
- data/lua-hooks/ext/luajit/src/jit/dis_mips.lua +1 -1
- data/lua-hooks/ext/luajit/src/jit/dis_mipsel.lua +1 -1
- data/lua-hooks/ext/luajit/src/jit/dis_ppc.lua +1 -1
- data/lua-hooks/ext/luajit/src/jit/dis_x64.lua +1 -1
- data/lua-hooks/ext/luajit/src/jit/dis_x86.lua +163 -73
- data/lua-hooks/ext/luajit/src/jit/dump.lua +2 -1
- data/lua-hooks/ext/luajit/src/jit/p.lua +1 -1
- data/lua-hooks/ext/luajit/src/jit/v.lua +1 -1
- data/lua-hooks/ext/luajit/src/jit/zone.lua +1 -1
- data/lua-hooks/ext/luajit/src/lib_aux.c +1 -1
- data/lua-hooks/ext/luajit/src/lib_base.c +4 -5
- data/lua-hooks/ext/luajit/src/lib_bit.c +1 -1
- data/lua-hooks/ext/luajit/src/lib_debug.c +1 -1
- data/lua-hooks/ext/luajit/src/lib_ffi.c +2 -5
- data/lua-hooks/ext/luajit/src/lib_init.c +1 -1
- data/lua-hooks/ext/luajit/src/lib_io.c +2 -3
- data/lua-hooks/ext/luajit/src/lib_jit.c +1 -1
- data/lua-hooks/ext/luajit/src/lib_math.c +1 -1
- data/lua-hooks/ext/luajit/src/lib_os.c +2 -2
- data/lua-hooks/ext/luajit/src/lib_package.c +1 -1
- data/lua-hooks/ext/luajit/src/lib_string.c +1 -1
- data/lua-hooks/ext/luajit/src/lib_table.c +1 -1
- data/lua-hooks/ext/luajit/src/lj.supp +15 -0
- data/lua-hooks/ext/luajit/src/lj_alloc.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_api.c +4 -1
- data/lua-hooks/ext/luajit/src/lj_arch.h +33 -7
- data/lua-hooks/ext/luajit/src/lj_asm.c +12 -5
- data/lua-hooks/ext/luajit/src/lj_asm.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_asm_arm.h +3 -13
- data/lua-hooks/ext/luajit/src/lj_asm_mips.h +337 -71
- data/lua-hooks/ext/luajit/src/lj_asm_ppc.h +2 -2
- data/lua-hooks/ext/luajit/src/lj_asm_x86.h +2 -2
- data/lua-hooks/ext/luajit/src/lj_bc.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_bc.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_bcdump.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_bcread.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_bcwrite.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_buf.c +2 -4
- data/lua-hooks/ext/luajit/src/lj_buf.h +1 -3
- data/lua-hooks/ext/luajit/src/lj_carith.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_carith.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_ccall.c +37 -14
- data/lua-hooks/ext/luajit/src/lj_ccall.h +3 -3
- data/lua-hooks/ext/luajit/src/lj_ccallback.c +16 -7
- data/lua-hooks/ext/luajit/src/lj_ccallback.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_cconv.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_cconv.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_cdata.c +10 -1
- data/lua-hooks/ext/luajit/src/lj_cdata.h +3 -1
- data/lua-hooks/ext/luajit/src/lj_clib.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_clib.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_cparse.c +27 -6
- data/lua-hooks/ext/luajit/src/lj_cparse.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_crecord.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_crecord.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_ctype.c +10 -8
- data/lua-hooks/ext/luajit/src/lj_ctype.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_debug.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_debug.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_def.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_dispatch.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_dispatch.h +21 -4
- data/lua-hooks/ext/luajit/src/lj_emit_arm.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_emit_mips.h +7 -5
- data/lua-hooks/ext/luajit/src/lj_emit_ppc.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_emit_x86.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_err.c +69 -31
- data/lua-hooks/ext/luajit/src/lj_err.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_errmsg.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_ff.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_ffrecord.c +10 -40
- data/lua-hooks/ext/luajit/src/lj_ffrecord.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_frame.h +12 -1
- data/lua-hooks/ext/luajit/src/lj_func.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_func.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_gc.c +2 -2
- data/lua-hooks/ext/luajit/src/lj_gc.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_gdbjit.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_gdbjit.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_ir.c +31 -15
- data/lua-hooks/ext/luajit/src/lj_ir.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_ircall.h +29 -1
- data/lua-hooks/ext/luajit/src/lj_iropt.h +2 -1
- data/lua-hooks/ext/luajit/src/lj_jit.h +2 -1
- data/lua-hooks/ext/luajit/src/lj_lex.c +28 -1
- data/lua-hooks/ext/luajit/src/lj_lex.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_lib.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_lib.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_load.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_mcode.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_mcode.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_meta.c +8 -8
- data/lua-hooks/ext/luajit/src/lj_meta.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_obj.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_obj.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_opt_dce.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_opt_fold.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_opt_loop.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_opt_mem.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_opt_narrow.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_opt_sink.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_opt_split.c +10 -5
- data/lua-hooks/ext/luajit/src/lj_parse.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_parse.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_profile.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_profile.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_record.c +13 -5
- data/lua-hooks/ext/luajit/src/lj_record.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_snap.c +20 -23
- data/lua-hooks/ext/luajit/src/lj_snap.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_state.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_state.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_str.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_str.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_strfmt.c +12 -98
- data/lua-hooks/ext/luajit/src/lj_strfmt.h +4 -4
- data/lua-hooks/ext/luajit/src/lj_strfmt_num.c +591 -0
- data/lua-hooks/ext/luajit/src/lj_strscan.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_strscan.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_tab.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_tab.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_target.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_target_arm.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_target_arm64.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_target_mips.h +30 -2
- data/lua-hooks/ext/luajit/src/lj_target_ppc.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_target_x86.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_trace.c +7 -2
- data/lua-hooks/ext/luajit/src/lj_trace.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_traceerr.h +1 -3
- data/lua-hooks/ext/luajit/src/lj_udata.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_udata.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_vm.h +5 -3
- data/lua-hooks/ext/luajit/src/lj_vmevent.c +1 -1
- data/lua-hooks/ext/luajit/src/lj_vmevent.h +1 -1
- data/lua-hooks/ext/luajit/src/lj_vmmath.c +15 -15
- data/lua-hooks/ext/luajit/src/ljamalg.c +2 -1
- data/lua-hooks/ext/luajit/src/lua.h +1 -0
- data/lua-hooks/ext/luajit/src/luaconf.h +2 -2
- data/lua-hooks/ext/luajit/src/luajit.c +1 -1
- data/lua-hooks/ext/luajit/src/luajit.h +4 -4
- data/lua-hooks/ext/luajit/src/lualib.h +1 -1
- data/lua-hooks/ext/luajit/src/msvcbuild.bat +1 -1
- data/lua-hooks/ext/luajit/src/ps4build.bat +26 -6
- data/lua-hooks/ext/luajit/src/vm_arm.dasc +17 -9
- data/lua-hooks/ext/luajit/src/vm_arm64.dasc +1 -1
- data/lua-hooks/ext/luajit/src/vm_mips.dasc +1562 -656
- data/lua-hooks/ext/luajit/src/vm_ppc.dasc +3 -7
- data/lua-hooks/ext/luajit/src/vm_x64.dasc +10 -2
- data/lua-hooks/ext/luajit/src/vm_x86.dasc +5 -8
- data/lua-hooks/ext/luautf8/module.mk +2 -0
- data/lua-hooks/ext/module.mk +15 -0
- data/lua-hooks/ext/modules.h +17 -0
- data/lua-hooks/ext/perf/luacpu.c +1 -1
- data/lua-hooks/ext/perf/lualoadavg.c +1 -1
- data/lua-hooks/ext/perf/luameminfo.c +1 -1
- data/lua-hooks/ext/perf/luaoslib.c +124 -2
- data/lua-hooks/ext/perf/module.mk +5 -0
- data/lua-hooks/ext/sha1/luasha1.c +4 -2
- data/lua-hooks/ext/sha1/module.mk +5 -0
- data/lua-hooks/ext/sha2/luasha256.c +4 -2
- data/lua-hooks/ext/sha2/module.mk +5 -0
- data/lua-hooks/ext/sysutils/lua_utils.c +56 -0
- data/lua-hooks/ext/sysutils/module.mk +2 -0
- data/lua-hooks/lib/boot.lua +2 -1
- data/lua-hooks/lib/hooks/module.mk +31 -0
- data/lua-hooks/lib/hooks/xss/module.mk +4 -0
- data/lua-hooks/lib/lexers/module.mk +10 -0
- data/lua-hooks/lib/module.mk +38 -0
- data/lua-hooks/lib/schema/module.mk +3 -0
- data/lua-hooks/options.mk +59 -0
- metadata +21 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
-- DynASM. A dynamic assembler for code generation engines.
|
|
3
3
|
-- Originally designed and implemented for LuaJIT.
|
|
4
4
|
--
|
|
5
|
-
-- Copyright (C) 2005-
|
|
5
|
+
-- Copyright (C) 2005-2016 Mike Pall. All rights reserved.
|
|
6
6
|
-- See below for full copyright notice.
|
|
7
7
|
------------------------------------------------------------------------------
|
|
8
8
|
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
local _info = {
|
|
11
11
|
name = "DynASM",
|
|
12
12
|
description = "A dynamic assembler for code generation engines",
|
|
13
|
-
version = "1.
|
|
14
|
-
vernum =
|
|
15
|
-
release = "
|
|
13
|
+
version = "1.4.0",
|
|
14
|
+
vernum = 10400,
|
|
15
|
+
release = "2015-10-18",
|
|
16
16
|
author = "Mike Pall",
|
|
17
17
|
url = "http://luajit.org/dynasm.html",
|
|
18
18
|
license = "MIT",
|
|
19
19
|
copyright = [[
|
|
20
|
-
Copyright (C) 2005-
|
|
20
|
+
Copyright (C) 2005-2016 Mike Pall. All rights reserved.
|
|
21
21
|
|
|
22
22
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
23
23
|
a copy of this software and associated documentation files (the
|
|
@@ -74,7 +74,7 @@ luajit \-jv \-e "for i=1,10 do for j=1,10 do for k=1,100 do end end end"
|
|
|
74
74
|
Runs some nested loops and shows the resulting traces.
|
|
75
75
|
.SH COPYRIGHT
|
|
76
76
|
.PP
|
|
77
|
-
\fBLuaJIT\fR is Copyright \(co 2005-
|
|
77
|
+
\fBLuaJIT\fR is Copyright \(co 2005-2016 Mike Pall.
|
|
78
78
|
.br
|
|
79
79
|
\fBLuaJIT\fR is open source software, released under the MIT license.
|
|
80
80
|
.SH SEE ALSO
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
# Also works with MinGW and Cygwin on Windows.
|
|
8
8
|
# Please check msvcbuild.bat for building with MSVC on Windows.
|
|
9
9
|
#
|
|
10
|
-
# Copyright (C) 2005-
|
|
10
|
+
# Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
|
|
11
11
|
##############################################################################
|
|
12
12
|
|
|
13
13
|
MAJVER= 2
|
|
@@ -24,11 +24,13 @@ NODOTABIVER= 51
|
|
|
24
24
|
# removing the '#' in front of them. Make sure you force a full recompile
|
|
25
25
|
# with "make clean", followed by "make" if you change any options.
|
|
26
26
|
#
|
|
27
|
+
DEFAULT_CC = gcc
|
|
28
|
+
#
|
|
27
29
|
# LuaJIT builds as a native 32 or 64 bit binary by default.
|
|
28
|
-
CC=
|
|
30
|
+
CC= $(DEFAULT_CC)
|
|
29
31
|
#
|
|
30
32
|
# Use this if you want to force a 32 bit build on a 64 bit multilib OS.
|
|
31
|
-
#CC=
|
|
33
|
+
#CC= $(DEFAULT_CC) -m32
|
|
32
34
|
#
|
|
33
35
|
# Since the assembler part does NOT maintain a frame pointer, it's pointless
|
|
34
36
|
# to slow down the C part by not omitting it. Debugging, tracebacks and
|
|
@@ -147,6 +149,29 @@ XCFLAGS=
|
|
|
147
149
|
# You probably don't need to change anything below this line!
|
|
148
150
|
##############################################################################
|
|
149
151
|
|
|
152
|
+
##############################################################################
|
|
153
|
+
# Host system detection.
|
|
154
|
+
##############################################################################
|
|
155
|
+
|
|
156
|
+
ifeq (Windows,$(findstring Windows,$(OS))$(MSYSTEM)$(TERM))
|
|
157
|
+
HOST_SYS= Windows
|
|
158
|
+
HOST_RM= del
|
|
159
|
+
else
|
|
160
|
+
HOST_SYS:= $(shell uname -s)
|
|
161
|
+
ifneq (,$(findstring MINGW,$(HOST_SYS)))
|
|
162
|
+
HOST_SYS= Windows
|
|
163
|
+
HOST_MSYS= mingw
|
|
164
|
+
endif
|
|
165
|
+
ifneq (,$(findstring CYGWIN,$(HOST_SYS)))
|
|
166
|
+
HOST_SYS= Windows
|
|
167
|
+
HOST_MSYS= cygwin
|
|
168
|
+
endif
|
|
169
|
+
# Use Clang for OSX host.
|
|
170
|
+
ifeq (Darwin,$(HOST_SYS))
|
|
171
|
+
DEFAULT_CC= clang
|
|
172
|
+
endif
|
|
173
|
+
endif
|
|
174
|
+
|
|
150
175
|
##############################################################################
|
|
151
176
|
# Flags and options for host and target.
|
|
152
177
|
##############################################################################
|
|
@@ -268,24 +293,9 @@ ifneq (,$(LMULTILIB))
|
|
|
268
293
|
endif
|
|
269
294
|
|
|
270
295
|
##############################################################################
|
|
271
|
-
#
|
|
296
|
+
# Target system detection.
|
|
272
297
|
##############################################################################
|
|
273
298
|
|
|
274
|
-
ifeq (Windows,$(findstring Windows,$(OS))$(MSYSTEM)$(TERM))
|
|
275
|
-
HOST_SYS= Windows
|
|
276
|
-
HOST_RM= del
|
|
277
|
-
else
|
|
278
|
-
HOST_SYS:= $(shell uname -s)
|
|
279
|
-
ifneq (,$(findstring MINGW,$(HOST_SYS)))
|
|
280
|
-
HOST_SYS= Windows
|
|
281
|
-
HOST_MSYS= mingw
|
|
282
|
-
endif
|
|
283
|
-
ifneq (,$(findstring CYGWIN,$(HOST_SYS)))
|
|
284
|
-
HOST_SYS= Windows
|
|
285
|
-
HOST_MSYS= cygwin
|
|
286
|
-
endif
|
|
287
|
-
endif
|
|
288
|
-
|
|
289
299
|
TARGET_SYS?= $(HOST_SYS)
|
|
290
300
|
ifeq (Windows,$(TARGET_SYS))
|
|
291
301
|
TARGET_STRIP+= --strip-unneeded
|
|
@@ -378,6 +388,11 @@ DASM_XFLAGS=
|
|
|
378
388
|
DASM_AFLAGS=
|
|
379
389
|
DASM_ARCH= $(TARGET_LJARCH)
|
|
380
390
|
|
|
391
|
+
ifneq (,$(findstring LJ_LE 1,$(TARGET_TESTARCH)))
|
|
392
|
+
DASM_AFLAGS+= -D ENDIAN_LE
|
|
393
|
+
else
|
|
394
|
+
DASM_AFLAGS+= -D ENDIAN_BE
|
|
395
|
+
endif
|
|
381
396
|
ifneq (,$(findstring LJ_ARCH_BITS 64,$(TARGET_TESTARCH)))
|
|
382
397
|
DASM_AFLAGS+= -D P64
|
|
383
398
|
endif
|
|
@@ -463,7 +478,7 @@ LJLIB_C= $(LJLIB_O:.o=.c)
|
|
|
463
478
|
LJCORE_O= lj_gc.o lj_err.o lj_char.o lj_bc.o lj_obj.o lj_buf.o \
|
|
464
479
|
lj_str.o lj_tab.o lj_func.o lj_udata.o lj_meta.o lj_debug.o \
|
|
465
480
|
lj_state.o lj_dispatch.o lj_vmevent.o lj_vmmath.o lj_strscan.o \
|
|
466
|
-
lj_strfmt.o lj_api.o lj_profile.o \
|
|
481
|
+
lj_strfmt.o lj_strfmt_num.o lj_api.o lj_profile.o \
|
|
467
482
|
lj_lex.o lj_parse.o lj_bcread.o lj_bcwrite.o lj_load.o \
|
|
468
483
|
lj_ir.o lj_opt_mem.o lj_opt_fold.o lj_opt_narrow.o \
|
|
469
484
|
lj_opt_dce.o lj_opt_loop.o lj_opt_split.o lj_opt_sink.o \
|
|
@@ -612,7 +627,7 @@ $(MINILUA_T): $(MINILUA_O)
|
|
|
612
627
|
$(E) "HOSTLINK $@"
|
|
613
628
|
$(Q)$(HOST_CC) $(HOST_ALDFLAGS) -o $@ $(MINILUA_O) $(MINILUA_LIBS) $(HOST_ALIBS)
|
|
614
629
|
|
|
615
|
-
host/buildvm_arch.h: $(DASM_DASC) $(DASM_DEP)
|
|
630
|
+
host/buildvm_arch.h: $(DASM_DASC) $(DASM_DEP) $(DASM_DIR)/*.lua
|
|
616
631
|
$(E) "DYNASM $@"
|
|
617
632
|
$(Q)$(DASM) $(DASM_FLAGS) -o $@ $(DASM_DASC)
|
|
618
633
|
|
|
@@ -94,7 +94,7 @@ lj_crecord.o: lj_crecord.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \
|
|
|
94
94
|
lj_crecord.h lj_strfmt.h
|
|
95
95
|
lj_ctype.o: lj_ctype.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \
|
|
96
96
|
lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_strfmt.h lj_ctype.h \
|
|
97
|
-
lj_ccallback.h
|
|
97
|
+
lj_ccallback.h lj_buf.h
|
|
98
98
|
lj_debug.o: lj_debug.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \
|
|
99
99
|
lj_err.h lj_errmsg.h lj_debug.h lj_buf.h lj_gc.h lj_str.h lj_tab.h \
|
|
100
100
|
lj_state.h lj_frame.h lj_bc.h lj_strfmt.h lj_jit.h lj_ir.h
|
|
@@ -188,6 +188,8 @@ lj_str.o: lj_str.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \
|
|
|
188
188
|
lj_err.h lj_errmsg.h lj_str.h lj_char.h
|
|
189
189
|
lj_strfmt.o: lj_strfmt.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \
|
|
190
190
|
lj_buf.h lj_gc.h lj_str.h lj_state.h lj_char.h lj_strfmt.h
|
|
191
|
+
lj_strfmt_num.o: lj_strfmt_num.c lj_obj.h lua.h luaconf.h lj_def.h \
|
|
192
|
+
lj_arch.h lj_buf.h lj_gc.h lj_str.h lj_strfmt.h
|
|
191
193
|
lj_strscan.o: lj_strscan.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \
|
|
192
194
|
lj_char.h lj_strscan.h
|
|
193
195
|
lj_tab.o: lj_tab.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
** LuaJIT VM builder.
|
|
3
|
-
** Copyright (C) 2005-
|
|
3
|
+
** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
|
|
4
4
|
**
|
|
5
5
|
** This is a tool to build the hand-tuned assembler code required for
|
|
6
6
|
** LuaJIT's bytecode interpreter. It supports a variety of output formats
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
** LuaJIT VM builder: Assembler source code emitter.
|
|
3
|
-
** Copyright (C) 2005-
|
|
3
|
+
** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
#include "buildvm.h"
|
|
@@ -261,11 +261,20 @@ void emit_asm(BuildCtx *ctx)
|
|
|
261
261
|
|
|
262
262
|
#if LJ_TARGET_ARM && defined(__GNUC__) && !LJ_NO_UNWIND
|
|
263
263
|
/* This should really be moved into buildvm_arm.dasc. */
|
|
264
|
+
#if LJ_ARCH_HASFPU
|
|
265
|
+
fprintf(ctx->fp,
|
|
266
|
+
".fnstart\n"
|
|
267
|
+
".save {r5, r6, r7, r8, r9, r10, r11, lr}\n"
|
|
268
|
+
".vsave {d8-d15}\n"
|
|
269
|
+
".save {r4}\n"
|
|
270
|
+
".pad #28\n");
|
|
271
|
+
#else
|
|
264
272
|
fprintf(ctx->fp,
|
|
265
273
|
".fnstart\n"
|
|
266
274
|
".save {r4, r5, r6, r7, r8, r9, r10, r11, lr}\n"
|
|
267
275
|
".pad #28\n");
|
|
268
276
|
#endif
|
|
277
|
+
#endif
|
|
269
278
|
#if LJ_TARGET_MIPS
|
|
270
279
|
fprintf(ctx->fp, ".set nomips16\n.abicalls\n.set noreorder\n.set nomacro\n");
|
|
271
280
|
#endif
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
** LuaJIT VM builder: PE object emitter.
|
|
3
|
-
** Copyright (C) 2005-
|
|
3
|
+
** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
|
|
4
4
|
**
|
|
5
5
|
** Only used for building on Windows, since we cannot assume the presence
|
|
6
6
|
** of a suitable assembler. The host and target byte order must match.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
-- Lua script to dump the bytecode of the library functions written in Lua.
|
|
3
3
|
-- The resulting 'buildvm_libbc.h' is used for the build process of LuaJIT.
|
|
4
4
|
----------------------------------------------------------------------------
|
|
5
|
-
-- Copyright (C) 2005-
|
|
5
|
+
-- Copyright (C) 2005-2016 Mike Pall. All rights reserved.
|
|
6
6
|
-- Released under the MIT license. See Copyright Notice in luajit.h
|
|
7
7
|
----------------------------------------------------------------------------
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
-- Lua script to generate a customized, minified version of Lua.
|
|
3
3
|
-- The resulting 'minilua' is used for the build process of LuaJIT.
|
|
4
4
|
----------------------------------------------------------------------------
|
|
5
|
-
-- Copyright (C) 2005-
|
|
5
|
+
-- Copyright (C) 2005-2016 Mike Pall. All rights reserved.
|
|
6
6
|
-- Released under the MIT license. See Copyright Notice in luajit.h
|
|
7
7
|
----------------------------------------------------------------------------
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
----------------------------------------------------------------------------
|
|
2
2
|
-- LuaJIT bytecode listing module.
|
|
3
3
|
--
|
|
4
|
-
-- Copyright (C) 2005-
|
|
4
|
+
-- Copyright (C) 2005-2016 Mike Pall. All rights reserved.
|
|
5
5
|
-- Released under the MIT license. See Copyright Notice in luajit.h
|
|
6
6
|
----------------------------------------------------------------------------
|
|
7
7
|
--
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
----------------------------------------------------------------------------
|
|
2
2
|
-- LuaJIT module to save/list bytecode.
|
|
3
3
|
--
|
|
4
|
-
-- Copyright (C) 2005-
|
|
4
|
+
-- Copyright (C) 2005-2016 Mike Pall. All rights reserved.
|
|
5
5
|
-- Released under the MIT license. See Copyright Notice in luajit.h
|
|
6
6
|
----------------------------------------------------------------------------
|
|
7
7
|
--
|
|
@@ -200,7 +200,7 @@ typedef struct {
|
|
|
200
200
|
]]
|
|
201
201
|
local symname = LJBC_PREFIX..ctx.modname
|
|
202
202
|
local is64, isbe = false, false
|
|
203
|
-
if ctx.arch == "x64" then
|
|
203
|
+
if ctx.arch == "x64" or ctx.arch == "arm64" then
|
|
204
204
|
is64 = true
|
|
205
205
|
elseif ctx.arch == "ppc" or ctx.arch == "mips" then
|
|
206
206
|
isbe = true
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
----------------------------------------------------------------------------
|
|
2
2
|
-- LuaJIT ARM disassembler module.
|
|
3
3
|
--
|
|
4
|
-
-- Copyright (C) 2005-
|
|
4
|
+
-- Copyright (C) 2005-2016 Mike Pall. All rights reserved.
|
|
5
5
|
-- Released under the MIT license. See Copyright Notice in luajit.h
|
|
6
6
|
----------------------------------------------------------------------------
|
|
7
7
|
-- This is a helper module used by the LuaJIT machine code dumper module.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
----------------------------------------------------------------------------
|
|
2
2
|
-- LuaJIT MIPS disassembler module.
|
|
3
3
|
--
|
|
4
|
-
-- Copyright (C) 2005-
|
|
4
|
+
-- Copyright (C) 2005-2016 Mike Pall. All rights reserved.
|
|
5
5
|
-- Released under the MIT/X license. See Copyright Notice in luajit.h
|
|
6
6
|
----------------------------------------------------------------------------
|
|
7
7
|
-- This is a helper module used by the LuaJIT machine code dumper module.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
----------------------------------------------------------------------------
|
|
2
2
|
-- LuaJIT MIPSEL disassembler wrapper module.
|
|
3
3
|
--
|
|
4
|
-
-- Copyright (C) 2005-
|
|
4
|
+
-- Copyright (C) 2005-2016 Mike Pall. All rights reserved.
|
|
5
5
|
-- Released under the MIT license. See Copyright Notice in luajit.h
|
|
6
6
|
----------------------------------------------------------------------------
|
|
7
7
|
-- This module just exports the little-endian functions from the
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
----------------------------------------------------------------------------
|
|
2
2
|
-- LuaJIT PPC disassembler module.
|
|
3
3
|
--
|
|
4
|
-
-- Copyright (C) 2005-
|
|
4
|
+
-- Copyright (C) 2005-2016 Mike Pall. All rights reserved.
|
|
5
5
|
-- Released under the MIT/X license. See Copyright Notice in luajit.h
|
|
6
6
|
----------------------------------------------------------------------------
|
|
7
7
|
-- This is a helper module used by the LuaJIT machine code dumper module.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
----------------------------------------------------------------------------
|
|
2
2
|
-- LuaJIT x64 disassembler wrapper module.
|
|
3
3
|
--
|
|
4
|
-
-- Copyright (C) 2005-
|
|
4
|
+
-- Copyright (C) 2005-2016 Mike Pall. All rights reserved.
|
|
5
5
|
-- Released under the MIT license. See Copyright Notice in luajit.h
|
|
6
6
|
----------------------------------------------------------------------------
|
|
7
7
|
-- This module just exports the 64 bit functions from the combined
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
----------------------------------------------------------------------------
|
|
2
2
|
-- LuaJIT x86/x64 disassembler module.
|
|
3
3
|
--
|
|
4
|
-
-- Copyright (C) 2005-
|
|
4
|
+
-- Copyright (C) 2005-2016 Mike Pall. All rights reserved.
|
|
5
5
|
-- Released under the MIT license. See Copyright Notice in luajit.h
|
|
6
6
|
----------------------------------------------------------------------------
|
|
7
7
|
-- This is a helper module used by the LuaJIT machine code dumper module.
|
|
@@ -15,13 +15,12 @@
|
|
|
15
15
|
-- Intel and AMD manuals. The supported instruction set is quite extensive
|
|
16
16
|
-- and reflects what a current generation Intel or AMD CPU implements in
|
|
17
17
|
-- 32 bit and 64 bit mode. Yes, this includes MMX, SSE, SSE2, SSE3, SSSE3,
|
|
18
|
-
-- SSE4.1, SSE4.2, SSE4a and even privileged and hypervisor
|
|
19
|
-
-- instructions.
|
|
18
|
+
-- SSE4.1, SSE4.2, SSE4a, AVX, AVX2 and even privileged and hypervisor
|
|
19
|
+
-- (VMX/SVM) instructions.
|
|
20
20
|
--
|
|
21
21
|
-- Notes:
|
|
22
22
|
-- * The (useless) a16 prefix, 3DNow and pre-586 opcodes are unsupported.
|
|
23
23
|
-- * No attempt at optimization has been made -- it's fast enough for my needs.
|
|
24
|
-
-- * The public API may change when more architectures are added.
|
|
25
24
|
------------------------------------------------------------------------------
|
|
26
25
|
|
|
27
26
|
local type = type
|
|
@@ -78,7 +77,7 @@ local map_opc1_32 = {
|
|
|
78
77
|
"movBRi","movBRi","movBRi","movBRi","movBRi","movBRi","movBRi","movBRi",
|
|
79
78
|
"movVRI","movVRI","movVRI","movVRI","movVRI","movVRI","movVRI","movVRI",
|
|
80
79
|
--Cx
|
|
81
|
-
"shift!Bmu","shift!Vmu","retBw","ret","$lesVrm","$ldsVrm","movBmi","movVmi",
|
|
80
|
+
"shift!Bmu","shift!Vmu","retBw","ret","vex*3$lesVrm","vex*2$ldsVrm","movBmi","movVmi",
|
|
82
81
|
"enterBwu","leave","retfBw","retf","int3","intBu","into","iretVS",
|
|
83
82
|
--Dx
|
|
84
83
|
"shift!Bm1","shift!Vm1","shift!Bmc","shift!Vmc","aamBu","aadBu","salc","xlatb",
|
|
@@ -103,7 +102,7 @@ local map_opc1_64 = setmetatable({
|
|
|
103
102
|
[0x44]="rex*r", [0x45]="rex*rb", [0x46]="rex*rx", [0x47]="rex*rxb",
|
|
104
103
|
[0x48]="rex*w", [0x49]="rex*wb", [0x4a]="rex*wx", [0x4b]="rex*wxb",
|
|
105
104
|
[0x4c]="rex*wr", [0x4d]="rex*wrb", [0x4e]="rex*wrx", [0x4f]="rex*wrxb",
|
|
106
|
-
[0x82]=false, [0x9a]=false, [0xc4]=
|
|
105
|
+
[0x82]=false, [0x9a]=false, [0xc4]="vex*3", [0xc5]="vex*2", [0xce]=false,
|
|
107
106
|
[0xd4]=false, [0xd5]=false, [0xd6]=false, [0xea]=false,
|
|
108
107
|
}, { __index = map_opc1_32 })
|
|
109
108
|
|
|
@@ -114,12 +113,12 @@ local map_opc2 = {
|
|
|
114
113
|
[0]="sldt!Dmp","sgdt!Ump","larVrm","lslVrm",nil,"syscall","clts","sysret",
|
|
115
114
|
"invd","wbinvd",nil,"ud1",nil,"$prefetch!Bm","femms","3dnowMrmu",
|
|
116
115
|
--1x
|
|
117
|
-
"movupsXrm|
|
|
118
|
-
"movupsXmr|
|
|
116
|
+
"movupsXrm|movssXrvm|movupdXrm|movsdXrvm",
|
|
117
|
+
"movupsXmr|movssXmvr|movupdXmr|movsdXmvr",
|
|
119
118
|
"movhlpsXrm$movlpsXrm|movsldupXrm|movlpdXrm|movddupXrm",
|
|
120
119
|
"movlpsXmr||movlpdXmr",
|
|
121
|
-
"
|
|
122
|
-
"
|
|
120
|
+
"unpcklpsXrvm||unpcklpdXrvm",
|
|
121
|
+
"unpckhpsXrvm||unpckhpdXrvm",
|
|
123
122
|
"movlhpsXrm$movhpsXrm|movshdupXrm|movhpdXrm",
|
|
124
123
|
"movhpsXmr||movhpdXmr",
|
|
125
124
|
"$prefetcht!Bm","hintnopVm","hintnopVm","hintnopVm",
|
|
@@ -128,7 +127,7 @@ local map_opc2 = {
|
|
|
128
127
|
"movUmx$","movUmy$","movUxm$","movUym$","movUmz$",nil,"movUzm$",nil,
|
|
129
128
|
"movapsXrm||movapdXrm",
|
|
130
129
|
"movapsXmr||movapdXmr",
|
|
131
|
-
"cvtpi2psXrMm|
|
|
130
|
+
"cvtpi2psXrMm|cvtsi2ssXrvVmt|cvtpi2pdXrMm|cvtsi2sdXrvVmt",
|
|
132
131
|
"movntpsXmr|movntssXmr|movntpdXmr|movntsdXmr",
|
|
133
132
|
"cvttps2piMrXm|cvttss2siVrXm|cvttpd2piMrXm|cvttsd2siVrXm",
|
|
134
133
|
"cvtps2piMrXm|cvtss2siVrXm|cvtpd2piMrXm|cvtsd2siVrXm",
|
|
@@ -144,27 +143,27 @@ local map_opc2 = {
|
|
|
144
143
|
"cmovlVrm","cmovgeVrm","cmovleVrm","cmovgVrm",
|
|
145
144
|
--5x
|
|
146
145
|
"movmskpsVrXm$||movmskpdVrXm$","sqrtpsXrm|sqrtssXrm|sqrtpdXrm|sqrtsdXrm",
|
|
147
|
-
"rsqrtpsXrm|
|
|
148
|
-
"
|
|
149
|
-
"
|
|
150
|
-
"
|
|
151
|
-
"cvtps2pdXrm|
|
|
146
|
+
"rsqrtpsXrm|rsqrtssXrvm","rcppsXrm|rcpssXrvm",
|
|
147
|
+
"andpsXrvm||andpdXrvm","andnpsXrvm||andnpdXrvm",
|
|
148
|
+
"orpsXrvm||orpdXrvm","xorpsXrvm||xorpdXrvm",
|
|
149
|
+
"addpsXrvm|addssXrvm|addpdXrvm|addsdXrvm","mulpsXrvm|mulssXrvm|mulpdXrvm|mulsdXrvm",
|
|
150
|
+
"cvtps2pdXrm|cvtss2sdXrvm|cvtpd2psXrm|cvtsd2ssXrvm",
|
|
152
151
|
"cvtdq2psXrm|cvttps2dqXrm|cvtps2dqXrm",
|
|
153
|
-
"
|
|
154
|
-
"
|
|
152
|
+
"subpsXrvm|subssXrvm|subpdXrvm|subsdXrvm","minpsXrvm|minssXrvm|minpdXrvm|minsdXrvm",
|
|
153
|
+
"divpsXrvm|divssXrvm|divpdXrvm|divsdXrvm","maxpsXrvm|maxssXrvm|maxpdXrvm|maxsdXrvm",
|
|
155
154
|
--6x
|
|
156
|
-
"
|
|
157
|
-
"
|
|
158
|
-
"
|
|
159
|
-
"||
|
|
155
|
+
"punpcklbwPrvm","punpcklwdPrvm","punpckldqPrvm","packsswbPrvm",
|
|
156
|
+
"pcmpgtbPrvm","pcmpgtwPrvm","pcmpgtdPrvm","packuswbPrvm",
|
|
157
|
+
"punpckhbwPrvm","punpckhwdPrvm","punpckhdqPrvm","packssdwPrvm",
|
|
158
|
+
"||punpcklqdqXrvm","||punpckhqdqXrvm",
|
|
160
159
|
"movPrVSm","movqMrm|movdquXrm|movdqaXrm",
|
|
161
160
|
--7x
|
|
162
|
-
"pshufwMrmu|pshufhwXrmu|pshufdXrmu|pshuflwXrmu","pshiftw!
|
|
163
|
-
"pshiftd!
|
|
164
|
-
"
|
|
161
|
+
"pshufwMrmu|pshufhwXrmu|pshufdXrmu|pshuflwXrmu","pshiftw!Pvmu",
|
|
162
|
+
"pshiftd!Pvmu","pshiftq!Mvmu||pshiftdq!Xvmu",
|
|
163
|
+
"pcmpeqbPrvm","pcmpeqwPrvm","pcmpeqdPrvm","emms*|",
|
|
165
164
|
"vmreadUmr||extrqXmuu$|insertqXrmuu$","vmwriteUrm||extrqXrm$|insertqXrm$",
|
|
166
165
|
nil,nil,
|
|
167
|
-
"||
|
|
166
|
+
"||haddpdXrvm|haddpsXrvm","||hsubpdXrvm|hsubpsXrvm",
|
|
168
167
|
"movVSmMr|movqXrm|movVSmXr","movqMmr|movdquXmr|movdqaXmr",
|
|
169
168
|
--8x
|
|
170
169
|
"joVj","jnoVj","jbVj","jnbVj","jzVj","jnzVj","jbeVj","jaVj",
|
|
@@ -182,27 +181,27 @@ nil,nil,
|
|
|
182
181
|
"bsfVrm","bsrVrm|lzcntVrm|bsrWrm","movsxVrBmt","movsxVrWmt",
|
|
183
182
|
--Cx
|
|
184
183
|
"xaddBmr","xaddVmr",
|
|
185
|
-
"
|
|
186
|
-
"
|
|
187
|
-
"
|
|
184
|
+
"cmppsXrvmu|cmpssXrvmu|cmppdXrvmu|cmpsdXrvmu","$movntiVmr|",
|
|
185
|
+
"pinsrwPrvWmu","pextrwDrPmu",
|
|
186
|
+
"shufpsXrvmu||shufpdXrvmu","$cmpxchg!Qmp",
|
|
188
187
|
"bswapVR","bswapVR","bswapVR","bswapVR","bswapVR","bswapVR","bswapVR","bswapVR",
|
|
189
188
|
--Dx
|
|
190
|
-
"||
|
|
191
|
-
"
|
|
189
|
+
"||addsubpdXrvm|addsubpsXrvm","psrlwPrvm","psrldPrvm","psrlqPrvm",
|
|
190
|
+
"paddqPrvm","pmullwPrvm",
|
|
192
191
|
"|movq2dqXrMm|movqXmr|movdq2qMrXm$","pmovmskbVrMm||pmovmskbVrXm",
|
|
193
|
-
"
|
|
194
|
-
"
|
|
192
|
+
"psubusbPrvm","psubuswPrvm","pminubPrvm","pandPrvm",
|
|
193
|
+
"paddusbPrvm","padduswPrvm","pmaxubPrvm","pandnPrvm",
|
|
195
194
|
--Ex
|
|
196
|
-
"
|
|
197
|
-
"
|
|
195
|
+
"pavgbPrvm","psrawPrvm","psradPrvm","pavgwPrvm",
|
|
196
|
+
"pmulhuwPrvm","pmulhwPrvm",
|
|
198
197
|
"|cvtdq2pdXrm|cvttpd2dqXrm|cvtpd2dqXrm","$movntqMmr||$movntdqXmr",
|
|
199
|
-
"
|
|
200
|
-
"
|
|
198
|
+
"psubsbPrvm","psubswPrvm","pminswPrvm","porPrvm",
|
|
199
|
+
"paddsbPrvm","paddswPrvm","pmaxswPrvm","pxorPrvm",
|
|
201
200
|
--Fx
|
|
202
|
-
"|||lddquXrm","
|
|
203
|
-
"
|
|
204
|
-
"
|
|
205
|
-
"
|
|
201
|
+
"|||lddquXrm","psllwPrvm","pslldPrvm","psllqPrvm",
|
|
202
|
+
"pmuludqPrvm","pmaddwdPrvm","psadbwPrvm","maskmovqMrm||maskmovdquXrm$",
|
|
203
|
+
"psubbPrvm","psubwPrvm","psubdPrvm","psubqPrvm",
|
|
204
|
+
"paddbPrvm","paddwPrvm","padddPrvm","ud",
|
|
206
205
|
}
|
|
207
206
|
assert(map_opc2[255] == "ud")
|
|
208
207
|
|
|
@@ -210,49 +209,70 @@ assert(map_opc2[255] == "ud")
|
|
|
210
209
|
local map_opc3 = {
|
|
211
210
|
["38"] = { -- [66] 0f 38 xx
|
|
212
211
|
--0x
|
|
213
|
-
[0]="
|
|
214
|
-
"
|
|
215
|
-
"
|
|
216
|
-
|
|
212
|
+
[0]="pshufbPrvm","phaddwPrvm","phadddPrvm","phaddswPrvm",
|
|
213
|
+
"pmaddubswPrvm","phsubwPrvm","phsubdPrvm","phsubswPrvm",
|
|
214
|
+
"psignbPrvm","psignwPrvm","psigndPrvm","pmulhrswPrvm",
|
|
215
|
+
"||permilpsXrvm","||permilpdXrvm",nil,nil,
|
|
217
216
|
--1x
|
|
218
217
|
"||pblendvbXrma",nil,nil,nil,
|
|
219
|
-
"||blendvpsXrma","||blendvpdXrma",
|
|
220
|
-
|
|
218
|
+
"||blendvpsXrma","||blendvpdXrma","||permpsXrvm","||ptestXrm",
|
|
219
|
+
"||broadcastssXrm","||broadcastsdXrm","||broadcastf128XrlXm",nil,
|
|
221
220
|
"pabsbPrm","pabswPrm","pabsdPrm",nil,
|
|
222
221
|
--2x
|
|
223
222
|
"||pmovsxbwXrm","||pmovsxbdXrm","||pmovsxbqXrm","||pmovsxwdXrm",
|
|
224
223
|
"||pmovsxwqXrm","||pmovsxdqXrm",nil,nil,
|
|
225
|
-
"||
|
|
226
|
-
|
|
224
|
+
"||pmuldqXrvm","||pcmpeqqXrvm","||$movntdqaXrm","||packusdwXrvm",
|
|
225
|
+
"||maskmovpsXrvm","||maskmovpdXrvm","||maskmovpsXmvr","||maskmovpdXmvr",
|
|
227
226
|
--3x
|
|
228
227
|
"||pmovzxbwXrm","||pmovzxbdXrm","||pmovzxbqXrm","||pmovzxwdXrm",
|
|
229
|
-
"||pmovzxwqXrm","||pmovzxdqXrm",
|
|
230
|
-
"||
|
|
231
|
-
"||
|
|
228
|
+
"||pmovzxwqXrm","||pmovzxdqXrm","||permdXrvm","||pcmpgtqXrvm",
|
|
229
|
+
"||pminsbXrvm","||pminsdXrvm","||pminuwXrvm","||pminudXrvm",
|
|
230
|
+
"||pmaxsbXrvm","||pmaxsdXrvm","||pmaxuwXrvm","||pmaxudXrvm",
|
|
232
231
|
--4x
|
|
233
|
-
"||
|
|
232
|
+
"||pmulddXrvm","||phminposuwXrm",nil,nil,
|
|
233
|
+
nil,"||psrlvVSXrvm","||psravdXrvm","||psllvVSXrvm",
|
|
234
|
+
--5x
|
|
235
|
+
[0x58] = "||pbroadcastdXrlXm",[0x59] = "||pbroadcastqXrlXm",
|
|
236
|
+
[0x5a] = "||broadcasti128XrlXm",
|
|
237
|
+
--7x
|
|
238
|
+
[0x78] = "||pbroadcastbXrlXm",[0x79] = "||pbroadcastwXrlXm",
|
|
239
|
+
--8x
|
|
240
|
+
[0x8c] = "||pmaskmovXrvVSm",
|
|
241
|
+
[0x8e] = "||pmaskmovVSmXvr",
|
|
242
|
+
--Dx
|
|
243
|
+
[0xdc] = "||aesencXrvm", [0xdd] = "||aesenclastXrvm",
|
|
244
|
+
[0xde] = "||aesdecXrvm", [0xdf] = "||aesdeclastXrvm",
|
|
234
245
|
--Fx
|
|
235
246
|
[0xf0] = "|||crc32TrBmt",[0xf1] = "|||crc32TrVmt",
|
|
236
247
|
},
|
|
237
248
|
|
|
238
249
|
["3a"] = { -- [66] 0f 3a xx
|
|
239
250
|
--0x
|
|
240
|
-
[0x00]=
|
|
241
|
-
"||
|
|
242
|
-
"||
|
|
251
|
+
[0x00]="||permqXrmu","||permpdXrmu","||pblenddXrvmu",nil,
|
|
252
|
+
"||permilpsXrmu","||permilpdXrmu","||perm2f128Xrvmu",nil,
|
|
253
|
+
"||roundpsXrmu","||roundpdXrmu","||roundssXrvmu","||roundsdXrvmu",
|
|
254
|
+
"||blendpsXrvmu","||blendpdXrvmu","||pblendwXrvmu","palignrPrvmu",
|
|
243
255
|
--1x
|
|
244
256
|
nil,nil,nil,nil,
|
|
245
257
|
"||pextrbVmXru","||pextrwVmXru","||pextrVmSXru","||extractpsVmXru",
|
|
246
|
-
|
|
258
|
+
"||insertf128XrvlXmu","||extractf128XlXmYru",nil,nil,
|
|
259
|
+
nil,nil,nil,nil,
|
|
247
260
|
--2x
|
|
248
|
-
"||
|
|
261
|
+
"||pinsrbXrvVmu","||insertpsXrvmu","||pinsrXrvVmuS",nil,
|
|
262
|
+
--3x
|
|
263
|
+
[0x38] = "||inserti128Xrvmu",[0x39] = "||extracti128XlXmYru",
|
|
249
264
|
--4x
|
|
250
|
-
[0x40] = "||
|
|
251
|
-
[0x41] = "||
|
|
252
|
-
[0x42] = "||
|
|
265
|
+
[0x40] = "||dppsXrvmu",
|
|
266
|
+
[0x41] = "||dppdXrvmu",
|
|
267
|
+
[0x42] = "||mpsadbwXrvmu",
|
|
268
|
+
[0x44] = "||pclmulqdqXrvmu",
|
|
269
|
+
[0x46] = "||perm2i128Xrvmu",
|
|
270
|
+
[0x4a] = "||blendvpsXrvmb",[0x4b] = "||blendvpdXrvmb",
|
|
271
|
+
[0x4c] = "||pblendvbXrvmb",
|
|
253
272
|
--6x
|
|
254
273
|
[0x60] = "||pcmpestrmXrmu",[0x61] = "||pcmpestriXrmu",
|
|
255
274
|
[0x62] = "||pcmpistrmXrmu",[0x63] = "||pcmpistriXrmu",
|
|
275
|
+
[0xdf] = "||aeskeygenassistXrmu",
|
|
256
276
|
},
|
|
257
277
|
}
|
|
258
278
|
|
|
@@ -356,17 +376,19 @@ local map_regs = {
|
|
|
356
376
|
"mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7" }, -- No x64 ext!
|
|
357
377
|
X = { "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
|
|
358
378
|
"xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15" },
|
|
379
|
+
Y = { "ymm0", "ymm1", "ymm2", "ymm3", "ymm4", "ymm5", "ymm6", "ymm7",
|
|
380
|
+
"ymm8", "ymm9", "ymm10", "ymm11", "ymm12", "ymm13", "ymm14", "ymm15" },
|
|
359
381
|
}
|
|
360
382
|
local map_segregs = { "es", "cs", "ss", "ds", "fs", "gs", "segr6", "segr7" }
|
|
361
383
|
|
|
362
384
|
-- Maps for size names.
|
|
363
385
|
local map_sz2n = {
|
|
364
|
-
B = 1, W = 2, D = 4, Q = 8, M = 8, X = 16,
|
|
386
|
+
B = 1, W = 2, D = 4, Q = 8, M = 8, X = 16, Y = 32,
|
|
365
387
|
}
|
|
366
388
|
local map_sz2prefix = {
|
|
367
389
|
B = "byte", W = "word", D = "dword",
|
|
368
390
|
Q = "qword",
|
|
369
|
-
M = "qword", X = "xword",
|
|
391
|
+
M = "qword", X = "xword", Y = "yword",
|
|
370
392
|
F = "dword", G = "qword", -- No need for sizes/register names for these two.
|
|
371
393
|
}
|
|
372
394
|
|
|
@@ -389,10 +411,13 @@ local function putop(ctx, text, operands)
|
|
|
389
411
|
if ctx.rep then text = ctx.rep.." "..text; ctx.rep = false end
|
|
390
412
|
if ctx.rex then
|
|
391
413
|
local t = (ctx.rexw and "w" or "")..(ctx.rexr and "r" or "")..
|
|
392
|
-
(ctx.rexx and "x" or "")..(ctx.rexb and "b" or "")
|
|
393
|
-
|
|
414
|
+
(ctx.rexx and "x" or "")..(ctx.rexb and "b" or "")..
|
|
415
|
+
(ctx.vexl and "l" or "")
|
|
416
|
+
if ctx.vexv and ctx.vexv ~= 0 then t = t.."v"..ctx.vexv end
|
|
417
|
+
if t ~= "" then text = ctx.rex.."."..t.." "..text
|
|
418
|
+
elseif ctx.rex == "vex" then text = "v"..text end
|
|
394
419
|
ctx.rexw = false; ctx.rexr = false; ctx.rexx = false; ctx.rexb = false
|
|
395
|
-
ctx.rex = false
|
|
420
|
+
ctx.rex = false; ctx.vexl = false; ctx.vexv = false
|
|
396
421
|
end
|
|
397
422
|
if ctx.seg then
|
|
398
423
|
local text2, n = gsub(text, "%[", "["..ctx.seg..":")
|
|
@@ -407,6 +432,7 @@ local function putop(ctx, text, operands)
|
|
|
407
432
|
end
|
|
408
433
|
ctx.out(format("%08x %s%s\n", ctx.addr+ctx.start, hex, text))
|
|
409
434
|
ctx.mrm = false
|
|
435
|
+
ctx.vexv = false
|
|
410
436
|
ctx.start = pos
|
|
411
437
|
ctx.imm = nil
|
|
412
438
|
end
|
|
@@ -415,7 +441,7 @@ end
|
|
|
415
441
|
local function clearprefixes(ctx)
|
|
416
442
|
ctx.o16 = false; ctx.seg = false; ctx.lock = false; ctx.rep = false
|
|
417
443
|
ctx.rexw = false; ctx.rexr = false; ctx.rexx = false; ctx.rexb = false
|
|
418
|
-
ctx.rex = false; ctx.a32 = false
|
|
444
|
+
ctx.rex = false; ctx.a32 = false; ctx.vexl = false
|
|
419
445
|
end
|
|
420
446
|
|
|
421
447
|
-- Fallback for incomplete opcodes at the end.
|
|
@@ -452,9 +478,9 @@ end
|
|
|
452
478
|
-- Process pattern string and generate the operands.
|
|
453
479
|
local function putpat(ctx, name, pat)
|
|
454
480
|
local operands, regs, sz, mode, sp, rm, sc, rx, sdisp
|
|
455
|
-
local code, pos, stop = ctx.code, ctx.pos, ctx.stop
|
|
481
|
+
local code, pos, stop, vexl = ctx.code, ctx.pos, ctx.stop, ctx.vexl
|
|
456
482
|
|
|
457
|
-
-- Chars used:
|
|
483
|
+
-- Chars used: 1DFGIMPQRSTUVWXYabcdfgijlmoprstuvwxyz
|
|
458
484
|
for p in gmatch(pat, ".") do
|
|
459
485
|
local x = nil
|
|
460
486
|
if p == "V" or p == "U" then
|
|
@@ -469,11 +495,13 @@ local function putpat(ctx, name, pat)
|
|
|
469
495
|
elseif p == "B" then
|
|
470
496
|
sz = "B"
|
|
471
497
|
regs = ctx.rex and map_regs.B64 or map_regs.B
|
|
472
|
-
elseif match(p, "[
|
|
498
|
+
elseif match(p, "[WDQMXYFG]") then
|
|
473
499
|
sz = p
|
|
500
|
+
if sz == "X" and vexl then sz = "Y"; ctx.vexl = false end
|
|
474
501
|
regs = map_regs[sz]
|
|
475
502
|
elseif p == "P" then
|
|
476
503
|
sz = ctx.o16 and "X" or "M"; ctx.o16 = false
|
|
504
|
+
if sz == "X" and vexl then sz = "Y"; ctx.vexl = false end
|
|
477
505
|
regs = map_regs[sz]
|
|
478
506
|
elseif p == "S" then
|
|
479
507
|
name = name..lower(sz)
|
|
@@ -486,6 +514,10 @@ local function putpat(ctx, name, pat)
|
|
|
486
514
|
local imm = getimm(ctx, pos, 1); if not imm then return end
|
|
487
515
|
x = format("0x%02x", imm)
|
|
488
516
|
pos = pos+1
|
|
517
|
+
elseif p == "b" then
|
|
518
|
+
local imm = getimm(ctx, pos, 1); if not imm then return end
|
|
519
|
+
x = regs[imm/16+1]
|
|
520
|
+
pos = pos+1
|
|
489
521
|
elseif p == "w" then
|
|
490
522
|
local imm = getimm(ctx, pos, 2); if not imm then return end
|
|
491
523
|
x = format("0x%x", imm)
|
|
@@ -618,8 +650,13 @@ local function putpat(ctx, name, pat)
|
|
|
618
650
|
else
|
|
619
651
|
x = "CR"..sp
|
|
620
652
|
end
|
|
653
|
+
elseif p == "v" then
|
|
654
|
+
if ctx.vexv then
|
|
655
|
+
x = regs[ctx.vexv+1]; ctx.vexv = false
|
|
656
|
+
end
|
|
621
657
|
elseif p == "y" then x = "DR"..sp
|
|
622
658
|
elseif p == "z" then x = "TR"..sp
|
|
659
|
+
elseif p == "l" then vexl = false
|
|
623
660
|
elseif p == "t" then
|
|
624
661
|
else
|
|
625
662
|
error("bad pattern `"..pat.."'")
|
|
@@ -694,7 +731,7 @@ map_act = {
|
|
|
694
731
|
B = putpat, W = putpat, D = putpat, Q = putpat,
|
|
695
732
|
V = putpat, U = putpat, T = putpat,
|
|
696
733
|
M = putpat, X = putpat, P = putpat,
|
|
697
|
-
F = putpat, G = putpat,
|
|
734
|
+
F = putpat, G = putpat, Y = putpat,
|
|
698
735
|
|
|
699
736
|
-- Collect prefixes.
|
|
700
737
|
[":"] = function(ctx, name, pat)
|
|
@@ -755,15 +792,68 @@ map_act = {
|
|
|
755
792
|
|
|
756
793
|
-- REX prefix.
|
|
757
794
|
rex = function(ctx, name, pat)
|
|
758
|
-
if ctx.rex then return unknown(ctx) end -- Only 1 REX prefix allowed.
|
|
795
|
+
if ctx.rex then return unknown(ctx) end -- Only 1 REX or VEX prefix allowed.
|
|
759
796
|
for p in gmatch(pat, ".") do ctx["rex"..p] = true end
|
|
760
|
-
ctx.rex =
|
|
797
|
+
ctx.rex = "rex"
|
|
798
|
+
end,
|
|
799
|
+
|
|
800
|
+
-- VEX prefix.
|
|
801
|
+
vex = function(ctx, name, pat)
|
|
802
|
+
if ctx.rex then return unknown(ctx) end -- Only 1 REX or VEX prefix allowed.
|
|
803
|
+
ctx.rex = "vex"
|
|
804
|
+
local pos = ctx.pos
|
|
805
|
+
if ctx.mrm then
|
|
806
|
+
ctx.mrm = nil
|
|
807
|
+
pos = pos-1
|
|
808
|
+
end
|
|
809
|
+
local b = byte(ctx.code, pos, pos)
|
|
810
|
+
if not b then return incomplete(ctx) end
|
|
811
|
+
pos = pos+1
|
|
812
|
+
if b < 128 then ctx.rexr = true end
|
|
813
|
+
local m = 1
|
|
814
|
+
if pat == "3" then
|
|
815
|
+
m = b%32; b = (b-m)/32
|
|
816
|
+
local nb = b%2; b = (b-nb)/2
|
|
817
|
+
if nb == 0 then ctx.rexb = true end
|
|
818
|
+
local nx = b%2; b = (b-nx)/2
|
|
819
|
+
if nx == 0 then ctx.rexx = true end
|
|
820
|
+
b = byte(ctx.code, pos, pos)
|
|
821
|
+
if not b then return incomplete(ctx) end
|
|
822
|
+
pos = pos+1
|
|
823
|
+
if b >= 128 then ctx.rexw = true end
|
|
824
|
+
end
|
|
825
|
+
ctx.pos = pos
|
|
826
|
+
local map
|
|
827
|
+
if m == 1 then map = map_opc2
|
|
828
|
+
elseif m == 2 then map = map_opc3["38"]
|
|
829
|
+
elseif m == 3 then map = map_opc3["3a"]
|
|
830
|
+
else return unknown(ctx) end
|
|
831
|
+
local p = b%4; b = (b-p)/4
|
|
832
|
+
if p == 1 then ctx.o16 = "o16"
|
|
833
|
+
elseif p == 2 then ctx.rep = "rep"
|
|
834
|
+
elseif p == 3 then ctx.rep = "repne" end
|
|
835
|
+
local l = b%2; b = (b-l)/2
|
|
836
|
+
if l ~= 0 then ctx.vexl = true end
|
|
837
|
+
ctx.vexv = (-1-b)%16
|
|
838
|
+
return dispatchmap(ctx, map)
|
|
761
839
|
end,
|
|
762
840
|
|
|
763
841
|
-- Special case for nop with REX prefix.
|
|
764
842
|
nop = function(ctx, name, pat)
|
|
765
843
|
return dispatch(ctx, ctx.rex and pat or "nop")
|
|
766
844
|
end,
|
|
845
|
+
|
|
846
|
+
-- Special case for 0F 77.
|
|
847
|
+
emms = function(ctx, name, pat)
|
|
848
|
+
if ctx.rex ~= "vex" then
|
|
849
|
+
return putop(ctx, "emms")
|
|
850
|
+
elseif ctx.vexl then
|
|
851
|
+
ctx.vexl = false
|
|
852
|
+
return putop(ctx, "zeroall")
|
|
853
|
+
else
|
|
854
|
+
return putop(ctx, "zeroupper")
|
|
855
|
+
end
|
|
856
|
+
end,
|
|
767
857
|
}
|
|
768
858
|
|
|
769
859
|
------------------------------------------------------------------------------
|