immunio 1.1.2 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (228) hide show
  1. checksums.yaml +4 -4
  2. data/lib/immunio/version.rb +1 -1
  3. data/lua-hooks/Makefile +56 -109
  4. data/lua-hooks/ext/all.c +3 -14
  5. data/lua-hooks/ext/libinjection/module.mk +5 -0
  6. data/lua-hooks/ext/lpeg/module.mk +6 -0
  7. data/lua-hooks/ext/lua-cmsgpack/module.mk +2 -0
  8. data/lua-hooks/ext/lua-snapshot/module.mk +2 -0
  9. data/lua-hooks/ext/luajit/COPYRIGHT +1 -1
  10. data/lua-hooks/ext/luajit/Makefile +2 -2
  11. data/lua-hooks/ext/luajit/README +2 -2
  12. data/lua-hooks/ext/luajit/doc/bluequad-print.css +1 -1
  13. data/lua-hooks/ext/luajit/doc/bluequad.css +1 -1
  14. data/lua-hooks/ext/luajit/doc/changes.html +15 -2
  15. data/lua-hooks/ext/luajit/doc/contact.html +3 -3
  16. data/lua-hooks/ext/luajit/doc/ext_c_api.html +2 -2
  17. data/lua-hooks/ext/luajit/doc/ext_ffi.html +2 -2
  18. data/lua-hooks/ext/luajit/doc/ext_ffi_api.html +2 -2
  19. data/lua-hooks/ext/luajit/doc/ext_ffi_semantics.html +4 -2
  20. data/lua-hooks/ext/luajit/doc/ext_ffi_tutorial.html +2 -2
  21. data/lua-hooks/ext/luajit/doc/ext_jit.html +2 -2
  22. data/lua-hooks/ext/luajit/doc/ext_profiler.html +2 -2
  23. data/lua-hooks/ext/luajit/doc/extensions.html +9 -2
  24. data/lua-hooks/ext/luajit/doc/faq.html +2 -2
  25. data/lua-hooks/ext/luajit/doc/install.html +22 -18
  26. data/lua-hooks/ext/luajit/doc/luajit.html +3 -3
  27. data/lua-hooks/ext/luajit/doc/running.html +2 -2
  28. data/lua-hooks/ext/luajit/doc/status.html +2 -2
  29. data/lua-hooks/ext/luajit/dynasm/dasm_arm.h +1 -1
  30. data/lua-hooks/ext/luajit/dynasm/dasm_arm.lua +4 -4
  31. data/lua-hooks/ext/luajit/dynasm/dasm_arm64.h +1 -1
  32. data/lua-hooks/ext/luajit/dynasm/dasm_arm64.lua +4 -4
  33. data/lua-hooks/ext/luajit/dynasm/dasm_mips.h +1 -1
  34. data/lua-hooks/ext/luajit/dynasm/dasm_mips.lua +4 -4
  35. data/lua-hooks/ext/luajit/dynasm/dasm_ppc.h +1 -1
  36. data/lua-hooks/ext/luajit/dynasm/dasm_ppc.lua +4 -4
  37. data/lua-hooks/ext/luajit/dynasm/dasm_proto.h +3 -3
  38. data/lua-hooks/ext/luajit/dynasm/dasm_x64.lua +1 -1
  39. data/lua-hooks/ext/luajit/dynasm/dasm_x86.h +34 -7
  40. data/lua-hooks/ext/luajit/dynasm/dasm_x86.lua +427 -102
  41. data/lua-hooks/ext/luajit/dynasm/dynasm.lua +5 -5
  42. data/lua-hooks/ext/luajit/etc/luajit.1 +1 -1
  43. data/lua-hooks/ext/luajit/etc/luajit.pc +1 -1
  44. data/lua-hooks/ext/luajit/src/Makefile +36 -21
  45. data/lua-hooks/ext/luajit/src/Makefile.dep +3 -1
  46. data/lua-hooks/ext/luajit/src/host/buildvm.c +1 -1
  47. data/lua-hooks/ext/luajit/src/host/buildvm.h +1 -1
  48. data/lua-hooks/ext/luajit/src/host/buildvm_asm.c +10 -1
  49. data/lua-hooks/ext/luajit/src/host/buildvm_fold.c +1 -1
  50. data/lua-hooks/ext/luajit/src/host/buildvm_lib.c +1 -1
  51. data/lua-hooks/ext/luajit/src/host/buildvm_peobj.c +1 -1
  52. data/lua-hooks/ext/luajit/src/host/genlibbc.lua +1 -1
  53. data/lua-hooks/ext/luajit/src/host/genminilua.lua +1 -1
  54. data/lua-hooks/ext/luajit/src/jit/bc.lua +1 -1
  55. data/lua-hooks/ext/luajit/src/jit/bcsave.lua +2 -2
  56. data/lua-hooks/ext/luajit/src/jit/dis_arm.lua +1 -1
  57. data/lua-hooks/ext/luajit/src/jit/dis_mips.lua +1 -1
  58. data/lua-hooks/ext/luajit/src/jit/dis_mipsel.lua +1 -1
  59. data/lua-hooks/ext/luajit/src/jit/dis_ppc.lua +1 -1
  60. data/lua-hooks/ext/luajit/src/jit/dis_x64.lua +1 -1
  61. data/lua-hooks/ext/luajit/src/jit/dis_x86.lua +163 -73
  62. data/lua-hooks/ext/luajit/src/jit/dump.lua +2 -1
  63. data/lua-hooks/ext/luajit/src/jit/p.lua +1 -1
  64. data/lua-hooks/ext/luajit/src/jit/v.lua +1 -1
  65. data/lua-hooks/ext/luajit/src/jit/zone.lua +1 -1
  66. data/lua-hooks/ext/luajit/src/lib_aux.c +1 -1
  67. data/lua-hooks/ext/luajit/src/lib_base.c +4 -5
  68. data/lua-hooks/ext/luajit/src/lib_bit.c +1 -1
  69. data/lua-hooks/ext/luajit/src/lib_debug.c +1 -1
  70. data/lua-hooks/ext/luajit/src/lib_ffi.c +2 -5
  71. data/lua-hooks/ext/luajit/src/lib_init.c +1 -1
  72. data/lua-hooks/ext/luajit/src/lib_io.c +2 -3
  73. data/lua-hooks/ext/luajit/src/lib_jit.c +1 -1
  74. data/lua-hooks/ext/luajit/src/lib_math.c +1 -1
  75. data/lua-hooks/ext/luajit/src/lib_os.c +2 -2
  76. data/lua-hooks/ext/luajit/src/lib_package.c +1 -1
  77. data/lua-hooks/ext/luajit/src/lib_string.c +1 -1
  78. data/lua-hooks/ext/luajit/src/lib_table.c +1 -1
  79. data/lua-hooks/ext/luajit/src/lj.supp +15 -0
  80. data/lua-hooks/ext/luajit/src/lj_alloc.c +1 -1
  81. data/lua-hooks/ext/luajit/src/lj_api.c +4 -1
  82. data/lua-hooks/ext/luajit/src/lj_arch.h +33 -7
  83. data/lua-hooks/ext/luajit/src/lj_asm.c +12 -5
  84. data/lua-hooks/ext/luajit/src/lj_asm.h +1 -1
  85. data/lua-hooks/ext/luajit/src/lj_asm_arm.h +3 -13
  86. data/lua-hooks/ext/luajit/src/lj_asm_mips.h +337 -71
  87. data/lua-hooks/ext/luajit/src/lj_asm_ppc.h +2 -2
  88. data/lua-hooks/ext/luajit/src/lj_asm_x86.h +2 -2
  89. data/lua-hooks/ext/luajit/src/lj_bc.c +1 -1
  90. data/lua-hooks/ext/luajit/src/lj_bc.h +1 -1
  91. data/lua-hooks/ext/luajit/src/lj_bcdump.h +1 -1
  92. data/lua-hooks/ext/luajit/src/lj_bcread.c +1 -1
  93. data/lua-hooks/ext/luajit/src/lj_bcwrite.c +1 -1
  94. data/lua-hooks/ext/luajit/src/lj_buf.c +2 -4
  95. data/lua-hooks/ext/luajit/src/lj_buf.h +1 -3
  96. data/lua-hooks/ext/luajit/src/lj_carith.c +1 -1
  97. data/lua-hooks/ext/luajit/src/lj_carith.h +1 -1
  98. data/lua-hooks/ext/luajit/src/lj_ccall.c +37 -14
  99. data/lua-hooks/ext/luajit/src/lj_ccall.h +3 -3
  100. data/lua-hooks/ext/luajit/src/lj_ccallback.c +16 -7
  101. data/lua-hooks/ext/luajit/src/lj_ccallback.h +1 -1
  102. data/lua-hooks/ext/luajit/src/lj_cconv.c +1 -1
  103. data/lua-hooks/ext/luajit/src/lj_cconv.h +1 -1
  104. data/lua-hooks/ext/luajit/src/lj_cdata.c +10 -1
  105. data/lua-hooks/ext/luajit/src/lj_cdata.h +3 -1
  106. data/lua-hooks/ext/luajit/src/lj_clib.c +1 -1
  107. data/lua-hooks/ext/luajit/src/lj_clib.h +1 -1
  108. data/lua-hooks/ext/luajit/src/lj_cparse.c +27 -6
  109. data/lua-hooks/ext/luajit/src/lj_cparse.h +1 -1
  110. data/lua-hooks/ext/luajit/src/lj_crecord.c +1 -1
  111. data/lua-hooks/ext/luajit/src/lj_crecord.h +1 -1
  112. data/lua-hooks/ext/luajit/src/lj_ctype.c +10 -8
  113. data/lua-hooks/ext/luajit/src/lj_ctype.h +1 -1
  114. data/lua-hooks/ext/luajit/src/lj_debug.c +1 -1
  115. data/lua-hooks/ext/luajit/src/lj_debug.h +1 -1
  116. data/lua-hooks/ext/luajit/src/lj_def.h +1 -1
  117. data/lua-hooks/ext/luajit/src/lj_dispatch.c +1 -1
  118. data/lua-hooks/ext/luajit/src/lj_dispatch.h +21 -4
  119. data/lua-hooks/ext/luajit/src/lj_emit_arm.h +1 -1
  120. data/lua-hooks/ext/luajit/src/lj_emit_mips.h +7 -5
  121. data/lua-hooks/ext/luajit/src/lj_emit_ppc.h +1 -1
  122. data/lua-hooks/ext/luajit/src/lj_emit_x86.h +1 -1
  123. data/lua-hooks/ext/luajit/src/lj_err.c +69 -31
  124. data/lua-hooks/ext/luajit/src/lj_err.h +1 -1
  125. data/lua-hooks/ext/luajit/src/lj_errmsg.h +1 -1
  126. data/lua-hooks/ext/luajit/src/lj_ff.h +1 -1
  127. data/lua-hooks/ext/luajit/src/lj_ffrecord.c +10 -40
  128. data/lua-hooks/ext/luajit/src/lj_ffrecord.h +1 -1
  129. data/lua-hooks/ext/luajit/src/lj_frame.h +12 -1
  130. data/lua-hooks/ext/luajit/src/lj_func.c +1 -1
  131. data/lua-hooks/ext/luajit/src/lj_func.h +1 -1
  132. data/lua-hooks/ext/luajit/src/lj_gc.c +2 -2
  133. data/lua-hooks/ext/luajit/src/lj_gc.h +1 -1
  134. data/lua-hooks/ext/luajit/src/lj_gdbjit.c +1 -1
  135. data/lua-hooks/ext/luajit/src/lj_gdbjit.h +1 -1
  136. data/lua-hooks/ext/luajit/src/lj_ir.c +31 -15
  137. data/lua-hooks/ext/luajit/src/lj_ir.h +1 -1
  138. data/lua-hooks/ext/luajit/src/lj_ircall.h +29 -1
  139. data/lua-hooks/ext/luajit/src/lj_iropt.h +2 -1
  140. data/lua-hooks/ext/luajit/src/lj_jit.h +2 -1
  141. data/lua-hooks/ext/luajit/src/lj_lex.c +28 -1
  142. data/lua-hooks/ext/luajit/src/lj_lex.h +1 -1
  143. data/lua-hooks/ext/luajit/src/lj_lib.c +1 -1
  144. data/lua-hooks/ext/luajit/src/lj_lib.h +1 -1
  145. data/lua-hooks/ext/luajit/src/lj_load.c +1 -1
  146. data/lua-hooks/ext/luajit/src/lj_mcode.c +1 -1
  147. data/lua-hooks/ext/luajit/src/lj_mcode.h +1 -1
  148. data/lua-hooks/ext/luajit/src/lj_meta.c +8 -8
  149. data/lua-hooks/ext/luajit/src/lj_meta.h +1 -1
  150. data/lua-hooks/ext/luajit/src/lj_obj.c +1 -1
  151. data/lua-hooks/ext/luajit/src/lj_obj.h +1 -1
  152. data/lua-hooks/ext/luajit/src/lj_opt_dce.c +1 -1
  153. data/lua-hooks/ext/luajit/src/lj_opt_fold.c +1 -1
  154. data/lua-hooks/ext/luajit/src/lj_opt_loop.c +1 -1
  155. data/lua-hooks/ext/luajit/src/lj_opt_mem.c +1 -1
  156. data/lua-hooks/ext/luajit/src/lj_opt_narrow.c +1 -1
  157. data/lua-hooks/ext/luajit/src/lj_opt_sink.c +1 -1
  158. data/lua-hooks/ext/luajit/src/lj_opt_split.c +10 -5
  159. data/lua-hooks/ext/luajit/src/lj_parse.c +1 -1
  160. data/lua-hooks/ext/luajit/src/lj_parse.h +1 -1
  161. data/lua-hooks/ext/luajit/src/lj_profile.c +1 -1
  162. data/lua-hooks/ext/luajit/src/lj_profile.h +1 -1
  163. data/lua-hooks/ext/luajit/src/lj_record.c +13 -5
  164. data/lua-hooks/ext/luajit/src/lj_record.h +1 -1
  165. data/lua-hooks/ext/luajit/src/lj_snap.c +20 -23
  166. data/lua-hooks/ext/luajit/src/lj_snap.h +1 -1
  167. data/lua-hooks/ext/luajit/src/lj_state.c +1 -1
  168. data/lua-hooks/ext/luajit/src/lj_state.h +1 -1
  169. data/lua-hooks/ext/luajit/src/lj_str.c +1 -1
  170. data/lua-hooks/ext/luajit/src/lj_str.h +1 -1
  171. data/lua-hooks/ext/luajit/src/lj_strfmt.c +12 -98
  172. data/lua-hooks/ext/luajit/src/lj_strfmt.h +4 -4
  173. data/lua-hooks/ext/luajit/src/lj_strfmt_num.c +591 -0
  174. data/lua-hooks/ext/luajit/src/lj_strscan.c +1 -1
  175. data/lua-hooks/ext/luajit/src/lj_strscan.h +1 -1
  176. data/lua-hooks/ext/luajit/src/lj_tab.c +1 -1
  177. data/lua-hooks/ext/luajit/src/lj_tab.h +1 -1
  178. data/lua-hooks/ext/luajit/src/lj_target.h +1 -1
  179. data/lua-hooks/ext/luajit/src/lj_target_arm.h +1 -1
  180. data/lua-hooks/ext/luajit/src/lj_target_arm64.h +1 -1
  181. data/lua-hooks/ext/luajit/src/lj_target_mips.h +30 -2
  182. data/lua-hooks/ext/luajit/src/lj_target_ppc.h +1 -1
  183. data/lua-hooks/ext/luajit/src/lj_target_x86.h +1 -1
  184. data/lua-hooks/ext/luajit/src/lj_trace.c +7 -2
  185. data/lua-hooks/ext/luajit/src/lj_trace.h +1 -1
  186. data/lua-hooks/ext/luajit/src/lj_traceerr.h +1 -3
  187. data/lua-hooks/ext/luajit/src/lj_udata.c +1 -1
  188. data/lua-hooks/ext/luajit/src/lj_udata.h +1 -1
  189. data/lua-hooks/ext/luajit/src/lj_vm.h +5 -3
  190. data/lua-hooks/ext/luajit/src/lj_vmevent.c +1 -1
  191. data/lua-hooks/ext/luajit/src/lj_vmevent.h +1 -1
  192. data/lua-hooks/ext/luajit/src/lj_vmmath.c +15 -15
  193. data/lua-hooks/ext/luajit/src/ljamalg.c +2 -1
  194. data/lua-hooks/ext/luajit/src/lua.h +1 -0
  195. data/lua-hooks/ext/luajit/src/luaconf.h +2 -2
  196. data/lua-hooks/ext/luajit/src/luajit.c +1 -1
  197. data/lua-hooks/ext/luajit/src/luajit.h +4 -4
  198. data/lua-hooks/ext/luajit/src/lualib.h +1 -1
  199. data/lua-hooks/ext/luajit/src/msvcbuild.bat +1 -1
  200. data/lua-hooks/ext/luajit/src/ps4build.bat +26 -6
  201. data/lua-hooks/ext/luajit/src/vm_arm.dasc +17 -9
  202. data/lua-hooks/ext/luajit/src/vm_arm64.dasc +1 -1
  203. data/lua-hooks/ext/luajit/src/vm_mips.dasc +1562 -656
  204. data/lua-hooks/ext/luajit/src/vm_ppc.dasc +3 -7
  205. data/lua-hooks/ext/luajit/src/vm_x64.dasc +10 -2
  206. data/lua-hooks/ext/luajit/src/vm_x86.dasc +5 -8
  207. data/lua-hooks/ext/luautf8/module.mk +2 -0
  208. data/lua-hooks/ext/module.mk +15 -0
  209. data/lua-hooks/ext/modules.h +17 -0
  210. data/lua-hooks/ext/perf/luacpu.c +1 -1
  211. data/lua-hooks/ext/perf/lualoadavg.c +1 -1
  212. data/lua-hooks/ext/perf/luameminfo.c +1 -1
  213. data/lua-hooks/ext/perf/luaoslib.c +124 -2
  214. data/lua-hooks/ext/perf/module.mk +5 -0
  215. data/lua-hooks/ext/sha1/luasha1.c +4 -2
  216. data/lua-hooks/ext/sha1/module.mk +5 -0
  217. data/lua-hooks/ext/sha2/luasha256.c +4 -2
  218. data/lua-hooks/ext/sha2/module.mk +5 -0
  219. data/lua-hooks/ext/sysutils/lua_utils.c +56 -0
  220. data/lua-hooks/ext/sysutils/module.mk +2 -0
  221. data/lua-hooks/lib/boot.lua +2 -1
  222. data/lua-hooks/lib/hooks/module.mk +31 -0
  223. data/lua-hooks/lib/hooks/xss/module.mk +4 -0
  224. data/lua-hooks/lib/lexers/module.mk +10 -0
  225. data/lua-hooks/lib/module.mk +38 -0
  226. data/lua-hooks/lib/schema/module.mk +3 -0
  227. data/lua-hooks/options.mk +59 -0
  228. 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-2015 Mike Pall. All rights reserved.
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.3.0",
14
- vernum = 10300,
15
- release = "2011-05-05",
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-2015 Mike Pall. All rights reserved.
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-2015 Mike Pall.
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
@@ -2,7 +2,7 @@
2
2
  majver=2
