immunio 1.2.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (291) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -5
  3. data/ext/immunio/Rakefile +14 -6
  4. data/lib/immunio/context.rb +2 -0
  5. data/lib/immunio/plugins/action_view.rb +7 -668
  6. data/lib/immunio/plugins/action_view/action_view.rb +22 -0
  7. data/lib/immunio/plugins/action_view/active_support_hash.rb +29 -0
  8. data/lib/immunio/plugins/action_view/cache_store.rb +24 -0
  9. data/lib/immunio/plugins/action_view/erubi.rb +38 -0
  10. data/lib/immunio/plugins/action_view/erubis.rb +39 -0
  11. data/lib/immunio/plugins/action_view/fragment_caching.rb +29 -0
  12. data/lib/immunio/plugins/action_view/haml.rb +46 -0
  13. data/lib/immunio/plugins/action_view/slim.rb +42 -0
  14. data/lib/immunio/plugins/action_view/template.rb +431 -0
  15. data/lib/immunio/plugins/action_view/template_rendering.rb +45 -0
  16. data/lib/immunio/plugins/http_tracker.rb +2 -0
  17. data/lib/immunio/plugins/io.rb +34 -0
  18. data/lib/immunio/version.rb +1 -1
  19. data/lua-hooks/Makefile +36 -9
  20. data/lua-hooks/ext/luajit/COPYRIGHT +1 -1
  21. data/lua-hooks/ext/luajit/Makefile +22 -15
  22. data/lua-hooks/ext/luajit/README +2 -2
  23. data/lua-hooks/ext/luajit/doc/bluequad-print.css +1 -1
  24. data/lua-hooks/ext/luajit/doc/bluequad.css +1 -1
  25. data/lua-hooks/ext/luajit/doc/changes.html +69 -3
  26. data/lua-hooks/ext/luajit/doc/contact.html +10 -3
  27. data/lua-hooks/ext/luajit/doc/ext_c_api.html +2 -2
  28. data/lua-hooks/ext/luajit/doc/ext_ffi.html +2 -2
  29. data/lua-hooks/ext/luajit/doc/ext_ffi_api.html +2 -2
  30. data/lua-hooks/ext/luajit/doc/ext_ffi_semantics.html +3 -4
  31. data/lua-hooks/ext/luajit/doc/ext_ffi_tutorial.html +2 -2
  32. data/lua-hooks/ext/luajit/doc/ext_jit.html +3 -3
  33. data/lua-hooks/ext/luajit/doc/ext_profiler.html +2 -2
  34. data/lua-hooks/ext/luajit/doc/extensions.html +47 -20
  35. data/lua-hooks/ext/luajit/doc/faq.html +2 -2
  36. data/lua-hooks/ext/luajit/doc/install.html +74 -45
  37. data/lua-hooks/ext/luajit/doc/luajit.html +5 -5
  38. data/lua-hooks/ext/luajit/doc/running.html +3 -3
  39. data/lua-hooks/ext/luajit/doc/status.html +13 -8
  40. data/lua-hooks/ext/luajit/dynasm/dasm_arm.h +1 -1
  41. data/lua-hooks/ext/luajit/dynasm/dasm_arm.lua +1 -1
  42. data/lua-hooks/ext/luajit/dynasm/dasm_arm64.h +1 -1
  43. data/lua-hooks/ext/luajit/dynasm/dasm_arm64.lua +1 -1
  44. data/lua-hooks/ext/luajit/dynasm/dasm_mips.h +8 -5
  45. data/lua-hooks/ext/luajit/dynasm/dasm_mips.lua +66 -11
  46. data/lua-hooks/ext/luajit/dynasm/dasm_mips64.lua +12 -0
  47. data/lua-hooks/ext/luajit/dynasm/dasm_ppc.h +1 -1
  48. data/lua-hooks/ext/luajit/dynasm/dasm_ppc.lua +1 -1
  49. data/lua-hooks/ext/luajit/dynasm/dasm_proto.h +1 -1
  50. data/lua-hooks/ext/luajit/dynasm/dasm_x64.lua +1 -1
  51. data/lua-hooks/ext/luajit/dynasm/dasm_x86.h +1 -1
  52. data/lua-hooks/ext/luajit/dynasm/dasm_x86.lua +5 -1
  53. data/lua-hooks/ext/luajit/dynasm/dynasm.lua +2 -2
  54. data/lua-hooks/ext/luajit/etc/luajit.1 +1 -1
  55. data/lua-hooks/ext/luajit/etc/luajit.pc +1 -1
  56. data/lua-hooks/ext/luajit/src/Makefile +15 -11
  57. data/lua-hooks/ext/luajit/src/Makefile.dep +16 -16
  58. data/lua-hooks/ext/luajit/src/host/buildvm.c +2 -2
  59. data/lua-hooks/ext/luajit/src/host/buildvm.h +1 -1
  60. data/lua-hooks/ext/luajit/src/host/buildvm_asm.c +9 -4
  61. data/lua-hooks/ext/luajit/src/host/buildvm_fold.c +2 -2
  62. data/lua-hooks/ext/luajit/src/host/buildvm_lib.c +1 -1
  63. data/lua-hooks/ext/luajit/src/host/buildvm_libbc.h +14 -3
  64. data/lua-hooks/ext/luajit/src/host/buildvm_peobj.c +27 -3
  65. data/lua-hooks/ext/luajit/src/host/genlibbc.lua +1 -1
  66. data/lua-hooks/ext/luajit/src/host/genminilua.lua +6 -5
  67. data/lua-hooks/ext/luajit/src/host/minilua.c +1 -1
  68. data/lua-hooks/ext/luajit/src/jit/bc.lua +1 -1
  69. data/lua-hooks/ext/luajit/src/jit/bcsave.lua +8 -8
  70. data/lua-hooks/ext/luajit/src/jit/dis_arm.lua +2 -2
  71. data/lua-hooks/ext/luajit/src/jit/dis_arm64.lua +1216 -0
  72. data/lua-hooks/ext/luajit/src/jit/dis_arm64be.lua +12 -0
  73. data/lua-hooks/ext/luajit/src/jit/dis_mips.lua +35 -20
  74. data/lua-hooks/ext/luajit/src/jit/dis_mips64.lua +17 -0
  75. data/lua-hooks/ext/luajit/src/jit/dis_mips64el.lua +17 -0
  76. data/lua-hooks/ext/luajit/src/jit/dis_mipsel.lua +1 -1
  77. data/lua-hooks/ext/luajit/src/jit/dis_ppc.lua +2 -2
  78. data/lua-hooks/ext/luajit/src/jit/dis_x64.lua +1 -1
  79. data/lua-hooks/ext/luajit/src/jit/dis_x86.lua +7 -4
  80. data/lua-hooks/ext/luajit/src/jit/dump.lua +17 -12
  81. data/lua-hooks/ext/luajit/src/jit/p.lua +3 -2
  82. data/lua-hooks/ext/luajit/src/jit/v.lua +2 -2
  83. data/lua-hooks/ext/luajit/src/jit/zone.lua +1 -1
  84. data/lua-hooks/ext/luajit/src/lauxlib.h +14 -20
  85. data/lua-hooks/ext/luajit/src/lib_aux.c +38 -27
  86. data/lua-hooks/ext/luajit/src/lib_base.c +12 -5
  87. data/lua-hooks/ext/luajit/src/lib_bit.c +1 -1
  88. data/lua-hooks/ext/luajit/src/lib_debug.c +5 -5
  89. data/lua-hooks/ext/luajit/src/lib_ffi.c +2 -2
  90. data/lua-hooks/ext/luajit/src/lib_init.c +16 -16
  91. data/lua-hooks/ext/luajit/src/lib_io.c +6 -7
  92. data/lua-hooks/ext/luajit/src/lib_jit.c +14 -4
  93. data/lua-hooks/ext/luajit/src/lib_math.c +1 -5
  94. data/lua-hooks/ext/luajit/src/lib_os.c +1 -1
  95. data/lua-hooks/ext/luajit/src/lib_package.c +14 -23
  96. data/lua-hooks/ext/luajit/src/lib_string.c +1 -5
  97. data/lua-hooks/ext/luajit/src/lib_table.c +21 -1
  98. data/lua-hooks/ext/luajit/src/lj.supp +3 -3
  99. data/lua-hooks/ext/luajit/src/lj_alloc.c +174 -83
  100. data/lua-hooks/ext/luajit/src/lj_api.c +97 -18
  101. data/lua-hooks/ext/luajit/src/lj_arch.h +54 -22
  102. data/lua-hooks/ext/luajit/src/lj_asm.c +172 -53
  103. data/lua-hooks/ext/luajit/src/lj_asm.h +1 -1
  104. data/lua-hooks/ext/luajit/src/lj_asm_arm.h +19 -16
  105. data/lua-hooks/ext/luajit/src/lj_asm_arm64.h +2022 -0
  106. data/lua-hooks/ext/luajit/src/lj_asm_mips.h +564 -158
  107. data/lua-hooks/ext/luajit/src/lj_asm_ppc.h +19 -18
  108. data/lua-hooks/ext/luajit/src/lj_asm_x86.h +578 -92
  109. data/lua-hooks/ext/luajit/src/lj_bc.c +1 -1
  110. data/lua-hooks/ext/luajit/src/lj_bc.h +1 -1
  111. data/lua-hooks/ext/luajit/src/lj_bcdump.h +1 -1
  112. data/lua-hooks/ext/luajit/src/lj_bcread.c +1 -1
  113. data/lua-hooks/ext/luajit/src/lj_bcwrite.c +1 -1
  114. data/lua-hooks/ext/luajit/src/lj_buf.c +1 -1
  115. data/lua-hooks/ext/luajit/src/lj_buf.h +1 -1
  116. data/lua-hooks/ext/luajit/src/lj_carith.c +1 -1
  117. data/lua-hooks/ext/luajit/src/lj_carith.h +1 -1
  118. data/lua-hooks/ext/luajit/src/lj_ccall.c +172 -7
  119. data/lua-hooks/ext/luajit/src/lj_ccall.h +21 -5
  120. data/lua-hooks/ext/luajit/src/lj_ccallback.c +71 -17
  121. data/lua-hooks/ext/luajit/src/lj_ccallback.h +1 -1
  122. data/lua-hooks/ext/luajit/src/lj_cconv.c +4 -2
  123. data/lua-hooks/ext/luajit/src/lj_cconv.h +1 -1
  124. data/lua-hooks/ext/luajit/src/lj_cdata.c +7 -5
  125. data/lua-hooks/ext/luajit/src/lj_cdata.h +1 -1
  126. data/lua-hooks/ext/luajit/src/lj_clib.c +5 -5
  127. data/lua-hooks/ext/luajit/src/lj_clib.h +1 -1
  128. data/lua-hooks/ext/luajit/src/lj_cparse.c +11 -6
  129. data/lua-hooks/ext/luajit/src/lj_cparse.h +1 -1
  130. data/lua-hooks/ext/luajit/src/lj_crecord.c +70 -14
  131. data/lua-hooks/ext/luajit/src/lj_crecord.h +1 -1
  132. data/lua-hooks/ext/luajit/src/lj_ctype.c +1 -1
  133. data/lua-hooks/ext/luajit/src/lj_ctype.h +8 -8
  134. data/lua-hooks/ext/luajit/src/lj_debug.c +1 -1
  135. data/lua-hooks/ext/luajit/src/lj_debug.h +1 -1
  136. data/lua-hooks/ext/luajit/src/lj_def.h +6 -9
  137. data/lua-hooks/ext/luajit/src/lj_dispatch.c +3 -3
  138. data/lua-hooks/ext/luajit/src/lj_dispatch.h +2 -1
  139. data/lua-hooks/ext/luajit/src/lj_emit_arm.h +5 -4
  140. data/lua-hooks/ext/luajit/src/lj_emit_arm64.h +419 -0
  141. data/lua-hooks/ext/luajit/src/lj_emit_mips.h +100 -20
  142. data/lua-hooks/ext/luajit/src/lj_emit_ppc.h +4 -4
  143. data/lua-hooks/ext/luajit/src/lj_emit_x86.h +116 -25
  144. data/lua-hooks/ext/luajit/src/lj_err.c +34 -13
  145. data/lua-hooks/ext/luajit/src/lj_err.h +1 -1
  146. data/lua-hooks/ext/luajit/src/lj_errmsg.h +1 -1
  147. data/lua-hooks/ext/luajit/src/lj_ff.h +1 -1
  148. data/lua-hooks/ext/luajit/src/lj_ffrecord.c +58 -49
  149. data/lua-hooks/ext/luajit/src/lj_ffrecord.h +1 -1
  150. data/lua-hooks/ext/luajit/src/lj_frame.h +33 -6
  151. data/lua-hooks/ext/luajit/src/lj_func.c +4 -2
  152. data/lua-hooks/ext/luajit/src/lj_func.h +1 -1
  153. data/lua-hooks/ext/luajit/src/lj_gc.c +16 -7
  154. data/lua-hooks/ext/luajit/src/lj_gc.h +1 -1
  155. data/lua-hooks/ext/luajit/src/lj_gdbjit.c +31 -1
  156. data/lua-hooks/ext/luajit/src/lj_gdbjit.h +1 -1
  157. data/lua-hooks/ext/luajit/src/lj_ir.c +69 -96
  158. data/lua-hooks/ext/luajit/src/lj_ir.h +29 -18
  159. data/lua-hooks/ext/luajit/src/lj_ircall.h +24 -30
  160. data/lua-hooks/ext/luajit/src/lj_iropt.h +9 -9
  161. data/lua-hooks/ext/luajit/src/lj_jit.h +67 -9
  162. data/lua-hooks/ext/luajit/src/lj_lex.c +1 -1
  163. data/lua-hooks/ext/luajit/src/lj_lex.h +1 -1
  164. data/lua-hooks/ext/luajit/src/lj_lib.c +1 -1
  165. data/lua-hooks/ext/luajit/src/lj_lib.h +1 -1
  166. data/lua-hooks/ext/luajit/src/lj_load.c +1 -1
  167. data/lua-hooks/ext/luajit/src/lj_mcode.c +11 -10
  168. data/lua-hooks/ext/luajit/src/lj_mcode.h +1 -1
  169. data/lua-hooks/ext/luajit/src/lj_meta.c +1 -1
  170. data/lua-hooks/ext/luajit/src/lj_meta.h +1 -1
  171. data/lua-hooks/ext/luajit/src/lj_obj.c +1 -1
  172. data/lua-hooks/ext/luajit/src/lj_obj.h +7 -3
  173. data/lua-hooks/ext/luajit/src/lj_opt_dce.c +1 -1
  174. data/lua-hooks/ext/luajit/src/lj_opt_fold.c +84 -17
  175. data/lua-hooks/ext/luajit/src/lj_opt_loop.c +1 -1
  176. data/lua-hooks/ext/luajit/src/lj_opt_mem.c +3 -3
  177. data/lua-hooks/ext/luajit/src/lj_opt_narrow.c +24 -22
  178. data/lua-hooks/ext/luajit/src/lj_opt_sink.c +11 -6
  179. data/lua-hooks/ext/luajit/src/lj_opt_split.c +11 -2
  180. data/lua-hooks/ext/luajit/src/lj_parse.c +9 -7
  181. data/lua-hooks/ext/luajit/src/lj_parse.h +1 -1
  182. data/lua-hooks/ext/luajit/src/lj_profile.c +1 -1
  183. data/lua-hooks/ext/luajit/src/lj_profile.h +1 -1
  184. data/lua-hooks/ext/luajit/src/lj_record.c +201 -117
  185. data/lua-hooks/ext/luajit/src/lj_record.h +1 -1
  186. data/lua-hooks/ext/luajit/src/lj_snap.c +72 -26
  187. data/lua-hooks/ext/luajit/src/lj_snap.h +1 -1
  188. data/lua-hooks/ext/luajit/src/lj_state.c +6 -6
  189. data/lua-hooks/ext/luajit/src/lj_state.h +2 -2
  190. data/lua-hooks/ext/luajit/src/lj_str.c +1 -1
  191. data/lua-hooks/ext/luajit/src/lj_str.h +1 -1
  192. data/lua-hooks/ext/luajit/src/lj_strfmt.c +7 -3
  193. data/lua-hooks/ext/luajit/src/lj_strfmt.h +1 -1
  194. data/lua-hooks/ext/luajit/src/lj_strfmt_num.c +4 -3
  195. data/lua-hooks/ext/luajit/src/lj_strscan.c +1 -1
  196. data/lua-hooks/ext/luajit/src/lj_strscan.h +1 -1
  197. data/lua-hooks/ext/luajit/src/lj_tab.c +1 -2
  198. data/lua-hooks/ext/luajit/src/lj_tab.h +1 -1
  199. data/lua-hooks/ext/luajit/src/lj_target.h +3 -3
  200. data/lua-hooks/ext/luajit/src/lj_target_arm.h +1 -1
  201. data/lua-hooks/ext/luajit/src/lj_target_arm64.h +239 -7
  202. data/lua-hooks/ext/luajit/src/lj_target_mips.h +111 -22
  203. data/lua-hooks/ext/luajit/src/lj_target_ppc.h +1 -1
  204. data/lua-hooks/ext/luajit/src/lj_target_x86.h +21 -4
  205. data/lua-hooks/ext/luajit/src/lj_trace.c +63 -18
  206. data/lua-hooks/ext/luajit/src/lj_trace.h +2 -1
  207. data/lua-hooks/ext/luajit/src/lj_traceerr.h +1 -1
  208. data/lua-hooks/ext/luajit/src/lj_udata.c +1 -1
  209. data/lua-hooks/ext/luajit/src/lj_udata.h +1 -1
  210. data/lua-hooks/ext/luajit/src/lj_vm.h +5 -1
  211. data/lua-hooks/ext/luajit/src/lj_vmevent.c +1 -1
  212. data/lua-hooks/ext/luajit/src/lj_vmevent.h +1 -1
  213. data/lua-hooks/ext/luajit/src/lj_vmmath.c +1 -1
  214. data/lua-hooks/ext/luajit/src/ljamalg.c +1 -1
  215. data/lua-hooks/ext/luajit/src/lua.h +9 -1
  216. data/lua-hooks/ext/luajit/src/luaconf.h +3 -7
  217. data/lua-hooks/ext/luajit/src/luajit.c +69 -54
  218. data/lua-hooks/ext/luajit/src/luajit.h +4 -4
  219. data/lua-hooks/ext/luajit/src/lualib.h +1 -1
  220. data/lua-hooks/ext/luajit/src/msvcbuild.bat +12 -4
  221. data/lua-hooks/ext/luajit/src/vm_arm.dasc +1 -1
  222. data/lua-hooks/ext/luajit/src/vm_arm64.dasc +255 -32
  223. data/lua-hooks/ext/luajit/src/vm_mips.dasc +26 -23
  224. data/lua-hooks/ext/luajit/src/vm_mips64.dasc +5062 -0
  225. data/lua-hooks/ext/luajit/src/vm_ppc.dasc +1 -1
  226. data/lua-hooks/ext/luajit/src/vm_x64.dasc +24 -25
  227. data/lua-hooks/ext/luajit/src/vm_x86.dasc +77 -4
  228. data/lua-hooks/libluahooks.darwin.a +0 -0
  229. data/lua-hooks/libluahooks.linux.a +0 -0
  230. data/lua-hooks/options.mk +1 -1
  231. metadata +37 -77
  232. data/lua-hooks/ext/all.c +0 -69
  233. data/lua-hooks/ext/libinjection/COPYING +0 -37
  234. data/lua-hooks/ext/libinjection/libinjection.h +0 -65
  235. data/lua-hooks/ext/libinjection/libinjection_html5.c +0 -847
  236. data/lua-hooks/ext/libinjection/libinjection_html5.h +0 -54
  237. data/lua-hooks/ext/libinjection/libinjection_sqli.c +0 -2301
  238. data/lua-hooks/ext/libinjection/libinjection_sqli.h +0 -295
  239. data/lua-hooks/ext/libinjection/libinjection_sqli_data.h +0 -9349
  240. data/lua-hooks/ext/libinjection/libinjection_xss.c +0 -531
  241. data/lua-hooks/ext/libinjection/libinjection_xss.h +0 -21
  242. data/lua-hooks/ext/libinjection/lualib.c +0 -145
  243. data/lua-hooks/ext/libinjection/module.mk +0 -5
  244. data/lua-hooks/ext/lpeg/HISTORY +0 -96
  245. data/lua-hooks/ext/lpeg/lpcap.c +0 -537
  246. data/lua-hooks/ext/lpeg/lpcap.h +0 -56
  247. data/lua-hooks/ext/lpeg/lpcode.c +0 -1014
  248. data/lua-hooks/ext/lpeg/lpcode.h +0 -40
  249. data/lua-hooks/ext/lpeg/lpeg-128.gif +0 -0
  250. data/lua-hooks/ext/lpeg/lpeg.html +0 -1445
  251. data/lua-hooks/ext/lpeg/lpprint.c +0 -244
  252. data/lua-hooks/ext/lpeg/lpprint.h +0 -36
  253. data/lua-hooks/ext/lpeg/lptree.c +0 -1303
  254. data/lua-hooks/ext/lpeg/lptree.h +0 -82
  255. data/lua-hooks/ext/lpeg/lptypes.h +0 -149
  256. data/lua-hooks/ext/lpeg/lpvm.c +0 -364
  257. data/lua-hooks/ext/lpeg/lpvm.h +0 -58
  258. data/lua-hooks/ext/lpeg/makefile +0 -55
  259. data/lua-hooks/ext/lpeg/module.mk +0 -6
  260. data/lua-hooks/ext/lpeg/re.html +0 -498
  261. data/lua-hooks/ext/lua-cmsgpack/.gitignore +0 -13
  262. data/lua-hooks/ext/lua-cmsgpack/CMakeLists.txt +0 -45
  263. data/lua-hooks/ext/lua-cmsgpack/README.md +0 -115
  264. data/lua-hooks/ext/lua-cmsgpack/lua_cmsgpack.c +0 -970
  265. data/lua-hooks/ext/lua-cmsgpack/module.mk +0 -2
  266. data/lua-hooks/ext/lua-cmsgpack/test.lua +0 -570
  267. data/lua-hooks/ext/lua-snapshot/LICENSE +0 -7
  268. data/lua-hooks/ext/lua-snapshot/Makefile +0 -12
  269. data/lua-hooks/ext/lua-snapshot/README.md +0 -18
  270. data/lua-hooks/ext/lua-snapshot/dump.lua +0 -15
  271. data/lua-hooks/ext/lua-snapshot/module.mk +0 -2
  272. data/lua-hooks/ext/lua-snapshot/snapshot.c +0 -462
  273. data/lua-hooks/ext/luautf8/README.md +0 -152
  274. data/lua-hooks/ext/luautf8/lutf8lib.c +0 -1274
  275. data/lua-hooks/ext/luautf8/module.mk +0 -2
  276. data/lua-hooks/ext/luautf8/unidata.h +0 -3064
  277. data/lua-hooks/ext/module.mk +0 -15
  278. data/lua-hooks/ext/modules.h +0 -17
  279. data/lua-hooks/ext/perf/luacpu.c +0 -114
  280. data/lua-hooks/ext/perf/lualoadavg.c +0 -40
  281. data/lua-hooks/ext/perf/luameminfo.c +0 -38
  282. data/lua-hooks/ext/perf/luaoslib.c +0 -203
  283. data/lua-hooks/ext/perf/module.mk +0 -5
  284. data/lua-hooks/ext/sha1/luasha1.c +0 -74
  285. data/lua-hooks/ext/sha1/module.mk +0 -5
  286. data/lua-hooks/ext/sha1/sha1.c +0 -145
  287. data/lua-hooks/ext/sha2/luasha256.c +0 -77
  288. data/lua-hooks/ext/sha2/module.mk +0 -5
  289. data/lua-hooks/ext/sha2/sha256.c +0 -196
  290. data/lua-hooks/ext/sysutils/lua_utils.c +0 -56
  291. data/lua-hooks/ext/sysutils/module.mk +0 -2
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Table handling.
3
- ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_TAB_H
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Definitions for target CPU.
3
- ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_TARGET_H
@@ -55,7 +55,7 @@ typedef uint32_t RegSP;
55
55
  /* Bitset for registers. 32 registers suffice for most architectures.
56
56
  ** Note that one set holds bits for both GPRs and FPRs.
57
57
  */
