Commit Graph

2314 Commits

Author SHA1 Message Date
Michael Munday
22a95498b6 Delete old BUG comment. 2017-01-30 16:44:15 -05:00
Michael Munday
58460de58f Hoist some loop invariants. 2017-01-30 16:40:32 -05:00
Michael Munday
8141ca5d63 Simplify right rotations. 2017-01-30 16:24:06 -05:00
Michael Munday
a06bfc99f7 Remove various TODOs. 2017-01-30 16:12:50 -05:00
Michael Munday
f13d2314e0 Use z10 instructions more frequently.
It would be nice to support the base z/Architecture but it has
quite a big impact on performance to do so. z10 gives us most
of the desirable instructions. It should be possible to emulate the
instructions if earlier machines were ever targetted.
2017-01-30 16:00:11 -05:00
Michael Munday
7b6aa863c2 Remove TODOs for branch on index.
It is probably not suitable (relies on even-odd register numbering).
2017-01-18 16:36:32 -05:00
Michael Munday
5f72b2313d Remove unnecessary register moves. 2017-01-18 16:18:56 -05:00
Michael Munday
d475b5b93e Add some TODOs to the saveregs and restoreregs macros.
When unwinding the stack using the internal unwinder we may need to
restore floating point registers clobbered by C calls. Since I'm
not sure yet I'm going to be conservative and save/restore them
for now. Most probably we want to, at the very least, avoid restoring
them when cleanly exiting the interpreter.
2017-01-18 15:43:24 -05:00
Michael Munday
908528d801 Revert "Avoid saving/restoring floating point registers when entering the interpreter."
This reverts commit e151edea53.
2017-01-18 15:39:39 -05:00
Michael Munday
e7e346f529 Implement support for unwinding through FFI stack frames.
The DWARF here is a little incomplete, unwinding won't work while
executing the first two instructions in vm_ffi_call.
2017-01-18 15:08:58 -05:00
Michael Munday
34394c49b1 Add file change missing from previous commit (needed for EXT unwinding). 2017-01-18 14:18:40 -05:00
Michael Munday
0a18b89a04 Implement the LUAJIT_UNWIND_EXTERNAL option.
Still need to add support for FFI.
2017-01-18 12:38:53 -05:00
Michael Munday
9d0846ea91 Add debug frame information to the interpreter.
Allows gdb to backtrace from inside the interpreter. Still need to
add FFI support.
2017-01-17 17:26:00 -05:00
Michael Munday
77852cbe0b Don't bother saving BASE before a call unless it will be modified.
BASE is callee-saved anyway, so we don't need to save it in RB.
2017-01-17 17:23:53 -05:00
Michael Munday
e151edea53 Avoid saving/restoring floating point registers when entering the interpreter.
We only need to worry about doing this if we actually use those
floating point registers.
2017-01-17 14:05:31 -05:00
Michael Munday
695c59703c Swap register assignments for BASE and RB.
Feels more natural this way round. Puts all parameters in the range
[r4,r7] and BASE is now the register used as the literal pool, which
seems appropriate.
2017-01-17 09:46:02 -05:00
Michael Munday
a40e905aec Implement return hooks. 2017-01-16 16:28:21 -05:00
Michael Munday
828bf84999 Rename TMPR2 as TMPR0.
TMPR2 was r0 and so cannot be used in address calculations (or
shift values). Renaming it TMPR0 makes this more obvious.
2017-01-16 16:14:51 -05:00
Michael Munday
70b5f6b966 Make TMPR1 r1 and RA r4.
This avoids using the link register as a temporary.
2017-01-16 16:11:24 -05:00
Michael Munday
a9d61d0044 Implement debug.sethook(). 2017-01-16 15:52:23 -05:00
Michael Munday
9e9a1cf0a5 Replace lay with la where possible. 2017-01-11 16:55:50 -05:00
Michael Munday
a3bb1cee5d Add and use branch on count instructions where possible. 2017-01-11 16:38:35 -05:00
Michael Munday
c8db1b960c Clean up register allocations and comments slightly.
Move RB from r12 to r13 so that it no longer overlaps with the
GOT pointer (to avoid potential problems with PIC compilation).
2017-01-11 16:16:51 -05:00
Michael Munday
084ab26280 Delete LREG and replace it's uses with RB.
This frees up a register and fixes a bug where RB was not loaded
correctly into LREG.
2017-01-11 14:42:24 -05:00
Michael Munday
65906fbc49 Fix typo in lj_ccallback.h
For future reference only, we aren't using this bit of code yet.
2017-01-11 12:46:30 -05:00
Michael Munday
5c697cc772 Fix ffi calls returning structs. 2017-01-11 12:13:59 -05:00
Michael Munday
f660d36138 Fix ffi calls with complex parameters. 2017-01-11 12:13:52 -05:00
ketank-new
db99c31890 Added example for 'TM' instruction 2017-01-11 17:04:09 +05:30
Michael Munday
938f964b6a Fix single-precision floating point parameters passed on stack.
The opposite way round to the registers for some reason.
2017-01-10 16:56:43 -05:00
Michael Munday
86a24eac4a Various fixes for FFI calls.
Fixes the following scenarios:
 * Returning floating point value.
 * More than 4 GPR arguments.