3
3
  minver=1
4
4
  relver=0
5
- version=${majver}.${minver}.${relver}-beta1
5
+ version=${majver}.${minver}.${relver}-beta2
6
6
  abiver=5.1
7
7
 
8
8
  prefix=/usr/local
@@ -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-2015 Mike Pall. See Copyright Notice in luajit.h
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= gcc
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= gcc -m32
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
- # System detection.
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-2015 Mike Pall. See Copyright Notice in luajit.h
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.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _BUILDVM_H
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** LuaJIT VM builder: Assembler source code emitter.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
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: IR folding hash table generator.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #include "buildvm.h"
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** LuaJIT VM builder: library definition compiler.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #include "buildvm.h"
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** LuaJIT VM builder: PE object emitter.
3
- ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
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-2015 Mike Pall. All rights reserved.
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-2015 Mike Pall. All rights reserved.
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-2015 Mike Pall. All rights reserved.
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-2015 Mike Pall. All rights reserved.
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-2015 Mike Pall. All rights reserved.
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-2015 Mike Pall. All rights reserved.
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-2015 Mike Pall. All rights reserved.
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-2015 Mike Pall. All rights reserved.
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-2015 Mike Pall. All rights reserved.
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-2015 Mike Pall. All rights reserved.
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 (VMX/SVM)
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]=false, [0xc5]=false, [0xce]=false,
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|movssXrm|movupdXrm|movsdXrm",
118
- "movupsXmr|movssXmr|movupdXmr|movsdXmr",
116
+ "movupsXrm|movssXrvm|movupdXrm|movsdXrvm",
117
+ "movupsXmr|movssXmvr|movupdXmr|movsdXmvr",
119
118
  "movhlpsXrm$movlpsXrm|movsldupXrm|movlpdXrm|movddupXrm",