58
- #if LJ_TARGET_PPC || LJ_TARGET_MIPS
58
+ #if LJ_TARGET_PPC || LJ_TARGET_MIPS || LJ_TARGET_ARM64
59
59
  typedef uint64_t RegSet;
60
60
  #else
61
61
  typedef uint32_t RegSet;
@@ -69,7 +69,7 @@ typedef uint32_t RegSet;
69
69
  #define rset_set(rs, r) (rs |= RID2RSET(r))
70
70
  #define rset_clear(rs, r) (rs &= ~RID2RSET(r))
71
71
  #define rset_exclude(rs, r) (rs & ~RID2RSET(r))
72
- #if LJ_TARGET_PPC || LJ_TARGET_MIPS
72
+ #if LJ_TARGET_PPC || LJ_TARGET_MIPS || LJ_TARGET_ARM64
73
73
  #define rset_picktop(rs) ((Reg)(__builtin_clzll(rs)^63))
74
74
  #define rset_pickbot(rs) ((Reg)__builtin_ctzll(rs))
75
75
  #else
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Definitions for ARM CPUs.
3
- ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_TARGET_ARM_H
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Definitions for ARM64 CPUs.
3
- ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_TARGET_ARM64_H
@@ -55,7 +55,8 @@ enum {
55
55
 
56
56
  /* Make use of all registers, except for x18, fp, lr and sp. */
57
57
  #define RSET_FIXED \
58
- (RID2RSET(RID_X18)|RID2RSET(RID_FP)|RID2RSET(RID_LR)|RID2RSET(RID_SP))
58
+ (RID2RSET(RID_X18)|RID2RSET(RID_FP)|RID2RSET(RID_LR)|RID2RSET(RID_SP)|\
59
+ RID2RSET(RID_GL))
59
60
  #define RSET_GPR (RSET_RANGE(RID_MIN_GPR, RID_MAX_GPR) - RSET_FIXED)
60
61
  #define RSET_FPR RSET_RANGE(RID_MIN_FPR, RID_MAX_FPR)
61
62
  #define RSET_ALL (RSET_GPR|RSET_FPR)
@@ -73,25 +74,256 @@ enum {
73
74
  #define REGARG_LASTFPR RID_D7
74
75
  #define REGARG_NUMFPR 8
75
76
 
77
+ /* -- Spill slots --------------------------------------------------------- */
78
+
79
+ /* Spill slots are 32 bit wide. An even/odd pair is used for FPRs.
80
+ **
81
+ ** SPS_FIXED: Available fixed spill slots in interpreter frame.
82
+ ** This definition must match with the vm_arm64.dasc file.
83
+ ** Pre-allocate some slots to avoid sp adjust in every root trace.
84
+ **
85
+ ** SPS_FIRST: First spill slot for general use. Reserve min. two 32 bit slots.
86
+ */
87
+ #define SPS_FIXED 4
88
+ #define SPS_FIRST 2
89
+
90
+ #define SPOFS_TMP 0
91
+
92
+ #define sps_scale(slot) (4 * (int32_t)(slot))
93
+ #define sps_align(slot) (((slot) - SPS_FIXED + 3) & ~3)
94
+
95
+ /* -- Exit state ---------------------------------------------------------- */
96
+
97
+ /* This definition must match with the *.dasc file(s). */
98
+ typedef struct {
99
+ lua_Number fpr[RID_NUM_FPR]; /* Floating-point registers. */
100
+ intptr_t gpr[RID_NUM_GPR]; /* General-purpose registers. */
101
+ int32_t spill[256]; /* Spill slots. */
102
+ } ExitState;
103
+
104
+ /* Highest exit + 1 indicates stack check. */
105
+ #define EXITSTATE_CHECKEXIT 1
106
+
107
+ /* Return the address of a per-trace exit stub. */
108
+ static LJ_AINLINE uint32_t *exitstub_trace_addr_(uint32_t *p, uint32_t exitno)
109
+ {
110
+ while (*p == (LJ_LE ? 0xd503201f : 0x1f2003d5)) p++; /* Skip A64I_NOP. */
111
+ return p + 3 + exitno;
112
+ }
113
+ /* Avoid dependence on lj_jit.h if only including lj_target.h. */
114
+ #define exitstub_trace_addr(T, exitno) \
115
+ exitstub_trace_addr_((MCode *)((char *)(T)->mcode + (T)->szmcode), (exitno))
116
+
76
117
  /* -- Instructions -------------------------------------------------------- */
77
118
 
119
+ /* ARM64 instructions are always little-endian. Swap for ARM64BE. */
120
+ #if LJ_BE
121
+ #define A64I_LE(x) (lj_bswap(x))
122
+ #else
123
+ #define A64I_LE(x) (x)
124
+ #endif
125
+
78
126
  /* Instruction fields. */
79
127
  #define A64F_D(r) (r)
80
- #define A64F_N(r) ((r) << 5)
81
- #define A64F_A(r) ((r) << 10)
82
- #define A64F_M(r) ((r) << 16)
128
+ #define A64F_N(r) ((r) << 5)
129
+ #define A64F_A(r) ((r) << 10)
130
+ #define A64F_M(r) ((r) << 16)
131
+ #define A64F_IMMS(x) ((x) << 10)
132
+ #define A64F_IMMR(x) ((x) << 16)
83
133
  #define A64F_U16(x) ((x) << 5)
134
+ #define A64F_U12(x) ((x) << 10)
84
135
  #define A64F_S26(x) (x)
85
- #define A64F_S19(x) ((x) << 5)
136
+ #define A64F_S19(x) (((uint32_t)(x) & 0x7ffffu) << 5)
137
+ #define A64F_S14(x) ((x) << 5)
138
+ #define A64F_S9(x) ((x) << 12)
139
+ #define A64F_BIT(x) ((x) << 19)
140
+ #define A64F_SH(sh, x) (((sh) << 22) | ((x) << 10))
141
+ #define A64F_EX(ex) (A64I_EX | ((ex) << 13))
142
+ #define A64F_EXSH(ex,x) (A64I_EX | ((ex) << 13) | ((x) << 10))
143
+ #define A64F_FP8(x) ((x) << 13)
144
+ #define A64F_CC(cc) ((cc) << 12)
145
+ #define A64F_LSL16(x) (((x) / 16) << 21)
146
+ #define A64F_BSH(sh) ((sh) << 10)
86
147
 
87
148
  typedef enum A64Ins {
149
+ A64I_S = 0x20000000,
150
+ A64I_X = 0x80000000,
151
+ A64I_EX = 0x00200000,
152
+ A64I_ON = 0x00200000,
153
+ A64I_K12 = 0x1a000000,
154
+ A64I_K13 = 0x18000000,
155
+ A64I_LS_U = 0x01000000,
156
+ A64I_LS_S = 0x00800000,
157
+ A64I_LS_R = 0x01200800,
158
+ A64I_LS_SH = 0x00001000,
159
+ A64I_LS_UXTWx = 0x00004000,
160
+ A64I_LS_SXTWx = 0x0000c000,
161
+ A64I_LS_SXTXx = 0x0000e000,
162
+ A64I_LS_LSLx = 0x00006000,
163
+
164
+ A64I_ADDw = 0x0b000000,
165
+ A64I_ADDx = 0x8b000000,
166
+ A64I_ADDSw = 0x2b000000,
167
+ A64I_ADDSx = 0xab000000,
168
+ A64I_NEGw = 0x4b0003e0,
169
+ A64I_NEGx = 0xcb0003e0,
170
+ A64I_SUBw = 0x4b000000,
171
+ A64I_SUBx = 0xcb000000,
172
+ A64I_SUBSw = 0x6b000000,
173
+ A64I_SUBSx = 0xeb000000,
174
+
175
+ A64I_MULw = 0x1b007c00,
176
+ A64I_MULx = 0x9b007c00,
177
+ A64I_SMULL = 0x9b207c00,
178
+
179
+ A64I_ANDw = 0x0a000000,
180
+ A64I_ANDx = 0x8a000000,
181
+ A64I_ANDSw = 0x6a000000,
182
+ A64I_ANDSx = 0xea000000,
183
+ A64I_EORw = 0x4a000000,
184
+ A64I_EORx = 0xca000000,
185
+ A64I_ORRw = 0x2a000000,
186
+ A64I_ORRx = 0xaa000000,
187
+ A64I_TSTw = 0x6a00001f,
188
+ A64I_TSTx = 0xea00001f,
189
+
190
+ A64I_CMPw = 0x6b00001f,
191
+ A64I_CMPx = 0xeb00001f,
192
+ A64I_CMNw = 0x2b00001f,
193
+ A64I_CMNx = 0xab00001f,
194
+ A64I_CCMPw = 0x7a400000,
195
+ A64I_CCMPx = 0xfa400000,
196
+ A64I_CSELw = 0x1a800000,
197
+ A64I_CSELx = 0x9a800000,
198
+
199
+ A64I_ASRw = 0x13007c00,
200
+ A64I_ASRx = 0x9340fc00,
201
+ A64I_LSLx = 0xd3400000,
202
+ A64I_LSRx = 0xd340fc00,
203
+ A64I_SHRw = 0x1ac02000,
204
+ A64I_SHRx = 0x9ac02000, /* lsl/lsr/asr/ror x0, x0, x0 */
205
+ A64I_REVw = 0x5ac00800,
206
+ A64I_REVx = 0xdac00c00,
207
+
208
+ A64I_EXTRw = 0x13800000,
209
+ A64I_EXTRx = 0x93c00000,
210
+ A64I_SBFMw = 0x13000000,
211
+ A64I_SBFMx = 0x93400000,
212
+ A64I_SXTBw = 0x13001c00,
213
+ A64I_SXTHw = 0x13003c00,
214
+ A64I_SXTW = 0x93407c00,
215
+ A64I_UBFMw = 0x53000000,
216
+ A64I_UBFMx = 0xd3400000,
217
+ A64I_UXTBw = 0x53001c00,
218
+ A64I_UXTHw = 0x53003c00,
219
+
220
+ A64I_MOVw = 0x2a0003e0,
221
+ A64I_MOVx = 0xaa0003e0,
222
+ A64I_MVNw = 0x2a2003e0,
223
+ A64I_MVNx = 0xaa2003e0,
224
+ A64I_MOVKw = 0x72800000,
225
+ A64I_MOVKx = 0xf2800000,
88
226
  A64I_MOVZw = 0x52800000,
89
227
  A64I_MOVZx = 0xd2800000,
228
+ A64I_MOVNw = 0x12800000,
229
+ A64I_MOVNx = 0x92800000,
230
+
231
+ A64I_LDRB = 0x39400000,
232
+ A64I_LDRH = 0x79400000,
233
+ A64I_LDRw = 0xb9400000,
234
+ A64I_LDRx = 0xf9400000,
90
235
  A64I_LDRLw = 0x18000000,
91
236
  A64I_LDRLx = 0x58000000,
92
- A64I_NOP = 0xd503201f,
237
+ A64I_STRB = 0x39000000,
238
+ A64I_STRH = 0x79000000,
239
+ A64I_STRw = 0xb9000000,
240
+ A64I_STRx = 0xf9000000,
241
+ A64I_STPw = 0x29000000,
242
+ A64I_STPx = 0xa9000000,
243
+ A64I_LDPw = 0x29400000,
244
+ A64I_LDPx = 0xa9400000,
245
+
93
246
  A64I_B = 0x14000000,
247
+ A64I_BCC = 0x54000000,
248
+ A64I_BL = 0x94000000,
94
249
  A64I_BR = 0xd61f0000,
250
+ A64I_BLR = 0xd63f0000,
251
+ A64I_TBZ = 0x36000000,
252
+ A64I_TBNZ = 0x37000000,
253
+ A64I_CBZ = 0x34000000,
254
+ A64I_CBNZ = 0x35000000,
255
+
256
+ A64I_NOP = 0xd503201f,
257
+
258
+ /* FP */
259
+ A64I_FADDd = 0x1e602800,
260
+ A64I_FSUBd = 0x1e603800,
261
+ A64I_FMADDd = 0x1f400000,
262
+ A64I_FMSUBd = 0x1f408000,
263
+ A64I_FNMADDd = 0x1f600000,
264
+ A64I_FNMSUBd = 0x1f608000,
265
+ A64I_FMULd = 0x1e600800,
266
+ A64I_FDIVd = 0x1e601800,
267
+ A64I_FNEGd = 0x1e614000,
268
+ A64I_FABS = 0x1e60c000,
269
+ A64I_FSQRTd = 0x1e61c000,
270
+ A64I_LDRs = 0xbd400000,
271
+ A64I_LDRd = 0xfd400000,
272
+ A64I_STRs = 0xbd000000,
273
+ A64I_STRd = 0xfd000000,
274
+ A64I_LDPs = 0x2d400000,
275
+ A64I_LDPd = 0x6d400000,
276
+ A64I_STPs = 0x2d000000,
277
+ A64I_STPd = 0x6d000000,
278
+ A64I_FCMPd = 0x1e602000,
279
+ A64I_FCMPZd = 0x1e602008,
280
+ A64I_FCSELd = 0x1e600c00,
281
+ A64I_FRINTMd = 0x1e654000,
282
+ A64I_FRINTPd = 0x1e64c000,
283
+ A64I_FRINTZd = 0x1e65c000,
284
+
285
+ A64I_FCVT_F32_F64 = 0x1e624000,
286
+ A64I_FCVT_F64_F32 = 0x1e22c000,
287
+ A64I_FCVT_F32_S32 = 0x1e220000,
288
+ A64I_FCVT_F64_S32 = 0x1e620000,
289
+ A64I_FCVT_F32_U32 = 0x1e230000,
290
+ A64I_FCVT_F64_U32 = 0x1e630000,
291
+ A64I_FCVT_F32_S64 = 0x9e220000,
292
+ A64I_FCVT_F64_S64 = 0x9e620000,
293
+ A64I_FCVT_F32_U64 = 0x9e230000,
294
+ A64I_FCVT_F64_U64 = 0x9e630000,
295
+ A64I_FCVT_S32_F64 = 0x1e780000,
296
+ A64I_FCVT_S32_F32 = 0x1e380000,
297
+ A64I_FCVT_U32_F64 = 0x1e790000,
298
+ A64I_FCVT_U32_F32 = 0x1e390000,
299
+ A64I_FCVT_S64_F64 = 0x9e780000,
300
+ A64I_FCVT_S64_F32 = 0x9e380000,
301
+ A64I_FCVT_U64_F64 = 0x9e790000,
302
+ A64I_FCVT_U64_F32 = 0x9e390000,
303
+
304
+ A64I_FMOV_S = 0x1e204000,
305
+ A64I_FMOV_D = 0x1e604000,
306
+ A64I_FMOV_R_S = 0x1e260000,
307
+ A64I_FMOV_S_R = 0x1e270000,
308
+ A64I_FMOV_R_D = 0x9e660000,
309
+ A64I_FMOV_D_R = 0x9e670000,
310
+ A64I_FMOV_DI = 0x1e601000,
95
311
  } A64Ins;
96
312
 
313
+ typedef enum A64Shift {
314
+ A64SH_LSL, A64SH_LSR, A64SH_ASR, A64SH_ROR
315
+ } A64Shift;
316
+
317
+ typedef enum A64Extend {
318
+ A64EX_UXTB, A64EX_UXTH, A64EX_UXTW, A64EX_UXTX,
319
+ A64EX_SXTB, A64EX_SXTH, A64EX_SXTW, A64EX_SXTX,
320
+ } A64Extend;
321
+
322
+ /* ARM condition codes. */
323
+ typedef enum A64CC {
324
+ CC_EQ, CC_NE, CC_CS, CC_CC, CC_MI, CC_PL, CC_VS, CC_VC,
325
+ CC_HI, CC_LS, CC_GE, CC_LT, CC_GT, CC_LE, CC_AL,
326
+ CC_HS = CC_CS, CC_LO = CC_CC
327
+ } A64CC;
328
+
97
329
  #endif
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  ** Definitions for MIPS CPUs.
3
- ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
3
+ ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
4
4
  */
5
5
 
6
6
  #ifndef _LJ_TARGET_MIPS_H
@@ -32,6 +32,7 @@ enum {
32
32
  RID_MAX,
33
33
  RID_ZERO = RID_R0,
34
34
  RID_TMP = RID_RA,
35
+ RID_GP = RID_R28,
35
36
 
36
37
  /* Calling conventions. */
37
38
  RID_RET = RID_R2,
@@ -74,46 +75,64 @@ enum {
74
75
 
75
76
  /* -- Register sets ------------------------------------------------------- */
76
77
 
77
- /* Make use of all registers, except ZERO, TMP, SP, SYS1, SYS2 and JGL. */
78
+ /* Make use of all registers, except ZERO, TMP, SP, SYS1, SYS2, JGL and GP. */
78
79
  #define RSET_FIXED \
79
80
  (RID2RSET(RID_ZERO)|RID2RSET(RID_TMP)|RID2RSET(RID_SP)|\
80
- RID2RSET(RID_SYS1)|RID2RSET(RID_SYS2)|RID2RSET(RID_JGL))
81
+ RID2RSET(RID_SYS1)|RID2RSET(RID_SYS2)|RID2RSET(RID_JGL)|RID2RSET(RID_GP))
81
82
  #define RSET_GPR (RSET_RANGE(RID_MIN_GPR, RID_MAX_GPR) - RSET_FIXED)
82
83
  #if LJ_SOFTFP
83
- #define RSET_FPR 0
84
+ #define RSET_FPR 0
84
85
  #else
86
+ #if LJ_32
85
87
  #define RSET_FPR \
86
88
  (RID2RSET(RID_F0)|RID2RSET(RID_F2)|RID2RSET(RID_F4)|RID2RSET(RID_F6)|\
87
89
  RID2RSET(RID_F8)|RID2RSET(RID_F10)|RID2RSET(RID_F12)|RID2RSET(RID_F14)|\
88
90
  RID2RSET(RID_F16)|RID2RSET(RID_F18)|RID2RSET(RID_F20)|RID2RSET(RID_F22)|\
89
91
  RID2RSET(RID_F24)|RID2RSET(RID_F26)|RID2RSET(RID_F28)|RID2RSET(RID_F30))
92
+ #else
93
+ #define RSET_FPR RSET_RANGE(RID_MIN_FPR, RID_MAX_FPR)
94
+ #endif
90
95
  #endif
91
- #define RSET_ALL (RSET_GPR|RSET_FPR)
92
- #define RSET_INIT RSET_ALL
96
+ #define RSET_ALL (RSET_GPR|RSET_FPR)
97
+ #define RSET_INIT RSET_ALL
93
98
 
94
99
  #define RSET_SCRATCH_GPR \
95
100
  (RSET_RANGE(RID_R1, RID_R15+1)|\
96
- RID2RSET(RID_R24)|RID2RSET(RID_R25)|RID2RSET(RID_R28))
101
+ RID2RSET(RID_R24)|RID2RSET(RID_R25))
97
102
  #if LJ_SOFTFP
98
103
  #define RSET_SCRATCH_FPR 0
99
104
  #else
105
+ #if LJ_32
100
106
  #define RSET_SCRATCH_FPR \
101
107
  (RID2RSET(RID_F0)|RID2RSET(RID_F2)|RID2RSET(RID_F4)|RID2RSET(RID_F6)|\
102
108
  RID2RSET(RID_F8)|RID2RSET(RID_F10)|RID2RSET(RID_F12)|RID2RSET(RID_F14)|\
103
109
  RID2RSET(RID_F16)|RID2RSET(RID_F18))
110
+ #else
111
+ #define RSET_SCRATCH_FPR RSET_RANGE(RID_F0, RID_F24)
112
+ #endif
104
113
  #endif
105
114
  #define RSET_SCRATCH (RSET_SCRATCH_GPR|RSET_SCRATCH_FPR)
106
115
  #define REGARG_FIRSTGPR RID_R4
116
+ #if LJ_32
107
117
  #define REGARG_LASTGPR RID_R7
108
118
  #define REGARG_NUMGPR 4
119
+ #else
120
+ #define REGARG_LASTGPR RID_R11
121
+ #define REGARG_NUMGPR 8
122
+ #endif
109
123
  #if LJ_ABI_SOFTFP
110
124
  #define REGARG_FIRSTFPR 0
111
125
  #define REGARG_LASTFPR 0
112
126
  #define REGARG_NUMFPR 0
113
127
  #else
114
128
  #define REGARG_FIRSTFPR RID_F12
129
+ #if LJ_32
115
130
  #define REGARG_LASTFPR RID_F14
116
131
  #define REGARG_NUMFPR 2
132
+ #else
133
+ #define REGARG_LASTFPR RID_F19
134
+ #define REGARG_NUMFPR 8
135
+ #endif
117
136
  #endif
118
137
 
119
138
  /* -- Spill slots --------------------------------------------------------- */
@@ -125,7 +144,11 @@ enum {
125
144
  **
126
145
  ** SPS_FIRST: First spill slot for general use.
127
146
  */
147
+ #if LJ_32
128
148
  #define SPS_FIXED 5
149
+ #else
150
+ #define SPS_FIXED 4
151
+ #endif
129
152
  #define SPS_FIRST 4
130
153
 
131
154
  #define SPOFS_TMP 0
@@ -140,7 +163,7 @@ typedef struct {
140
163
  #if !LJ_SOFTFP
141
164
  lua_Number fpr[RID_NUM_FPR]; /* Floating-point registers. */
142
165
  #endif
143
- int32_t gpr[RID_NUM_GPR]; /* General-purpose registers. */
166
+ intptr_t gpr[RID_NUM_GPR]; /* General-purpose registers. */
144
167
  int32_t spill[256]; /* Spill slots. */
145
168
  } ExitState;
146
169
 
@@ -169,32 +192,41 @@ static LJ_AINLINE uint32_t *exitstub_trace_addr_(uint32_t *p)
169
192
  #define MIPSF_F(r) ((r) << 6)
170
193
  #define MIPSF_A(n) ((n) << 6)
171
194
  #define MIPSF_M(n) ((n) << 11)
195
+ #define MIPSF_L(n) ((n) << 6)
172
196
 
173
197
  typedef enum MIPSIns {
198
+ MIPSI_D = 0x38,
199
+ MIPSI_DV = 0x10,
200
+ MIPSI_D32 = 0x3c,
174
201
  /* Integer instructions. */
175
- MIPSI_MOVE = 0x00000021,
202
+ MIPSI_MOVE = 0x00000025,
176
203
  MIPSI_NOP = 0x00000000,
177
204
 
178
205
  MIPSI_LI = 0x24000000,
179
206
  MIPSI_LU = 0x34000000,
180
207
  MIPSI_LUI = 0x3c000000,
181
208
 
182
- MIPSI_ADDIU = 0x24000000,
209
+ MIPSI_AND = 0x00000024,
183
210
  MIPSI_ANDI = 0x30000000,
211
+ MIPSI_OR = 0x00000025,
184
212
  MIPSI_ORI = 0x34000000,
213
+ MIPSI_XOR = 0x00000026,
185
214
  MIPSI_XORI = 0x38000000,
215
+ MIPSI_NOR = 0x00000027,
216
+
217
+ MIPSI_SLT = 0x0000002a,
218
+ MIPSI_SLTU = 0x0000002b,
186
219
  MIPSI_SLTI = 0x28000000,
187
220
  MIPSI_SLTIU = 0x2c000000,
188
221
 
189
222
  MIPSI_ADDU = 0x00000021,
223
+ MIPSI_ADDIU = 0x24000000,
224
+ MIPSI_SUB = 0x00000022,
190
225
  MIPSI_SUBU = 0x00000023,
191
226
  MIPSI_MUL = 0x70000002,
192
- MIPSI_AND = 0x00000024,
193
- MIPSI_OR = 0x00000025,
194
- MIPSI_XOR = 0x00000026,
195
- MIPSI_NOR = 0x00000027,
196
- MIPSI_SLT = 0x0000002a,
197
- MIPSI_SLTU = 0x0000002b,
227
+ MIPSI_DIV = 0x0000001a,
228
+ MIPSI_DIVU = 0x0000001b,
229
+
198
230
  MIPSI_MOVZ = 0x0000000a,
199
231
  MIPSI_MOVN = 0x0000000b,
200
232
  MIPSI_MFHI = 0x00000010,
@@ -204,19 +236,24 @@ typedef enum MIPSIns {
204
236
  MIPSI_SLL = 0x00000000,
205
237
  MIPSI_SRL = 0x00000002,
206
238
  MIPSI_SRA = 0x00000003,
207
- MIPSI_ROTR = 0x00200002, /* MIPS32R2 */
239
+ MIPSI_ROTR = 0x00200002, /* MIPSXXR2 */
240
+ MIPSI_DROTR = 0x0020003a,
241
+ MIPSI_DROTR32 = 0x0020003e,
208
242
  MIPSI_SLLV = 0x00000004,
209
243
  MIPSI_SRLV = 0x00000006,
210
244
  MIPSI_SRAV = 0x00000007,
211
- MIPSI_ROTRV = 0x00000046, /* MIPS32R2 */
245
+ MIPSI_ROTRV = 0x00000046, /* MIPSXXR2 */
246
+ MIPSI_DROTRV = 0x00000056,
212
247
 
213
- MIPSI_SEB = 0x7c000420, /* MIPS32R2 */
214
- MIPSI_SEH = 0x7c000620, /* MIPS32R2 */
215
- MIPSI_WSBH = 0x7c0000a0, /* MIPS32R2 */
248
+ MIPSI_SEB = 0x7c000420, /* MIPSXXR2 */
249
+ MIPSI_SEH = 0x7c000620, /* MIPSXXR2 */
250
+ MIPSI_WSBH = 0x7c0000a0, /* MIPSXXR2 */
251
+ MIPSI_DSBH = 0x7c0000a4,
216
252
 
217
253
  MIPSI_B = 0x10000000,
218
254
  MIPSI_J = 0x08000000,
219
255
  MIPSI_JAL = 0x0c000000,
256
+ MIPSI_JALX = 0x74000000,
220
257
  MIPSI_JR = 0x00000008,
221
258
  MIPSI_JALR = 0x0000f809,
222
259
 
@@ -229,7 +266,9 @@ typedef enum MIPSIns {
229
266
 
230
267
  /* Load/store instructions. */
231
268
  MIPSI_LW = 0x8c000000,
269
+ MIPSI_LD = 0xdc000000,
232
270
  MIPSI_SW = 0xac000000,
271
+ MIPSI_SD = 0xfc000000,
233
272
  MIPSI_LB = 0x80000000,
234
273
  MIPSI_SB = 0xa0000000,
235
274
  MIPSI_LH = 0x84000000,
@@ -241,6 +280,50 @@ typedef enum MIPSIns {
241
280
  MIPSI_LDC1 = 0xd4000000,
242
281
  MIPSI_SDC1 = 0xf4000000,
243
282
 
283
+ /* MIPS64 instructions. */
284
+ MIPSI_DADD = 0x0000002c,
285
+ MIPSI_DADDI = 0x60000000,
286
+ MIPSI_DADDU = 0x0000002d,
287
+ MIPSI_DADDIU = 0x64000000,
288
+ MIPSI_DSUB = 0x0000002e,
289
+ MIPSI_DSUBU = 0x0000002f,
290
+ MIPSI_DDIV = 0x0000001e,
291
+ MIPSI_DDIVU = 0x0000001f,
292
+ MIPSI_DMULT = 0x0000001c,
293
+ MIPSI_DMULTU = 0x0000001d,
294
+
295
+ MIPSI_DSLL = 0x00000038,
296
+ MIPSI_DSRL = 0x0000003a,
297
+ MIPSI_DSLLV = 0x00000014,
298
+ MIPSI_DSRLV = 0x00000016,
299
+ MIPSI_DSRA = 0x0000003b,
300
+ MIPSI_DSRAV = 0x00000017,
301
+ MIPSI_DSRA32 = 0x0000003f,
302
+ MIPSI_DSLL32 = 0x0000003c,
303
+ MIPSI_DSRL32 = 0x0000003e,
304
+ MIPSI_DSHD = 0x7c000164,
305
+
306
+ MIPSI_AADDU = LJ_32 ? MIPSI_ADDU : MIPSI_DADDU,
307
+ MIPSI_AADDIU = LJ_32 ? MIPSI_ADDIU : MIPSI_DADDIU,
308
+ MIPSI_ASUBU = LJ_32 ? MIPSI_SUBU : MIPSI_DSUBU,
309
+ MIPSI_AL = LJ_32 ? MIPSI_LW : MIPSI_LD,
310
+ MIPSI_AS = LJ_32 ? MIPSI_SW : MIPSI_SD,
311
+
312
+ /* Extract/insert instructions. */
313
+ MIPSI_DEXTM = 0x7c000001,
314
+ MIPSI_DEXTU = 0x7c000002,
315
+ MIPSI_DEXT = 0x7c000003,
316
+ MIPSI_DINSM = 0x7c000005,
317
+ MIPSI_DINSU = 0x7c000006,
318
+ MIPSI_DINS = 0x7c000007,
319
+
320
+ MIPSI_RINT_D = 0x4620001a,
321
+ MIPSI_RINT_S = 0x4600001a,
322
+ MIPSI_RINT = 0x4400001a,
323
+ MIPSI_FLOOR_D = 0x4620000b,
324
+ MIPSI_CEIL_D = 0x4620000a,
325
+ MIPSI_ROUND_D = 0x46200008,
326
+
244
327
  /* FP instructions. */
245
328
  MIPSI_MOV_S = 0x46000006,
246
329
  MIPSI_MOV_D = 0x46200006,
@@ -265,24 +348,30 @@ typedef enum MIPSIns {
265
348
  MIPSI_CVT_W_D = 0x46200024,
266
349
  MIPSI_CVT_S_W = 0x46800020,
267
350
  MIPSI_CVT_D_W = 0x46800021,
351
+ MIPSI_CVT_S_L = 0x46a00020,
352
+ MIPSI_CVT_D_L = 0x46a00021,
268
353
 
269
354
  MIPSI_TRUNC_W_S = 0x4600000d,
270
355
  MIPSI_TRUNC_W_D = 0x4620000d,
356
+ MIPSI_TRUNC_L_S = 0x46000009,
357
+ MIPSI_TRUNC_L_D = 0x46200009,
271
358
  MIPSI_FLOOR_W_S = 0x4600000f,
272
359
  MIPSI_FLOOR_W_D = 0x4620000f,
273
360
 
274
361
  MIPSI_MFC1 = 0x44000000,
275
362
  MIPSI_MTC1 = 0x44800000,
363
+ MIPSI_DMTC1 = 0x44a00000,
364
+ MIPSI_DMFC1 = 0x44200000,
276
365
 
277
366
  MIPSI_BC1F = 0x45000000,
278
367
  MIPSI_BC1T = 0x45010000,
279
368
 
280
369
  MIPSI_C_EQ_D = 0x46200032,
370
+ MIPSI_C_OLT_S = 0x46000034,
281
371
  MIPSI_C_OLT_D = 0x46200034,
282
372
  MIPSI_C_ULT_D = 0x46200035,
283
373
  MIPSI_C_OLE_D = 0x46200036,
284
374
  MIPSI_C_ULE_D = 0x46200037,
285
-
286
375
  } MIPSIns;
287
376
 
288
377
  #endif