2017-01-10 16:11:30 -05:00
Michael Munday
e933353feb Use execute rather than loop for mvc and avoid jumps in fast path.
Not sure if this works, the tests don't exercise the stack code.
2017-01-10 14:12:06 -05:00
Michael Munday
660ddd1db2 Replace some instruction sequences with their SI equivalents. 2017-01-10 12:52:45 -05:00
Michael Munday
21655cf90b Add remaining (useful) SI instructions to DynASM. 2017-01-10 12:52:02 -05:00
Michael Munday
55af819e97 Remove TODO. 2017-01-10 12:04:17 -05:00
Michael Munday
102d848577 Minor instruction changes. 2017-01-10 11:58:24 -05:00
Michael Munday
d44390a2d3 Use tm{,y} instructions where possible. 2017-01-10 11:44:27 -05:00
Michael Munday
a038a08189 Fix SI (tm) action parsing. 2017-01-10 11:37:25 -05:00
Michael Munday
a8562b7f34 Allow displacements to be used directly without register values.
Allows sllg r1, r1, 3(r0,r0) to be written as sllg r1, r1, 3.
2017-01-10 10:50:41 -05:00
Michael Munday
dae61f59d6 Delete some unused function stubs. 2017-01-09 15:57:37 -05:00
Michael Munday
4c738134df Improve ins_NEXT performance.
Prioritise critical path and reduce number of instructions. About
10% improvement on md5 benchmark.
2017-01-09 14:16:44 -05:00
Michael Munday
99b3668995 Add stub dis_s390x.lua file to allow make install to work. 2017-01-09 11:20:13 -05:00
Michael Munday
bb98985db3 Add partial FFI support.
Interestingly, enough to pass all the FFI tests. So s390x now
passes all the tests in LuaJIT-test-cleanup.
2017-01-06 16:19:56 -05:00
Michael Munday
5dec8c2211 Fix vm_tsetr (needed by table.remove).
The A argument was being loaded as 2-bytes instead of 1.
2017-01-06 13:54:28 -05:00
Michael Munday
ed2d43d73c Fix VARG. 2017-01-06 11:47:56 -05:00
Michael Munday
2e05e7ca67 Implement math.floor/math.ceil. 2017-01-06 11:16:33 -05:00
Michael Munday
443814b6b3 Add more convert to/from fixed instructions to DynASM. 2017-01-06 11:16:04 -05:00
Michael Munday
a3501b062d Various fixes for coroutines.
Now passing the tests.
2017-01-05 23:39:25 -05:00
Michael Munday
d90293f55e Implement coroutines.
TODO: delete LREG, caused problems while implementing this (x64
doesn't have LREG).
2017-01-05 23:39:25 -05:00
Michael Munday
60fb35cb68 Implement rawget. 2017-01-05 23:39:25 -05:00
ketank-new
c08fa1c119 Enabled math.pow ,math.min and math.max 2017-01-06 10:01:36 +05:30