Skip to content

Commit

Permalink
Squashed 'lib/luajit/' changes from 55c3b29..2f6b296
Browse files Browse the repository at this point in the history
2f6b296 Add proper DynASM dependency.
89982b7 FFI: Parse #line NN and #NN.
39eddd3 Always merge snapshots without instructions inbetween.
04d2806 Rollback due to HREFK + load fwd must restore guardemit state.
22e7b00 DynASM/x64: Fix for full VREG support.
52ebe02 x86: Disassemble AES instructions.
5ce6399 x86: Improve disassembly of AVX shift instructions.
cfae384 DynASM/x86: Add AVX AES instructions.
f61148c ARM: Add external frame unwinding.
a687a60 DynASM/x64: Add full VREG support.
20f4141 FFI: Properly unsink non-standard cdata allocations.
0345f36 MIPS soft-float, part 2: Add soft-float FFI support.
3f5c724 MIPS soft-float, part 1: Add soft-float support to interpreter.
126e55d Merge branch 'master' into v2.1
3d4c9f9 FFI: Fix SPLIT pass for CONV i64.u64.
3a0b2a9 x64/LJ_GC64: Fix stack growth in vararg function setup.
4f87367 Document minimum compiler requirements for 2.1 branch.
0aa337a Merge branch 'master' into v2.1
367cba2 DynASM/x86: Add rdpmc instruction.
7991a66 Extend Valgrind suppressions for non-inlined C code.
0029110 Update changelog.
42b9c98 iOS/ARM64: Add build instructions.
3ad7734 Merge branch 'master' into v2.1
1393b2f Update build instructions.
f416cf6 OSX: Switch to Clang as the default compiler.
ffb124e Merge branch 'master' into v2.1
3639ff4 iOS: Disable os.execute() when building for iOS >= 8.0.
6a54411 x86/x64: Disassemble AVX/AVX2 instructions.
4c08158 Whitespace.
d62dc01 DynASM: Bump version to 1.4.
8a13c9c DynASM/x86: Add AVX and AVX2 opcodes.
7e22082 DynASM/x86: Add AES-NI opcodes.
e54ca42 Merge branch 'master' into v2.1
7579b16 DynASM/x86: Restrict shld/shrd to operands with same width.
9dc785e DynASM/x86: Fix some SSE instruction templates.
efaf24f Fix pairs() recording.
b20642c Merge branch 'master' into v2.1
e5f4cb1 FFI: Fix ipairs() recording.
776c693 Merge branch 'master' into v2.1
4808e62 Drop marks from replayed instructions when sinking.
22a9ed8 Merge branch 'master' into v2.1
2e85af8 Flush symbol tables in jit.dump on trace flush.
86c21bd Add collectgarbage("isrunning").
0b09c97 Merge branch 'master' into v2.1
ef087aa Fix unsinking check.
52ea1a3 FFI: Add ssize_t declaration.
49427df Merge branch 'master' into v2.1
076d625 Fix Cygwin support. Note: this is not a supported target.

git-subtree-dir: lib/luajit
git-subtree-split: 2f6b296
  • Loading branch information
eugeneia committed Jan 20, 2016
1 parent 532f9f4 commit 003dfd1
Show file tree
Hide file tree
Showing 42 changed files with 2,130 additions and 550 deletions.
2 changes: 2 additions & 0 deletions doc/changes.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ <h2 id="LuaJIT-2.1.0-beta1">LuaJIT 2.1.0-beta1 &mdash; 2015-08-25</h2>
<li>x64: Add separate port of the interpreter to <tt>LJ_GC64</tt> mode.</li>
<li>x86/x64: Drop internal x87 math functions. Use libm functions.</li>
<li>x86: Remove x87 support from interpreter. SSE2 is mandatory now.</li>
<li>x86/x64: Add support for AES-NI, AVX and AVX2 to DynASM.</li>
<li>PPC/e500: Drop support for this architecture.</li>
</ul></li>
<li>FFI library:
Expand All @@ -123,6 +124,7 @@ <h2 id="LuaJIT-2.1.0-beta1">LuaJIT 2.1.0-beta1 &mdash; 2015-08-25</h2>
<li>FFI: Compile lightuserdata to <tt>void *</tt> conversion.</li>
<li>FFI: Compile <tt>ffi.gc(cdata, nil)</tt>, too.</li>
<li>FFI: Add <tt>ffi.typeinfo()</tt>.</li>
<li>FFI: Add <tt>ssize_t</tt> declaration.</li>
</ul></li>
</ul>
</div>
Expand Down
2 changes: 2 additions & 0 deletions doc/ext_ffi_semantics.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ <h2 id="clang">C Language Support</h2>
<tt>uint16_t</tt>, <tt>uint32_t</tt>, <tt>uint64_t</tt>,
<tt>intptr_t</tt>, <tt>uintptr_t</tt>.</li>

<li>From <tt>&lt;unistd.h&gt;</tt> (POSIX): <tt>ssize_t</tt>.</li>