120
119
  "movlpsXmr||movlpdXmr",
121
- "unpcklpsXrm||unpcklpdXrm",
122
- "unpckhpsXrm||unpckhpdXrm",
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|cvtsi2ssXrVmt|cvtpi2pdXrMm|cvtsi2sdXrVmt",
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|rsqrtssXrm","rcppsXrm|rcpssXrm",
148
- "andpsXrm||andpdXrm","andnpsXrm||andnpdXrm",
149
- "orpsXrm||orpdXrm","xorpsXrm||xorpdXrm",
150
- "addpsXrm|addssXrm|addpdXrm|addsdXrm","mulpsXrm|mulssXrm|mulpdXrm|mulsdXrm",
151
- "cvtps2pdXrm|cvtss2sdXrm|cvtpd2psXrm|cvtsd2ssXrm",
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
- "subpsXrm|subssXrm|subpdXrm|subsdXrm","minpsXrm|minssXrm|minpdXrm|minsdXrm",
154
- "divpsXrm|divssXrm|divpdXrm|divsdXrm","maxpsXrm|maxssXrm|maxpdXrm|maxsdXrm",
152
+ "subpsXrvm|subssXrvm|subpdXrvm|subsdXrvm","minpsXrvm|minssXrvm|minpdXrvm|minsdXrvm",
153
+ "divpsXrvm|divssXrvm|divpdXrvm|divsdXrvm","maxpsXrvm|maxssXrvm|maxpdXrvm|maxsdXrvm",
155
154
  --6x
