Mike Pall
a98e6a70c1
Abstract out some common buffer operations.
2013-04-26 19:20:21 +02:00
Mike Pall
47fa9a8d8f
Change semantics of buffer ops to simplify CSE and DCE.
2013-04-26 13:47:41 +02:00
Mike Pall
5fd659f859
Fix MSVC build.
2013-04-26 10:38:24 +02:00
Mike Pall
bdaf14b2c1
Merge branch 'master' into v2.1
2013-04-26 00:59:35 +02:00
Mike Pall
895a8bc91f
Tighten requirements for non-default optimization flags.
...
FOLD is required for FWD/DSE optimizations.
2013-04-26 00:54:53 +02:00
Mike Pall
b6adfff8f4
Compile string.reverse(), string.lower(), string.upper().
2013-04-26 00:32:08 +02:00
Mike Pall
eeb204cd87
Fix FOLD rules for appending to string buffers.
2013-04-26 00:26:44 +02:00
Mike Pall
39e53e8c4c
Compile string.char().
2013-04-23 12:40:07 +02:00
Mike Pall
255326afb6
Use explicit conversion type for IR_TOSTR. Add char conversion.
2013-04-23 02:20:03 +02:00
Mike Pall
2cdf90f068
Always emit TOSTR for non-string CAT operands. Fuse in backend.
2013-04-23 00:10:01 +02:00
Mike Pall
1ae3e5204b
Fix PHI barrier in BUFPUT FOLD rule.
2013-04-22 22:37:22 +02:00
Mike Pall
5f1781a127
Compile string concatenations (BC_CAT).
2013-04-21 01:01:33 +02:00
Mike Pall
a98aede377
FFI: Add 64 bit bitwise operations.
2013-03-14 06:03:18 +01:00
Mike Pall
b359ce804b
Remove obsolete non-truncating number to integer conversions.
2013-02-23 01:19:00 +01:00
Mike Pall
4a44c4ff69
Bump copyright date to 2013.
2013-02-11 12:54:48 +01:00
Mike Pall
1651684417
Add missing FOLD rules for U32 conversions.
2013-01-21 16:49:03 +01:00
Mike Pall
fd292c9f26
Fix assertion.
2012-10-11 21:40:46 +02:00
Mike Pall
5ebe4990ba
Add LJ_TARGET_UNALIGNED.
2012-10-09 21:42:42 +02:00
Mike Pall
0452e97ba0
Add FOLD rules for CONV.int.i8/u8/i16/u16 of KINT.
2012-10-09 21:36:56 +02:00
Mike Pall
e013206dd8
FFI: ctypeid of ctype object is immutable.
2012-09-27 14:48:13 +02:00
Mike Pall
4c882fe714
Replace strtod() with builtin string to number conversion.
2012-08-25 23:02:29 +02:00
Mike Pall
f2479a9654
Minor fixes to FOLD rules.
2012-08-20 18:45:50 +02:00
Mike Pall
0dd175d9e7
Fix last commit.
2012-08-15 21:08:00 +02:00
Mike Pall
ff0a1f3f4e
FOLD x / 2^k ==> x * 2^-k.
2012-08-15 16:17:34 +02:00
Mike Pall
e8af6e9da4
Don't treat all constified cdata content as constant.
2012-07-24 14:56:29 +02:00
Mike Pall
4d9c29a78c
FFI: Box all accessed or returned enums.
2012-07-17 22:22:07 +02:00
Mike Pall
2139c6791f
Fix FOLD rule (i-j)-i => 0-j.
...
Thanks to Thomas Schilling.
2012-07-17 21:47:45 +02:00
Mike Pall
c172e7aa30
Workaround for MSVC conversion bug (double -> uint32_t -> int32_t).
2012-07-17 21:45:49 +02:00
Mike Pall
17d3fc47f3
Avoid pesky compiler warnings about C++ keywords (eh?).
2012-07-03 13:19:32 +02:00
Mike Pall
a9bf455b96
Add HREFK forwarding. Eliminate HREFK guard for TDUP refs.
2012-06-28 15:10:52 +02:00
Mike Pall
5032e6d87f
FFI: Use CNEWI/FLOAD to box/access ffi.new("int", x) (for varargs).
2012-06-04 15:39:16 +02:00
Mike Pall
10ef109eef
Bump copyright date to 2012.
2012-01-23 22:42:42 +01:00
Mike Pall
455917fa0a
Add more FOLD rules for shift + BAND simplifications.
2011-10-25 21:16:27 +02:00
Mike Pall
aa502203a6
Add missing FOLD rule for CONV.u64.int + sign-extension.
2011-10-22 02:03:07 +02:00
Mike Pall
a39aac0445
Fix FOLD rule for CONV.flt.num(CONV.num.flt(x)) => x.
2011-10-19 01:52:50 +02:00
Mike Pall
270de2d6cc
Add missing FOLD rule for integer NEG of constants.
2011-10-17 17:21:09 +02:00
Mike Pall
f34ac81e3a
Remove unneeded PHI barrier for reassociation of duplicate ops.
2011-10-10 20:35:42 +02:00
Mike Pall
8c5935000d
Add narrowing of modulo operator.
2011-06-03 18:48:02 +02:00
Mike Pall
fff2fb31f9
ARM: Don't generate unaligned XLOADs.
2011-06-02 01:46:23 +02:00
Mike Pall
7683f39786
ARM: Fix math.ldexp() recording and folding.
2011-05-27 02:03:02 +02:00
Mike Pall
185554b682
ARM: Unify rotates to simplify assembler backend.
2011-05-23 20:20:34 +02:00
Mike Pall
28e87d33e9
Use common helper functions for unaligned loads.
2011-05-09 18:09:29 +02:00
Mike Pall
89022b4c3e
Use lj_vm_tobit() on targets without FPU.
2011-04-10 16:58:22 +02:00
Mike Pall
3acd4892e9
Add FOLD rule for FLOAT->NUM->FLOAT conversions.
2011-04-05 16:31:48 +02:00
Mike Pall
dcbae09b1d
DUALNUM: Narrow unary minus.
2011-03-15 18:14:18 +01:00
Mike Pall
7fb1075903
DUALNUM: Add integer variant of MIN/MAX.
2011-03-11 23:28:46 +01:00
Mike Pall
889368e921
Get rid of the remaining silly cast macros from Lua.
2011-03-10 02:13:43 +01:00
Mike Pall
bfce3c1127
DUALNUM: Handle integer type in JIT compiler.
2011-03-10 01:57:24 +01:00
Mike Pall
3f26e3a89d
FFI: Fix and optimize recording of cdata[cdata].
2011-03-10 01:41:58 +01:00
Mike Pall
54978e481b
DUALNUM: Make overflow guards weak. Add IR_USE and IR_MULOV.
2011-03-07 20:21:38 +01:00
Mike Pall
e1aa8d0d97
FFI: Fix compiled ffi.string() semantics.
2011-02-28 19:47:51 +01:00
Mike Pall
97d0874ff5
Add IR_XBAR, a barrier against XLOAD/XSTORE optimizations.
2011-02-07 21:59:25 +01:00
Mike Pall
4c74f70464
Strength-reduce 32 to 64 bit widening for XLOAD U8/U16 inputs.
2011-02-06 00:45:39 +01:00
Mike Pall
26fadcd25b
FFI: Record simple C function calls.
...
Only handles cdecl and fixarg C functions.
Doesn't handle pass-by-value aggregates.
Doesn't handle 64 bit args/returns on 32 bit CPUs.
2011-02-05 21:50:15 +01:00
Mike Pall
14f5103764
FFI: Record C library namespace lookups.
2011-02-05 14:16:16 +01:00
Mike Pall
1abf5d4d26
FFI: Disable MUL => BSHL FOLD rule on 32 bit.
2011-02-03 20:10:13 +01:00
Mike Pall
df65b8b419
FFI: Rename IR_CNEWP to IR_CNEWI and use it to box 64 bit integers.
...
Generates smaller IR and DCE eliminates many intermediate boxes.
Needs allocation sinking to eliminate the boxes kept alive by PHIs.
2011-02-03 04:22:27 +01:00
Mike Pall
1027018b21
Rename IR_POWI to IR_POW.
2011-02-02 21:33:11 +01:00
Mike Pall
433fd18f6d
FFI: Add basic FOLD rules for 64 bit integer DIV, MOD and POWI.
2011-02-02 21:25:43 +01:00
Mike Pall
b613216efc
Add SPLIT pass to split 64 bit IR instructions for 32 bit CPUs.
...
Add generic HIOP instruction for extra backend functionality.
Add support for HIOP to x86 backend.
Use POWI for 64 bit integer x^k, too.
POWI is lowered to a call by SPLIT or the x64 backend.
2011-02-02 02:29:37 +01:00
Mike Pall
6fee0002b9
Fix 64 bit case of (SUB x x) and (BXOR x x) FOLD rules.
2011-01-28 02:17:35 +01:00
Mike Pall
925050fe3f
Differentiate between IR_KPTR and IR_KKPTR.
...
IR_KPTR holds a const pointer to possibly non-const content.
IR_KKPTR holds a const pointer to definitely const content.
Note that only content known by the VM to be const qualifies.
Content tagged as const by users (e.g. const char *) doesn't.
2011-01-19 00:40:03 +01:00
Mike Pall
59643c86fb
Add FOLD rule for CONV.num.u32 KINT.
2011-01-13 17:18:08 +01:00
Mike Pall
06f99fc3df
Bump copyright date to 2011.
2011-01-09 17:12:53 +01:00
Mike Pall
b2c74c52cc
FFI: Add support for cdata constants to IR.
2011-01-02 22:21:10 +01:00
Mike Pall
783dbd335f
Refactoring of conversion ops, part 5: drop TOINT/TOI64/TONUM.
2010-12-31 04:09:32 +01:00
Mike Pall
1716540c55
Refactoring of conversion ops, part 4: use CONV instead of TOINT/TONUM.
...
Also narrow CONV.int.num and CONV.i64.num.
2010-12-31 03:56:30 +01:00
Mike Pall
1f26961092
Refactoring of conversion ops, part 3: add FOLD rules for IR_CONV.
2010-12-31 03:47:30 +01:00
Mike Pall
65b194a2f8
Copy destination type for CONV from ir->t to op2, too.
2010-12-31 01:00:54 +01:00
Mike Pall
2ca2de7f0e
Refactoring of conversion ops, part 1: add IR_CONV.
2010-12-30 00:35:32 +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
74317fa0ef
Add alias analysis for XLOAD/XSTORE. Add DSE for XSTORE.
2010-12-12 22:32:52 +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
5f7e9173db
Regroup FOLD rules for constant folding.
2010-12-11 20:08:07 +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
1d86090926
Strength-reduce 32 to 64 bit widening using scalar evolution analysis.
2010-12-09 16:12:59 +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
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
86fd2289f0
Add support for integer IR_MUL.
2010-12-06 12:54:00 +01:00
Mike Pall
a850b27da9
Avoid compiler warnings.
2010-12-06 03:07:10 +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
6a7605ec85
Rename IRT_PTR to IRT_P32.
2010-12-05 18:59:34 +01: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
8dc76ee327
Add IR_VLOAD for vararg loads.
...
Also fixes the broken AA improvement in the last commit.
2010-09-14 19:58:27 +02:00
Mike Pall
847b9cf253
Record vararg expressions with varargs defined off-trace.
...
Add SLOAD variant to access the frame type/size.
2010-09-13 01:17:38 +02:00
Mike Pall
844e40d700
PPC: Clean up masked shift/rotate target settings.
2010-08-29 12:52:20 +02:00
Mike Pall
ab45481199
No longer let the GC replace dead keys with the LJ_TDEADKEY tag.
...
Important: this changes the semantics of the write barrier!
Carefully read the big comment block in lj_obj.h
This helps HREFK key slot specialization and allows safely hoisting
HREF/HREFK across GC steps, too (fix for a barely reproducible bug).
Dead keys are only removed during a table resize (as before).
2010-04-21 01:45:58 +02:00
Mike Pall
1d1d9221f3
Fold HREF of TNEW/TDUP to niltv. Fold HLOAD of niltv to nil.
2010-03-28 06:53:41 +02:00
Mike Pall
c4727220e8
Add array bounds check elimination (-Oabc, on by default).
2010-03-15 17:02:53 +01:00
Mike Pall
a25a717089
Fix folding of (comparison x x).
2010-03-14 17:10:47 +01:00
Mike Pall
370c868c31
RETF modifies BASE. Treat it like a store or it gets CSEd.
2010-02-04 21:36:32 +01:00
Mike Pall
99d153bef9
Improve alias analysis of upvalues using a disambiguation hash value.
...
All upvalue objects hold a disambiguation hash value now.
It's built from the parent prototype and the slot number.
Different hash values imply the upvalues cannot alias.
Same hash values don't imply anything (collision or different closures).
Upvalue disambiguation makes use of a reduced hash due to IR contraints.
2010-01-09 23:59:43 +01:00
Mike Pall
4d9be5b8f8
Bump all copyright dates to 2010.
2010-01-09 14:28:11 +01:00
Mike Pall
3f1f9e11f4
Fast forward to sync public repo.
...
Compile math.sinh(), math.cosh(), math.tanh() and math.random().
Compile various io.*() functions.
Drive the GC forward on string allocations in the parser.
Improve KNUM fuse vs. load heuristics.
Add abstract C call handling to IR.
2009-12-08 20:35:29 +01:00