</ul>
<p>
You're encouraged to use these types in preference to
Expand Down
36 changes: 20 additions & 16 deletions doc/install.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,30 +114,30 @@ <h1>Installation</h1>
</tr>
<tr class="odd separate">
<td class="compatcpu">x86 (32 bit)</td>
<td class="compatos">GCC 4.x<br>GCC 3.4</td>
<td class="compatos">GCC 4.x<br>GCC 3.4</td>
<td class="compatos">GCC 4.x<br>GCC 3.4</td>
<td class="compatos">GCC 4.2+</td>
<td class="compatos">GCC 4.2+</td>
<td class="compatos">XCode 5.0+<br>Clang</td>
<td class="compatos">MSVC, MSVC/EE<br>WinSDK<br>MinGW, Cygwin</td>
</tr>
<tr class="even">
<td class="compatcpu">x64 (64 bit)</td>
<td class="compatos">GCC 4.x</td>
<td class="compatos">GCC 4.2+</td>
<td class="compatos">ORBIS (<a href="#ps4">PS4</a>)</td>
<td class="compatos">GCC 4.x</td>
<td class="compatos">XCode 5.0+<br>Clang</td>
<td class="compatos">MSVC + SDK v7.0<br>WinSDK v7.0<br>Durango (<a href="#xboxone">Xbox One</a>)</td>
</tr>
<tr class="odd">
<td class="compatcpu"><a href="#cross2">ARMv5+<br>ARM9E+</a></td>
<td class="compatos">GCC 4.2+</td>
<td class="compatos">GCC 4.2+<br>PSP2 (<a href="#psvita">PS VITA</a>)</td>
<td class="compatos">GCC 4.2+</td>
<td class="compatos">XCode 5.0+<br>Clang</td>
<td class="compatos compatno">&nbsp;</td>
</tr>
<tr class="even">
<td class="compatcpu"><a href="#cross2">ARM64</a></td>
<td class="compatos">GCC 4.8+</td>
<td class="compatos compatno">&nbsp;</td>
<td class="compatos">Clang 3.5+</td>
<td class="compatos">XCode 6.0+<br>Clang 3.5+</td>
<td class="compatos compatno">&nbsp;</td>
</tr>
<tr class="odd">
Expand Down Expand Up @@ -442,8 +442,7 @@ <h2 id="cross">Cross-compiling LuaJIT</h2>
make HOST_CC="gcc -m32" CROSS=$NDKP TARGET_FLAGS="$NDKF"
</pre>
<p>
You can cross-compile for <b id="ios">iOS 3.0+</b> (iPhone/iPad) using the <a href="http://developer.apple.com/devcenter/ios/index.action"><span class="ext">&raquo;</span>&nbsp;iOS SDK</a>.
The environment variables need to match the iOS SDK version:
You can cross-compile for <b id="ios">iOS 3.0+</b> (iPhone/iPad) using the <a href="http://developer.apple.com/devcenter/ios/index.action"><span class="ext">&raquo;</span>&nbsp;iOS SDK</a>:
</p>
<p style="font-size: 8pt;">
Note: <b>the JIT compiler is disabled for iOS</b>, because regular iOS Apps
Expand All @@ -453,13 +452,18 @@ <h2 id="cross">Cross-compiling LuaJIT</h2>
Or use Android. :-p
</p>
<pre class="code">
IXCODE=`xcode-select -print-path`
ISDK=$IXCODE/Platforms/iPhoneOS.platform/Developer
ISDKVER=iPhoneOS6.0.sdk
ISDKP=$ISDK/usr/bin/
ISDKF="-arch armv7 -isysroot $ISDK/SDKs/$ISDKVER"
make HOST_CC="gcc -m32 -arch i386" CROSS=$ISDKP TARGET_FLAGS="$ISDKF" \
TARGET_SYS=iOS
# iOS/ARM (32 bit)
ISDKP=$(xcrun --sdk iphoneos --show-sdk-path)
ICC=$(xcrun --sdk iphoneos --find clang)
ISDKF="-arch armv7 -isysroot $ISDKP"
make HOST_CC="clang -m32 -arch i386" CROSS="$(dirname $ICC)/" \
TARGET_FLAGS="$ISDKF" TARGET_SYS=iOS

# iOS/ARM64
ISDKP=$(xcrun --sdk iphoneos --show-sdk-path)
ICC=$(xcrun --sdk iphoneos --find clang)
ISDKF="-arch arm64 -isysroot $ISDKP"
make CROSS="$(dirname $ICC)/" TARGET_FLAGS="$ISDKF" TARGET_SYS=iOS
</pre>