156
- "punpcklbwPrm","punpcklwdPrm","punpckldqPrm","packsswbPrm",
157
- "pcmpgtbPrm","pcmpgtwPrm","pcmpgtdPrm","packuswbPrm",
158
- "punpckhbwPrm","punpckhwdPrm","punpckhdqPrm","packssdwPrm",
159
- "||punpcklqdqXrm","||punpckhqdqXrm",
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!Pmu",
163
- "pshiftd!Pmu","pshiftq!Mmu||pshiftdq!Xmu",
164
- "pcmpeqbPrm","pcmpeqwPrm","pcmpeqdPrm","emms|",
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
- "||haddpdXrm|haddpsXrm","||hsubpdXrm|hsubpsXrm",
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
- "cmppsXrmu|cmpssXrmu|cmppdXrmu|cmpsdXrmu","$movntiVmr|",
186
- "pinsrwPrWmu","pextrwDrPmu",
187
- "shufpsXrmu||shufpdXrmu","$cmpxchg!Qmp",
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
- "||addsubpdXrm|addsubpsXrm","psrlwPrm","psrldPrm","psrlqPrm",
191
- "paddqPrm","pmullwPrm",
189
+ "||addsubpdXrvm|addsubpsXrvm","psrlwPrvm","psrldPrvm","psrlqPrvm",
190
+ "paddqPrvm","pmullwPrvm",
192
191
  "|movq2dqXrMm|movqXmr|movdq2qMrXm$","pmovmskbVrMm||pmovmskbVrXm",
