Mike Pall
4f2f44dd97
Avoid compiler warnings.
2010-12-22 23:20:50 +01:00
Mike Pall
dbab6cf511
Reassociate XLOAD across PHIs to handle a[i-1] forwarding case.
...
Improved SciMark scores: http://luajit.org/download/scimark.lua
x86 SciMark LARGE | FFT SOR MC SPARSE LU
-----------------------+---------------------------------------
GCC 4.4.3 623.8 | 91.0 883.5 190.4 784.7 1169.6
LuaJIT git +FFI 651.2 | 97.2 1021.9 323.4 673.7 1139.6
LuaJIT git 527.7 | 91.4 1008.5 225.6 400.0 913.2
x64 SciMark LARGE | FFT SOR MC SPARSE LU
-----------------------+---------------------------------------
GCC 4.4.3 614.7 | 97.7 883.5 228.5 734.0 1129.9
JVM 1.6.0_22 707.5 | 79.2 1118.1 385.5 658.9 1295.7
LuaJIT git +FFI 632.8 | 89.1 1035.8 298.3 648.1 1092.9
LuaJIT git 516.1 | 88.4 995.4 225.6 382.1 888.9
2010-12-20 22:32:01 +01:00
Mike Pall
c8d6f078a5
Fix XSTORE for IRT_NUM constants.
2010-12-20 19:34:15 +01:00
Mike Pall
c9a0b9ea9e
Improve alias analysis for cdata allocations.
2010-12-20 15:26:05 +01:00
Mike Pall
255c6e8c87
FFI: Drop IR_CNEWI. Add IR_CNEWP only for pointers/refs.
2010-12-17 17:20:04 +01:00
Mike Pall
c98132e182
FFI: FOLD load of initializers even across PHIs.
2010-12-17 16:47:28 +01:00
Mike Pall
c4a0fb4f60
FFI: Record copy-by-value for pointer and complex C types.
2010-12-17 16:47:14 +01:00
Mike Pall
09ef7ebf56
FFI: Simplify copy-by-value. Strip attributes, keep qualifiers.
2010-12-15 21:47:46 +01:00
Mike Pall
fbcc925a2d
FFI: Fix auto-deref of pointers to structs.
2010-12-15 19:48:20 +01:00
Mike Pall
badff4ed0a
Fix error location while recording metamethods.
2010-12-15 19:44:30 +01:00
Mike Pall
9666cf52ce
Fix type-based alias analysis for XLOAD/XSTORE.
2010-12-12 23:09:26 +01:00
Mike Pall
74317fa0ef
Add alias analysis for XLOAD/XSTORE. Add DSE for XSTORE.
2010-12-12 22:32:52 +01:00
Mike Pall
a22ea8898e
FOLD (base+k)+(idx*sz)+ofs ==> (base+idx*sz)+(ofs+k).
2010-12-12 21:07:23 +01:00
Mike Pall
a403cb13e4
Add missing PHI barrier to strength reduction of widening.
2010-12-12 21:05:34 +01:00
Mike Pall
42f9b38663
Extend all FOLD rules to work on 64 bit integers.
2010-12-11 21:20:49 +01:00
Mike Pall
476259e87e
Add 64 bit bswap and rotates.
2010-12-11 21:20:12 +01:00
Mike Pall
5f7e9173db
Regroup FOLD rules for constant folding.
2010-12-11 20:08:07 +01:00
Mike Pall
44101c64e8
FFI: Don't use KNULL for arbitrary NULL pointers.
2010-12-11 20:12:14 +01:00
Mike Pall
cdac0fa2cb
FFI: Add IR_CNEW/IR_CNEWI to allocate/init cdata objects.
2010-12-11 19:32:12 +01:00
Mike Pall
6947493687
Turn lj_mem_newgco() into a fastcall.
2010-12-10 01:10:52 +01:00
Mike Pall
09e2bdbb0a
FFI: Always specialize to the field name for struct access.
2010-12-09 22:48:01 +01:00
Mike Pall
870bcd7640
Add missing guard for check against "#" when recording select().
2010-12-09 22:35:49 +01:00
Mike Pall
cc0efd85d6
FFI: Fix alignment of scalars/vectors modified with mode attribute.
2010-12-09 18:48:23 +01:00
Mike Pall
1d86090926
Strength-reduce 32 to 64 bit widening using scalar evolution analysis.
2010-12-09 16:12:59 +01:00
Mike Pall
36fed9f3e1
Allow integer literals in FOLD rules.
...
Workaround before refactoring conversion ops.
2010-12-09 16:11:15 +01:00
Mike Pall
e9cab5a763
x86/x64 backend: keep invariants on the right rather than fusing loads.
2010-12-09 16:08:55 +01:00
Mike Pall
4f0d3e8262
Apply narrowing optimization to IR_TOI64, too.
2010-12-08 21:03:45 +01:00
Mike Pall
f308e00e03
Add FOLD rule to reassociate 64 bit (x+k1)+k2.
2010-12-08 20:57:21 +01:00
Mike Pall
d0b283e596
Avoid stack resizes while recording calls to vararg functions.
...
FUNCV might have been recorded twice (with ill effects).
2010-12-08 19:11:58 +01:00
Mike Pall
6a04591b7b
FOLD (base+(idx+k)*sz)+ofs ==> (base+idx*sz)+(ofs+k*sz).
2010-12-08 03:33:48 +01:00
Mike Pall
3c78a7f468
Avoid fusing loads if there are multiple references.
2010-12-08 03:26:53 +01:00
Mike Pall
72744dabd9
Fix IRT_NUM support for XLOAD/XSTORE.
2010-12-08 03:24:35 +01:00
Mike Pall
3ef6a53cfa
FFI: Turn cdata indexing into x86/x64 [base+idx*sz+ofs] addressing.
2010-12-08 02:36:09 +01:00
Mike Pall
d778680098
FFI: Record cdata index operations (preliminary, lots of NYI cases).
2010-12-08 02:11:18 +01:00
Mike Pall
2a917a9d83
FFI: Treat cdata metatable+methods as immutable in trace recorder.
2010-12-08 02:02:21 +01:00
Mike Pall
d4d95ee2da
Fix x64 code generation for A16+REX prefixed instructions.
2010-12-08 01:57:50 +01:00
Mike Pall
e6093b129a
Fix register allocation for 8 bit stores in x86 backend.
2010-12-07 01:18:10 +01:00
Mike Pall
b3c4c0810a
Add IRT_NUM support to XLOAD/XSTORE.
2010-12-06 19:28:51 +01:00
Mike Pall
159f51d811
Add IR_TOI64.
2010-12-06 18:21:51 +01:00
Mike Pall
f6c4e8d3d7
Add FOLD rule to turn i << 1 into i + i.
2010-12-06 13:26:58 +01:00
Mike Pall
a5bdae8f23
Fix 64 bit shifts in backend. Fix shift by 0.
2010-12-06 13:16:35 +01:00
Mike Pall
5270586a80
Fix XLOAD/XSTORE references.
2010-12-06 13:15:53 +01:00
Mike Pall
86fd2289f0
Add support for integer IR_MUL.
2010-12-06 12:54:00 +01:00
Mike Pall
b56b83487f
Support all kinds of XLOAD/XSTORE references in backend.
...
Fuse pointer arithmetic, too.
2010-12-06 03:10:28 +01:00
Mike Pall
a850b27da9
Avoid compiler warnings.
2010-12-06 03:07:10 +01:00
Mike Pall
e137408752
Use native IRT_PTR instead of IRT_LIGHTUD workaround for FILE*.
2010-12-06 02:14:39 +01:00
Mike Pall
73bc83cda1
Simplify lj_ir_kvalue(). Fix IR_KNULL + IRT_P64 case.
2010-12-06 02:12:08 +01:00
Mike Pall
4755765e32
Avoid warning.
2010-12-06 01:59:07 +01:00
Mike Pall
db3d16bfd7
Add IR_XSTORE.
2010-12-06 01:48:19 +01:00
Mike Pall
281f426d60
Add minimal set of fold rules for KINT64.
2010-12-06 00:38:21 +01:00
Mike Pall
588fa0481f
Add support for 64 bit integer arithmetic to x64 backend.
2010-12-06 00:07:36 +01:00
Mike Pall
c5f4f607c9
Fix xmm spill/restore broken by b1fb71fb
.
2010-12-05 22:39:36 +01:00
Mike Pall
5a13fa69d9
Add IR_KINT64.
2010-12-05 22:12:31 +01:00
Mike Pall
b1fb71fb98
Cleanup 64 bit IR type handling.
2010-12-05 21:01:08 +01:00
Mike Pall
6a7605ec85
Rename IRT_PTR to IRT_P32.
2010-12-05 18:59:34 +01:00
Mike Pall
26830d070d
Make sure to use irt_toitype() macro everywhere.
2010-12-05 18:51:37 +01:00
Mike Pall
e7f8cc964e
Split off fast function recording to lj_ffrecord.c.
2010-12-05 17:12:34 +01:00
Mike Pall
ffa5a2b045
Don't export internal symbol.
2010-12-05 01:08:19 +01:00
Mike Pall
7cb250c4b4
FFI: Add ffi.* library.
2010-12-05 00:52:17 +01:00
Mike Pall
513b0ba18f
FFI: Add support for converting cdata to tonumber().
2010-12-05 00:40:23 +01:00
Mike Pall
233076d3f9
FFI: Add C declaration parser.
2010-12-05 00:20:59 +01:00
Mike Pall
526e087e63
FFI: Add C data handling and C type conversions.
2010-12-05 00:18:07 +01:00
Mike Pall
05973ee440
FFI: Add C type management.
2010-12-05 00:11:35 +01:00
Mike Pall
8679ca5792
POSIX is an acronym.
2010-12-04 20:47:51 +01:00
Mike Pall
100a00dd40
Undo ef8c2648
.
2010-12-03 16:58:19 +01:00
Mike Pall
d98cd19bb0
Allow access to raw error messages from outside lj_err.c.
2010-12-01 12:54:32 +01:00
Mike Pall
0ffd06aba8
FFI: Add define to disable the FFI library.
2010-11-30 21:56:57 +01:00
Mike Pall
4ed8a1931b
Add support for deferred library loads to lib_init.c.
2010-11-30 21:56:03 +01:00
Mike Pall
443c542e26
Fix check for enabled JIT compiler in lj_trace.h.
2010-11-30 18:32:22 +01:00
Mike Pall
cd1901370d
Rearrange src/Makefile. Split features and debugging support.
2010-11-30 16:19:20 +01:00
Mike Pall
592cf3ffac
Don't mark REF_BASE in DCE.
2010-11-29 16:00:44 +01:00
Mike Pall
2033d6310b
Add shorter defines for endianess checks.
2010-11-28 17:22:45 +01:00
Mike Pall
24186e05e6
Remove metamethod frame for errors from internal metamethods.
2010-11-27 20:23:39 +01:00
Mike Pall
35890f66c1
FFI: Don't propagate cdata objects.
2010-11-26 17:27:02 +01:00
Mike Pall
ef8c264873
FFI: Add macros for consistent number to integer truncation.
2010-11-26 13:40:40 +01:00
Mike Pall
2fd1292955
FFI: Add cdata object type.
2010-11-26 13:28:46 +01:00
Mike Pall
6290d6f5d0
Display caller location in errors from metamethods.
2010-11-26 13:20:56 +01:00
Mike Pall
7840d0b2b0
Shrink slots for 'break' statement to help data-flow analysis.
2010-11-25 12:13:23 +01:00
Mike Pall
18fbf86c9e
Improve unrolling heuristics for non-looping inner loops.
2010-11-25 11:42:17 +01:00
Mike Pall
7338456796
Support os.exit(status|true|false [,close]) (from Lua 5.2).
2010-11-22 22:39:06 +01:00
Mike Pall
367ff0cdaa
Parse '\*' escape in strings (from Lua 5.2).
2010-11-22 22:22:12 +01:00
Mike Pall
b776bf91ff
Tighter check on table.sort function compliance (from Lua 5.2).
2010-11-19 18:44:59 +01:00
Mike Pall
52fd87bf34
Add support for "%g" character class in patterns (from Lua 5.2).
2010-11-19 18:37:10 +01:00
Mike Pall
7cc981c140
string.format("%q", str) is now fully reversible (from Lua 5.2).
2010-11-19 18:22:08 +01:00
Mike Pall
29b8959df1
Parse hexadecimal escapes in strings (from Lua 5.2).
2010-11-19 18:15:50 +01:00
Mike Pall
57cd5026eb
Disable Lua 5.2 features by default. See -DLUAJIT_ENABLE_LUA52COMPAT.
2010-11-19 17:00:11 +01:00
Mike Pall
ba602c9578
Add support for __pairs and __ipairs metamethods (from Lua 5.2).
2010-11-18 00:23:24 +01:00
Mike Pall
3754a8fe7a
Allow running C functions with coroutine.create(), too.
2010-11-17 20:07:55 +01:00
Mike Pall
751ff5b392
Add jit.os string.
2010-11-16 15:05:21 +01:00
Mike Pall
24baf77955
Cleanup architecture, ABI and OS definitions.
2010-11-16 15:03:40 +01:00
Mike Pall
1de05d1147
Avoid using negative hex numbers with DynASM.
2010-11-16 13:41:58 +01:00
Mike Pall
ad29c1f39f
Rename character type handling from lj_ctype* to lj_char*.
2010-11-09 12:09:54 +01:00
Mike Pall
fe21a42a92
Fix conflict between loop branch inversion and HREF+NE/EQ merging.
2010-11-05 23:12:43 +01:00
Mike Pall
188f0b04e1
Number parser shouldn't accept '0x' without hex digits.
2010-11-02 16:01:43 +01:00
Mike Pall
44372a4453
Fix parsing of hex floats.
2010-11-01 17:53:04 +01:00
Mike Pall
ab1b67f73a
Fix collectgarbage("count") result if more than 2GB is in use.
...
Thanks to Tony Finch.
2010-10-25 14:53:37 +02:00
Mike Pall
08b0ede194
Reduce 32GB RLIMIT_DATA on FreeBSD/x64 to allocate low-2GB memory.
...
Thanks to Tony Finch.
2010-10-23 16:31:27 +02:00
Mike Pall
02dc9d1082
Avoid compiler warning.
2010-10-23 15:28:28 +02:00
Mike Pall
65dec38e44
PPC: Preserve RD during array resizing in BC_TSETM.
2010-10-18 16:12:27 +02:00
Mike Pall
5391a5f5b1
Fix recording of y = select(n, ...) for non-int indexes.
2010-10-11 21:52:22 +02:00
Mike Pall
b3cf2c70f4
Decouple SLOAD type and optional conversion.
2010-10-11 21:13:37 +02:00
Mike Pall
cc62edebfd
x64: Fix type check for numbers in compiled code.
2010-10-11 19:24:12 +02:00
Mike Pall
5140b40b44
x64: Optimize internal/external tag conversion in lua_type().
2010-10-11 17:26:07 +02:00
Mike Pall
a3eeee5b3e
PPC: Update DynASM-generated file.
...
PPC/e500v2 interpreter port is now feature-complete.
2010-10-07 02:24:57 +02:00
Mike Pall
a7caa4894c
PPC: Use ZERO register instead of extra load immediate.
2010-10-07 02:21:54 +02:00
Mike Pall
9d201c972a
PPC: Add coroutine.resume/wrap_aux/yield() fast functions.
2010-10-07 02:16:44 +02:00
Mike Pall
9f14e03d6e
PPC: Add string.sub() fast function.
2010-10-06 16:18:24 +02:00
Mike Pall
b4f3d4525e
PPC: Add string.rep/reverse/lower/upper() fast functions.
2010-10-06 16:17:07 +02:00
Mike Pall
82b2f6156a
PPC: Add string.len/byte/char() fast functions.
2010-10-06 16:11:02 +02:00
Mike Pall
443d28bc9a
PPC: Fix math.deg/rad() fast functions.
2010-10-05 19:39:07 +02:00
Mike Pall
8f5efb2c43
PPC: Use own implementation for math.floor/ceil() fast functions.
2010-10-05 19:37:56 +02:00
Mike Pall
793fb4a9ad
PPC: Add math.ldexp/frexp/modf() fast functions.
2010-10-05 19:36:02 +02:00
Mike Pall
52b67fd3ea
PPC: Add math.abs/deg/rad/min/max() fast functions.
2010-10-05 19:35:04 +02:00
Mike Pall
3418512862
PPC: Remove pointless optimization in BC_UNM.
2010-10-05 19:27:33 +02:00
Mike Pall
14cd10e322
PPC: Add table.getn() fast function.
2010-10-05 01:47:39 +02:00
Mike Pall
2f5f6290e7
PPC: Add tonumber() and tostring() fast functions.
2010-10-05 01:46:23 +02:00
Mike Pall
08ac8b0c96
PPC: Add getmetatable(), setmetatable() and rawget() fast functions.
2010-10-05 01:41:51 +02:00
Mike Pall
8b096c5d08
PPC: Add assert() and type() fast functions.
2010-10-05 01:39:48 +02:00
Mike Pall
ddae887878
Update docs for PPC port. Clarify and extend install instructions.
2010-10-05 01:36:54 +02:00
Mike Pall
e396bef7d8
PPC: Add pcall() and xpcall() fast functions.
2010-10-01 23:47:29 +02:00
Mike Pall
05099f0764
PPC: Add ipairs() fast function and its iterator.
2010-10-01 23:45:56 +02:00
Mike Pall
61d498be87
PPC: Add next() and pairs() fast functions.
2010-10-01 23:43:39 +02:00
Mike Pall
dcf006bfa2
PPC: Add BC_ITERN and BC_ISNEXT.
2010-10-01 01:44:02 +02:00
Mike Pall
ac76493df1
Specialize bytecode for pairs()/next() iterator. Speedup: 3.5x.
...
Parser predict pairs/next and emits specialized bytecode.
Bytecode is descpecialized at runtime if the prediction was wrong.
Store slot index in hidden control var to avoid key lookups.
2010-09-30 21:55:32 +02:00
Mike Pall
fce05fd6e1
x64: Use 64 bit slot copies in the interpreter.
2010-09-30 17:47:32 +02:00
Mike Pall
c0a8f5fb32
PPC: Add dispatch to fast function fallback handlers.
2010-09-30 02:58:29 +02:00
Mike Pall
4afff973a4
PPC: Add bit.* fast functions.
2010-09-30 02:56:54 +02:00
Mike Pall
408cd055a4
PPC: Add basic infrastructure for fast functions.
2010-09-30 02:54:33 +02:00
Mike Pall
a47136031e
PPC: Add frame unwind info for assembler part.
...
Add define for target-specific exception handler return register.
2010-09-28 17:50:33 +02:00
Mike Pall
dc4fdecfb5
PPC: Don't use callee-save registers when folding '%' operator.
2010-09-28 14:59:33 +02:00
Mike Pall
a500752787
Fix checks for minimum required compiler versions.
2010-09-28 14:20:49 +02:00
Mike Pall
f635e3e5bb
PPC: Add dispatch target for call hook.
2010-09-23 02:42:29 +02:00
Mike Pall
493d0aa259
PPC: Add dispatch targets for instruction and return hooks.
2010-09-23 02:41:06 +02:00
Mike Pall
6aedfa7919
PPC: Add lj_vm_resume().
2010-09-23 02:35:51 +02:00
Mike Pall
5beedd6ef8
Workaround for missing fseeko/ftello prototypes on ancient glibc.
2010-09-23 01:30:53 +02:00
Mike Pall
d351c2ae36
x86/x64: Fix stack overflow handling for coroutine results.
2010-09-22 22:59:41 +02:00
Mike Pall
5baf0f9dc2
Fix stack growth for coroutine.wrap().
2010-09-22 21:16:16 +02:00
Mike Pall
d270e890f1
PPC: Reschedule continuation dispatch.
2010-09-21 21:43:29 +02:00
Mike Pall
aff6b3080f
Whitespace.
2010-09-21 21:41:49 +02:00
Mike Pall
201eec484c
PPC: Add fixed register for TOBIT bias.
2010-09-21 21:40:39 +02:00
Mike Pall
0c0047e50c
PPC: Add missing register setup after unwind to ff pcall.
2010-09-21 21:36:37 +02:00
Mike Pall
7336305e7c
PPC: Fix result copy for return to Lua.
2010-09-21 21:21:21 +02:00
Mike Pall
1c3b8c51c9
PPC: Fix constant folding of modulo operator.
2010-09-21 20:54:12 +02:00
Mike Pall
bc146ddbe7
Consistently round int args of string functions on x64.
2010-09-21 18:04:59 +02:00
Mike Pall
4cd2299acd
Improve AA for field accesses: disambiguate new allocations.
2010-09-21 15:21:26 +02:00
Mike Pall
3ae27ffebe
Drop redundant (UGE any +0).
2010-09-21 02:44:18 +02:00
Mike Pall
38628d93b8
Improve FOLD/CSE of field loads and array/hash refs across NEWREF.
2010-09-21 02:28:14 +02:00
Mike Pall
23b5c56d41
Improve alias analysis: disambiguate new allocations.
2010-09-21 01:31:04 +02:00
Mike Pall
52b922c1e9
Avoid fusing potentially negative indexes into AREF on x64.
2010-09-18 18:34:38 +02:00
Mike Pall
9203d278d0
PPC: Add metamethod handlers and continuations for comparisons.
2010-09-17 16:07:01 +02:00