<h3 id="consoles">Cross-compiling for consoles</h3>
Expand Down
6 changes: 3 additions & 3 deletions dynasm/dasm_arm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
local _info = {
arch = "arm",
description = "DynASM ARM module",
version = "1.3.0",
vernum = 10300,
release = "2011-05-05",
version = "1.4.0",
vernum = 10400,
release = "2015-10-18",
author = "Mike Pall",
license = "MIT",
}
Expand Down
6 changes: 3 additions & 3 deletions dynasm/dasm_arm64.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
local _info = {
arch = "arm",
description = "DynASM ARM64 module",
version = "1.3.0",
vernum = 10300,
release = "2014-12-03",
version = "1.4.0",
vernum = 10400,
release = "2015-10-18",
author = "Mike Pall",
license = "MIT",
}
Expand Down
6 changes: 3 additions & 3 deletions dynasm/dasm_mips.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
local _info = {
arch = "mips",
description = "DynASM MIPS module",
version = "1.3.0",
vernum = 10300,
release = "2012-01-23",
version = "1.4.0",
vernum = 10400,
release = "2015-10-18",
author = "Mike Pall",
license = "MIT",
}
Expand Down
6 changes: 3 additions & 3 deletions dynasm/dasm_ppc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
local _info = {
arch = "ppc",
description = "DynASM PPC module",
version = "1.3.0",
vernum = 10300,
release = "2015-01-14",
version = "1.4.0",
vernum = 10400,
release = "2015-10-18",
author = "Mike Pall",
license = "MIT",
}
Expand Down
4 changes: 2 additions & 2 deletions dynasm/dasm_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include <stddef.h>
#include <stdarg.h>

#define DASM_IDENT "DynASM 1.3.0"
#define DASM_VERSION 10300 /* 1.3.0 */
#define DASM_IDENT "DynASM 1.4.0"
#define DASM_VERSION 10400 /* 1.4.0 */

#ifndef Dst_DECL
#define Dst_DECL dasm_State **Dst
Expand Down
39 changes: 33 additions & 6 deletions dynasm/dasm_x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void dasm_put(Dst_DECL, int start, ...)
dasm_State *D = Dst_REF;
dasm_ActList p = D->actionlist + start;
dasm_Section *sec = D->section;
int pos = sec->pos, ofs = sec->ofs, mrm = 4;
int pos = sec->pos, ofs = sec->ofs, mrm = -1;
int *b;

if (pos >= sec->epos) {
Expand All @@ -193,7 +193,7 @@ void dasm_put(Dst_DECL, int start, ...)
b[pos++] = n;
switch (action) {
case DASM_DISP:
if (n == 0) { if ((mrm&7) == 4) mrm = p[-2]; if ((mrm&7) != 5) break; }
if (n == 0) { if (mrm < 0) mrm = p[-2]; if ((mrm&7) != 5) break; }
case DASM_IMM_DB: if (((n+128)&-256) == 0) goto ob;
case DASM_REL_A: /* Assumes ptrdiff_t is int. !x64 */
case DASM_IMM_D: ofs += 4; break;
Expand All @@ -203,10 +203,17 @@ void dasm_put(Dst_DECL, int start, ...)
case DASM_IMM_W: CK((n&-65536) == 0, RANGE_I); ofs += 2; break;
case DASM_SPACE: p++; ofs += n; break;
case DASM_SETLABEL: b[pos-2] = -0x40000000; break; /* Neg. label ofs. */
case DASM_VREG: CK((n&-8) == 0 && (n != 4 || (*p&1) == 0), RANGE_VREG);
if (*p++ == 1 && *p == DASM_DISP) mrm = n; continue;
case DASM_VREG: CK((n&-16) == 0 && (n != 4 || (*p>>5) != 2), RANGE_VREG);
if (*p < 0x40 && p[1] == DASM_DISP) mrm = n;
if (*p < 0x20 && (n&7) == 4) ofs++;
switch ((*p++ >> 3) & 3) {
case 3: n |= b[pos-3];
case 2: n |= b[pos-2];
case 1: if (n <= 7) { b[pos-1] |= 0x10; ofs--; }
}
continue;
}
mrm = 4;
mrm = -1;
} else {
int *pl, n;
switch (action) {
Expand Down Expand Up @@ -391,7 +398,27 @@ int dasm_encode(Dst_DECL, void *buffer)
case DASM_IMM_D: wd: dasmd(n); break;
case DASM_IMM_WB: if (((n+128)&-256) == 0) goto db; else mark = NULL;
case DASM_IMM_W: dasmw(n); break;
case DASM_VREG: { int t = *p++; if (t >= 2) n<<=3; cp[-1] |= n; break; }
case DASM_VREG: {
int t = *p++;
unsigned char *ex = cp - (t&7);
if ((n & 8) && t < 0xa0) {
if (*ex & 0x80) ex[1] ^= 0x20 << (t>>6); else *ex ^= 1 << (t>>6);
n &= 7;
} else if (n & 0x10) {
if (*ex & 0x80) {
*ex = 0xc5; ex[1] = (ex[1] & 0x80) | ex[2]; ex += 2;
}
while (++ex < cp) ex[-1] = *ex;
if (mark) mark--;
cp--;
n &= 7;
}
if (t >= 0xc0) n <<= 4;
else if (t >= 0x40) n <<= 3;
else if (n == 4 && t < 0x20) { cp[-1] ^= n; *cp++ = 0x20; }
cp[-1] ^= n;
break;
}
case DASM_REL_LG: p++; if (n >= 0) goto rel_pc;
b++; n = (int)(ptrdiff_t)D->globals[-n];
case DASM_REL_A: rel_a: n -= (int)(ptrdiff_t)(cp+4); goto wd; /* !x64 */
Expand Down
Loading

0 comments on commit 003dfd1

Please sign in to comment.