193
- "psubusbPrm","psubuswPrm","pminubPrm","pandPrm",
194
- "paddusbPrm","padduswPrm","pmaxubPrm","pandnPrm",
192
+ "psubusbPrvm","psubuswPrvm","pminubPrvm","pandPrvm",
193
+ "paddusbPrvm","padduswPrvm","pmaxubPrvm","pandnPrvm",
195
194
  --Ex
196
- "pavgbPrm","psrawPrm","psradPrm","pavgwPrm",
197
- "pmulhuwPrm","pmulhwPrm",
195
+ "pavgbPrvm","psrawPrvm","psradPrvm","pavgwPrvm",
196
+ "pmulhuwPrvm","pmulhwPrvm",
198
197
  "|cvtdq2pdXrm|cvttpd2dqXrm|cvtpd2dqXrm","$movntqMmr||$movntdqXmr",
199
- "psubsbPrm","psubswPrm","pminswPrm","porPrm",
200
- "paddsbPrm","paddswPrm","pmaxswPrm","pxorPrm",
198
+ "psubsbPrvm","psubswPrvm","pminswPrvm","porPrvm",
199
+ "paddsbPrvm","paddswPrvm","pmaxswPrvm","pxorPrvm",
201
200
  --Fx
202
- "|||lddquXrm","psllwPrm","pslldPrm","psllqPrm",
203
- "pmuludqPrm","pmaddwdPrm","psadbwPrm","maskmovqMrm||maskmovdquXrm$",
204
- "psubbPrm","psubwPrm","psubdPrm","psubqPrm",
205
- "paddbPrm","paddwPrm","padddPrm","ud",
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]="pshufbPrm","phaddwPrm","phadddPrm","phaddswPrm",
214
- "pmaddubswPrm","phsubwPrm","phsubdPrm","phsubswPrm",
215
- "psignbPrm","psignwPrm","psigndPrm","pmulhrswPrm",
216
- nil,nil,nil,nil,
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",nil,"||ptestXrm",
220
- nil,nil,nil,nil,
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
- "||pmuldqXrm","||pcmpeqqXrm","||$movntdqaXrm","||packusdwXrm",
226
- nil,nil,nil,nil,
224
+ "||pmuldqXrvm","||pcmpeqqXrvm","||$movntdqaXrm","||packusdwXrvm",
225
+ "||maskmovpsXrvm","||maskmovpdXrvm","||maskmovpsXmvr","||maskmovpdXmvr",
227
226
  --3x
228
227
  "||pmovzxbwXrm","||pmovzxbdXrm","||pmovzxbqXrm","||pmovzxwdXrm",
229
- "||pmovzxwqXrm","||pmovzxdqXrm",nil,"||pcmpgtqXrm",
230
- "||pminsbXrm","||pminsdXrm","||pminuwXrm","||pminudXrm",
231
- "||pmaxsbXrm","||pmaxsdXrm","||pmaxuwXrm","||pmaxudXrm",
228
+ "||pmovzxwqXrm","||pmovzxdqXrm","||permdXrvm","||pcmpgtqXrvm",
229
+ "||pminsbXrvm","||pminsdXrvm","||pminuwXrvm","||pminudXrvm",
230
+ "||pmaxsbXrvm","||pmaxsdXrvm","||pmaxuwXrvm","||pmaxudXrvm",
232
231
  --4x
233
- "||pmulddXrm","||phminposuwXrm",
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]=nil,nil,nil,nil,nil,nil,nil,nil,
241
- "||roundpsXrmu","||roundpdXrmu","||roundssXrmu","||roundsdXrmu",
242
- "||blendpsXrmu","||blendpdXrmu","||pblendwXrmu","palignrPrmu",
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
- nil,nil,nil,nil,nil,nil,nil,nil,
258
+ "||insertf128XrvlXmu","||extractf128XlXmYru",nil,nil,
259
+ nil,nil,nil,nil,
247
260
  --2x
248
- "||pinsrbXrVmu","||insertpsXrmu","||pinsrXrVmuS",nil,
261
+ "||pinsrbXrvVmu","||insertpsXrvmu","||pinsrXrvVmuS",nil,
262
+ --3x
263
+ [0x38] = "||inserti128Xrvmu",[0x39] = "||extracti128XlXmYru",
249
264
  --4x
250
- [0x40] = "||dppsXrmu",
251
- [0x41] = "||dppdXrmu",
252
- [0x42] = "||mpsadbwXrmu",
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
- if t ~= "" then text = "rex."..t.." "..text end
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: 1DFGIMPQRSTUVWXacdfgijmoprstuwxyz
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, "[WDQMXFG]") then
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 = true
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
  ------------------------------------------------------------------------------