diff options
| author | Mike Pall <mike> | 2010-10-05 01:36:54 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2010-10-05 01:36:54 +0200 |
| commit | ddae8878786a310f2e6cbe2a1d602a17ea28bb11 (patch) | |
| tree | 3ffe5c7790acbacdcdae748984960418b358fcc1 /doc | |
| parent | e396bef7d8a346c6ea54191d658209ee90047276 (diff) | |
| download | luajit-ddae8878786a310f2e6cbe2a1d602a17ea28bb11.tar.gz luajit-ddae8878786a310f2e6cbe2a1d602a17ea28bb11.tar.bz2 luajit-ddae8878786a310f2e6cbe2a1d602a17ea28bb11.zip | |
Update docs for PPC port. Clarify and extend install instructions.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/faq.html | 6 | ||||
| -rw-r--r-- | doc/install.html | 155 | ||||
| -rw-r--r-- | doc/luajit.html | 15 | ||||
| -rw-r--r-- | doc/running.html | 2 | ||||
| -rw-r--r-- | doc/status.html | 64 |
5 files changed, 177 insertions, 65 deletions
diff --git a/doc/faq.html b/doc/faq.html index 90f37cef..9404f788 100644 --- a/doc/faq.html +++ b/doc/faq.html | |||
| @@ -126,7 +126,7 @@ running inside a C function under the Lua interpreter.</dd> | |||
| 126 | <dt>Q: Why doesn't my favorite power-patch for Lua apply against LuaJIT?</dt> | 126 | <dt>Q: Why doesn't my favorite power-patch for Lua apply against LuaJIT?</dt> |
| 127 | <dd>Because it's a completely redesigned VM and has very little code | 127 | <dd>Because it's a completely redesigned VM and has very little code |
| 128 | in common with Lua anymore. Also, if the patch introduces changes to | 128 | in common with Lua anymore. Also, if the patch introduces changes to |
| 129 | the Lua semantics, this would need to be reflected everywhere in the | 129 | the Lua semantics, these would need to be reflected everywhere in the |
| 130 | VM, from the interpreter up to all stages of the compiler.<br> Please | 130 | VM, from the interpreter up to all stages of the compiler.<br> Please |
| 131 | use only standard Lua language constructs. For many common needs you | 131 | use only standard Lua language constructs. For many common needs you |
| 132 | can use source transformations or use wrapper or proxy functions. | 132 | can use source transformations or use wrapper or proxy functions. |
| @@ -139,8 +139,8 @@ The compiler will happily optimize away such indirections.</dd> | |||
| 139 | machine code. This means the code generator must be ported to each | 139 | machine code. This means the code generator must be ported to each |
| 140 | architecture. And the fast interpreter is written in assembler and | 140 | architecture. And the fast interpreter is written in assembler and |
| 141 | must be ported, too. This is quite an undertaking.<br> Currently only | 141 | must be ported, too. This is quite an undertaking.<br> Currently only |
| 142 | x86 and x64 CPUs are supported. Other architectures will follow based | 142 | x86, x64 and PPC/e500v2 CPUs are supported. Other architectures will follow |
| 143 | on sufficient user demand and/or sponsoring.</dd> | 143 | based on sufficient user demand and/or sponsoring.</dd> |
| 144 | </dl> | 144 | </dl> |
| 145 | 145 | ||
| 146 | <dl> | 146 | <dl> |
diff --git a/doc/install.html b/doc/install.html index 45925e7a..b0c806db 100644 --- a/doc/install.html +++ b/doc/install.html | |||
| @@ -11,16 +11,20 @@ | |||
| 11 | <style type="text/css"> | 11 | <style type="text/css"> |
| 12 | table.compat { | 12 | table.compat { |
| 13 | line-height: 1.2; | 13 | line-height: 1.2; |
| 14 | width: 40em; | 14 | width: 47em; |
| 15 | } | 15 | } |
| 16 | tr.compathead td { | 16 | tr.compathead td { |
| 17 | font-weight: bold; | 17 | font-weight: bold; |
| 18 | } | 18 | } |
| 19 | td { | ||
| 20 | border-left: 1px solid #bfcfff; | ||
| 21 | border-right: 1px solid #bfcfff; | ||
| 22 | } | ||
| 19 | td.compatos { | 23 | td.compatos { |
| 20 | width: 40%; | 24 | width: 25%; |
| 21 | } | 25 | } |
| 22 | td.compatcc { | 26 | td.compatcc { |
| 23 | width: 30%; | 27 | width: 25%; |
| 24 | vertical-align: top; | 28 | vertical-align: top; |
| 25 | } | 29 | } |
| 26 | </style> | 30 | </style> |
| @@ -68,35 +72,40 @@ For the impatient (on POSIX systems): | |||
| 68 | make && sudo make install | 72 | make && sudo make install |
| 69 | </pre> | 73 | </pre> |
| 70 | <p> | 74 | <p> |
| 71 | LuaJIT currently builds out-of-the box on most x86 or x64 systems. | 75 | LuaJIT currently builds out-of-the box on most systems. |
| 72 | Here's the compatibility matrix for the supported combinations of | 76 | Here's the compatibility matrix for the supported combinations of |
| 73 | operating system, CPU and compilers: | 77 | operating system, CPU and compilers: |
| 74 | </p> | 78 | </p> |
| 75 | <table class="compat"> | 79 | <table class="compat"> |
| 76 | <tr class="compathead"> | 80 | <tr class="compathead"> |
| 77 | <td class="compatos">Operating system</td> | 81 | <td class="compatos">OS / CPU</td> |
| 78 | <td class="compatcc">x86 (32 bit)</td> | 82 | <td class="compatcc">x86 (32 bit)</td> |
| 79 | <td class="compatcc">x64 (64 bit)</td> | 83 | <td class="compatcc">x64 (64 bit)</td> |
| 84 | <td class="compatcc">PPC/e500v2</td> | ||
| 80 | </tr> | 85 | </tr> |
| 81 | <tr class="odd separate"> | 86 | <tr class="odd separate"> |
| 82 | <td class="compatos">Linux</td> | 87 | <td class="compatos"><a href="#posix">Linux</a></td> |
| 83 | <td class="compatcc">GCC 4.x<br>GCC 3.4</td> | 88 | <td class="compatcc">GCC 4.x<br>GCC 3.4</td> |
| 84 | <td class="compatcc">GCC 4.x</td> | 89 | <td class="compatcc">GCC 4.x</td> |
| 90 | <td class="compatcc">GCC 4.3+</td> | ||
| 85 | </tr> | 91 | </tr> |
| 86 | <tr class="even"> | 92 | <tr class="even"> |
| 87 | <td class="compatos">Windows 98/XP/Vista/7</td> | 93 | <td class="compatos"><a href="#windows">Windows<br>98/XP/Vista/7</a></td> |
| 88 | <td class="compatcc">MSVC (EE)<br>Windows SDK<br>MinGW (GCC)<br>Cygwin (GCC)</td> | 94 | <td class="compatcc">MSVC (EE)<br>Windows SDK<br>MinGW (GCC)<br>Cygwin (GCC)</td> |
| 89 | <td class="compatcc">MSVC + SDK v7.0<br>Windows SDK v7.0</td> | 95 | <td class="compatcc">MSVC + SDK v7.0<br>Windows SDK v7.0</td> |
| 96 | <td class="compatcc"> </td> | ||
| 90 | </tr> | 97 | </tr> |
| 91 | <tr class="odd"> | 98 | <tr class="odd"> |
| 92 | <td class="compatos">OSX 10.3-10.6</td> | 99 | <td class="compatos"><a href="#posix">OSX 10.3-10.6</a></td> |
| 93 | <td class="compatcc">GCC 4.x<br>GCC 3.4</td> | 100 | <td class="compatcc">GCC 4.x<br>GCC 3.4</td> |
| 94 | <td class="compatcc">GCC 4.x</td> | 101 | <td class="compatcc">GCC 4.x</td> |
| 102 | <td class="compatcc"> </td> | ||
| 95 | </tr> | 103 | </tr> |
| 96 | <tr class="even"> | 104 | <tr class="even"> |
| 97 | <td class="compatos">*BSD, other</td> | 105 | <td class="compatos"><a href="#posix">*BSD, other</a></td> |
| 98 | <td class="compatcc">GCC 4.x<br>GCC 3.4</td> | 106 | <td class="compatcc">GCC 4.x<br>GCC 3.4</td> |
| 99 | <td class="compatcc">(not supported)</td> | 107 | <td class="compatcc">(not supported)</td> |
| 108 | <td class="compatcc"> </td> | ||
| 100 | </tr> | 109 | </tr> |
| 101 | </table> | 110 | </table> |
| 102 | 111 | ||
| @@ -147,10 +156,12 @@ which is probably the default on your system, anyway. Simply run: | |||
| 147 | make | 156 | make |
| 148 | </pre> | 157 | </pre> |
| 149 | <p> | 158 | <p> |
| 150 | This always builds a native x86 or x64 binary, depending on your OS. | 159 | This always builds a native x86, x64 or PPC binary, depending on the host OS |
| 160 | you're running this command on. Check the section on | ||
| 161 | <a href="#cross">cross-compilation</a> for more options. | ||
| 151 | </p> | 162 | </p> |
| 152 | <p> | 163 | <p> |
| 153 | By default modules are only searched under the prefix <tt>/usr/local</tt>. | 164 | By default, modules are only searched under the prefix <tt>/usr/local</tt>. |
| 154 | You can add an extra prefix to the search paths by appending the | 165 | You can add an extra prefix to the search paths by appending the |
| 155 | <tt>PREFIX</tt> option, e.g.: | 166 | <tt>PREFIX</tt> option, e.g.: |
| 156 | </p> | 167 | </p> |
| @@ -283,7 +294,7 @@ directory where <tt>luajit.exe</tt> is installed | |||
| 283 | (see <tt>src/luaconf.h</tt>). | 294 | (see <tt>src/luaconf.h</tt>). |
| 284 | </p> | 295 | </p> |
| 285 | 296 | ||
| 286 | <h2>Cross-compiling LuaJIT</h2> | 297 | <h2 id="cross">Cross-compiling LuaJIT</h2> |
| 287 | <p> | 298 | <p> |
| 288 | The build system has limited support for cross-compilation. For details | 299 | The build system has limited support for cross-compilation. For details |
| 289 | check the comments in <tt>src/Makefile</tt>. Here are some popular examples: | 300 | check the comments in <tt>src/Makefile</tt>. Here are some popular examples: |
| @@ -303,36 +314,130 @@ installing the <tt>mingw32</tt> package and running: | |||
| 303 | <pre class="code"> | 314 | <pre class="code"> |
| 304 | make HOST_CC="gcc -m32" CROSS=i586-mingw32msvc- TARGET_SYS=Windows | 315 | make HOST_CC="gcc -m32" CROSS=i586-mingw32msvc- TARGET_SYS=Windows |
| 305 | </pre> | 316 | </pre> |
| 317 | <p> | ||
| 318 | You can cross-compile for a PPC/e500v2 target on an x86 or x64 host system | ||
| 319 | using a standard GNU cross-compile toolchain (Binutils, GCC, EGLIBC). | ||
| 320 | The <tt>CROSS</tt> prefix may vary depending on the <tt>--target</tt> | ||
| 321 | of the toolchain: | ||
| 322 | </p> | ||
| 323 | <pre class="code"> | ||
| 324 | make HOST_CC="gcc -m32" CROSS=powerpc-e500v2-linux-gnuspe- TARGET=ppcspe | ||
| 325 | </pre> | ||
| 306 | 326 | ||
| 307 | <h2>Embedding LuaJIT</h2> | 327 | <h2 id="embed">Embedding LuaJIT</h2> |
| 308 | <p> | 328 | <p> |
| 309 | LuaJIT is API-compatible with Lua 5.1. If you've already embedded Lua | 329 | LuaJIT is API-compatible with Lua 5.1. If you've already embedded Lua |
| 310 | into your application, you probably don't need to do anything to switch | 330 | into your application, you probably don't need to do anything to switch |
| 311 | to LuaJIT, except link with a different library. Additional hints: | 331 | to LuaJIT, except link with a different library: |
| 312 | </p> | 332 | </p> |
| 313 | <ul> | 333 | <ul> |
| 334 | <li>It's strongly suggested to build LuaJIT separately using the supplied | ||
| 335 | build system. Please do <em>not</em> attempt to integrate the individual | ||
| 336 | source files into your build tree. You'll most likely get the internal build | ||
| 337 | dependencies wrong or mess up the compiler flags. Treat LuaJIT like any | ||
| 338 | other external library and link your application with either the dynamic | ||
| 339 | or static library, depending on your needs.</li> | ||
| 340 | <li>If you want to load C modules compiled for plain Lua | ||
| 341 | with <tt>require()</tt>, you need to make sure the public symbols | ||
| 342 | (e.g. <tt>lua_pushnumber</tt>) are exported, too: | ||
| 343 | <ul><li>On POSIX systems you can either link to the shared library | ||
| 344 | or link the static library into your application. In the latter case | ||
| 345 | you'll need to export all public symbols from your main executable | ||
| 346 | (e.g. <tt>-Wl,-E</tt> on Linux) and add the external dependencies | ||
| 347 | (e.g. <tt>-lm -ldl</tt> on Linux).</li> | ||
| 348 | <li>Since Windows symbols are bound to a specific DLL name, you need to | ||
| 349 | link to the <tt>lua51.dll</tt> created by the LuaJIT build (do not rename | ||
| 350 | the DLL). You may link LuaJIT statically on Windows only if you don't | ||
| 351 | intend to load Lua/C modules at runtime. | ||
| 352 | </li></ul> | ||
| 353 | </li> | ||
| 354 | <li> | ||
| 355 | If you're building a 64 bit application on OSX which links directly or | ||
| 356 | indirectly against LuaJIT, you need to link your main executable | ||
| 357 | with these flags: | ||
| 358 | <pre class="code"> | ||
| 359 | -pagezero_size 10000 -image_base 100000000 | ||
| 360 | </pre> | ||
| 361 | Also, it's recommended to <tt>rebase</tt> all (self-compiled) shared libraries | ||
| 362 | which are loaded at runtime on OSX/x64 (e.g. C extension modules for Lua). | ||
| 363 | See: <tt>man rebase</tt> | ||
| 364 | </li> | ||
| 365 | </ul> | ||
| 366 | <p>Additional hints for initializing LuaJIT using the C API functions:</p> | ||
| 367 | <ul> | ||
| 368 | <li>Here's a | ||
| 369 | <a href="http://lua-users.org/wiki/SimpleLuaApiExample"><span class="ext">»</span> simple example</a> | ||
| 370 | for embedding Lua or LuaJIT into your application.</li> | ||
| 314 | <li>Make sure you use <tt>luaL_newstate</tt>. Avoid using | 371 | <li>Make sure you use <tt>luaL_newstate</tt>. Avoid using |
| 315 | <tt>lua_newstate</tt>, since this uses the (slower) default memory | 372 | <tt>lua_newstate</tt>, since this uses the (slower) default memory |
| 316 | allocator from your system (no support for this on x64).</tt></li> | 373 | allocator from your system (no support for this on x64).</tt></li> |
| 317 | <li>Make sure you use <tt>luaL_openlibs</tt> and not the old Lua 5.0 style | 374 | <li>Make sure you use <tt>luaL_openlibs</tt> and not the old Lua 5.0 style |
| 318 | of calling <tt>luaopen_base</tt> etc. directly.</li> | 375 | of calling <tt>luaopen_base</tt> etc. directly.</li> |
| 319 | <li>To change which standard libraries to load, copy <tt>src/lib_init.c</tt> | 376 | <li>To change or extend the list of standard libraries to load, copy |
| 320 | to your project and modify it accordingly. Make sure the <tt>jit</tt> | 377 | <tt>src/lib_init.c</tt> to your project and modify it accordingly. |
| 321 | library is loaded or the JIT compiler will not be activated.</li> | 378 | Make sure the <tt>jit</tt> library is loaded or the JIT compiler |
| 322 | <li>Here's a | 379 | will not be activated.</li> |
| 323 | <a href="http://lua-users.org/wiki/SimpleLuaApiExample"><span class="ext">»</span> simple example</a>.</li> | 380 | <li>The <tt>bit.*</tt> module for bitwise operations |
| 381 | is already built-in. There's no need to statically link | ||
| 382 | <a href="http://bitop.luajit.org/"><span class="ext">»</span> Lua BitOp</a> to your application.</li> | ||
| 324 | </ul> | 383 | </ul> |
| 384 | |||
| 385 | <h2 id="distro">Hints for Distribution Maintainers</h2> | ||
| 386 | <p> | ||
| 387 | The LuaJIT build system has extra provisions for the needs of most | ||
| 388 | POSIX-based distributions. If you're a package maintainer for | ||
| 389 | a distribution, <em>please</em> make use of these features and | ||
| 390 | avoid patching, subverting, autotoolizing or messing up the build system | ||
| 391 | in unspeakable ways. | ||
| 392 | </p> | ||
| 393 | <p> | ||
| 394 | There should be absolutely no need to patch <tt>luaconf.h</tt> or any | ||
| 395 | of the Makefiles. And please do not hand-pick files for your packages — | ||
| 396 | simply use whatever <tt>make install</tt> creates. There's a reason | ||
| 397 | for all of the files <em>and</em> directories it creates. | ||
| 398 | </p> | ||
| 399 | <p> | ||
| 400 | The build system uses GNU make and autodetects most settings based on | ||
| 401 | the host you're building it on. This should work fine for native builds, | ||
| 402 | even when sandboxed. You may need to pass some of the following flags to | ||
| 403 | <em>both</em> the <tt>make</tt> and the <tt>make install</tt> command lines | ||
| 404 | for a regular distribution build: | ||
| 405 | </p> | ||
| 406 | <ul> | ||
| 407 | <li><tt>PREFIX</tt> overrides the installation path and should usually | ||
| 408 | be set to <tt>/usr</tt>. Setting this also changes the module paths and | ||
| 409 | the <tt>-rpath</tt> of the shared library.</li> | ||
| 410 | <li><tt>DESTDIR</tt> is an absolute path which allows you to install | ||
| 411 | to a shadow tree instead of the root tree of the build system.</li> | ||
| 412 | <li>Have a look at the top-level <tt>Makefile</tt> and <tt>src/Makefile</tt> | ||
| 413 | for additional variables to tweak. The following variables <em>may</em> be | ||
| 414 | overriden, but it's <em>not</em> recommended, except for special needs | ||
| 415 | like cross-builds: | ||
| 416 | <tt>BUILDMODE, CC, HOST_CC, STATIC_CC, DYNAMIC_CC, CFLAGS, HOST_CFLAGS, | ||
| 417 | TARGET_CFLAGS, LDFLAGS, HOST_LDFLAGS, TARGET_LDFLAGS, TARGET_SHLDFLAGS, | ||
| 418 | LIBS, HOST_LIBS, TARGET_LIBS, CROSS, HOST_SYS, TARGET_SYS</tt></li> | ||
| 419 | </ul> | ||
| 420 | <p> | ||
| 421 | The build system has a special target for an amalgamated build, i.e. | ||
| 422 | <tt>make amalg</tt>. This compiles the LuaJIT core as one huge C file | ||
| 423 | and allows GCC to generate faster and shorter code. Alas, this requires | ||
| 424 | lots of memory during the build. This may be a problem for some users, | ||
| 425 | that's why it's not enabled by default. But it shouldn't be a problem for | ||
| 426 | most build farms. It's recommended that binary distributions use this | ||
| 427 | target for their LuaJIT builds. | ||
| 428 | </p> | ||
| 325 | <p> | 429 | <p> |
| 326 | 64 bit applications on OSX must be linked with these options | 430 | The tl;dr version of the above: |
| 327 | (only the main executable): | ||
| 328 | </p> | 431 | </p> |
| 329 | <pre class="code"> | 432 | <pre class="code"> |
| 330 | -pagezero_size 10000 -image_base 100000000 | 433 | make amalg PREFIX=/usr && \ |
| 434 | make install PREFIX=/usr DESTDIR=/tmp/buildroot | ||
| 331 | </pre> | 435 | </pre> |
| 332 | <p> | 436 | <p> |
| 333 | It's recommended to <tt>rebase</tt> all (self-compiled) shared libraries | 437 | Finally, if you encounter any difficulties, please |
| 334 | which are loaded at runtime on OSX/x64 (e.g. C extension modules for Lua). | 438 | <a href="contact.html">contact me</a> first, instead of releasing a broken |
| 335 | See: <tt>man rebase</tt> | 439 | package onto unsuspecting users. Because they'll usually gonna complain |
| 440 | to me (the upstream) and not you (the package maintainer), anyway. | ||
| 336 | </p> | 441 | </p> |
| 337 | <br class="flush"> | 442 | <br class="flush"> |
| 338 | </div> | 443 | </div> |
diff --git a/doc/luajit.html b/doc/luajit.html index 90cd9997..71e6a19f 100644 --- a/doc/luajit.html +++ b/doc/luajit.html | |||
| @@ -65,7 +65,8 @@ standard Lua interpreter and can be deployed as a drop-in replacement. | |||
| 65 | <p> | 65 | <p> |
| 66 | LuaJIT offers more performance, at the expense of portability. It | 66 | LuaJIT offers more performance, at the expense of portability. It |
| 67 | currently runs on all popular operating systems based on | 67 | currently runs on all popular operating systems based on |
| 68 | <b>x86 or x64 CPUs</b> (Linux, Windows, OSX etc.). | 68 | <b>x86</b> or <b>x64 CPUs</b> (Linux, Windows, OSX etc.) or embedded Linux |
| 69 | systems based on <b>PPC/e500v2 CPUs</b>. | ||
| 69 | Other platforms will be supported in the future, based on user demand | 70 | Other platforms will be supported in the future, based on user demand |
| 70 | and sponsoring. | 71 | and sponsoring. |
| 71 | </p> | 72 | </p> |
| @@ -76,7 +77,7 @@ LuaJIT has been successfully used as a <b>scripting middleware</b> in | |||
| 76 | games, 3D modellers, numerical simulations, trading platforms and many | 77 | games, 3D modellers, numerical simulations, trading platforms and many |
| 77 | other specialty applications. It combines high flexibility with high | 78 | other specialty applications. It combines high flexibility with high |
| 78 | performance and an unmatched <b>low memory footprint</b>: less than | 79 | performance and an unmatched <b>low memory footprint</b>: less than |
| 79 | <b>120K</b> for the VM plus less than <b>80K</b> for the JIT compiler. | 80 | <b>120K</b> for the VM plus less than <b>80K</b> for the JIT compiler (on x86). |
| 80 | </p> | 81 | </p> |
| 81 | <p> | 82 | <p> |
| 82 | LuaJIT has been in continuous development since 2005. It's widely | 83 | LuaJIT has been in continuous development since 2005. It's widely |
| @@ -96,9 +97,13 @@ written in assembler, with a state-of-the-art JIT compiler. | |||
| 96 | An innovative <b>trace compiler</b> is integrated with advanced, | 97 | An innovative <b>trace compiler</b> is integrated with advanced, |
| 97 | SSA-based optimizations and a highly tuned code generation backend. This | 98 | SSA-based optimizations and a highly tuned code generation backend. This |
| 98 | allows a substantial reduction of the overhead associated with dynamic | 99 | allows a substantial reduction of the overhead associated with dynamic |
| 99 | language features. It's destined to break into the | 100 | language features. |
| 100 | <a href="http://luajit.org/performance.html"><span class="ext">»</span> performance</a> range | 101 | </p> |
| 101 | traditionally reserved for offline, static language compilers. | 102 | <p> |
| 103 | It's destined to break into the <a href="http://luajit.org/performance.html"><span class="ext">»</span> performance</a> | ||
| 104 | range traditionally reserved for offline, static language compilers. | ||
| 105 | Have look at these <a href="http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=all&d=data&calc=calculate&gpp=on&java=on&luajit=on&v8=on&lua=on&tracemonkey=on&box=1"><span class="ext">»</span> cross-language benchmarks</a> | ||
| 106 | to see how it ranks against the competition. | ||
| 102 | </p> | 107 | </p> |
| 103 | 108 | ||
| 104 | <h2>More ...</h2> | 109 | <h2>More ...</h2> |
diff --git a/doc/running.html b/doc/running.html index e3a2a4b0..e337d535 100644 --- a/doc/running.html +++ b/doc/running.html | |||
| @@ -126,7 +126,7 @@ systems. | |||
| 126 | </p> | 126 | </p> |
| 127 | 127 | ||
| 128 | <h3 id="opt_O"><tt>-O[level]</tt><br> | 128 | <h3 id="opt_O"><tt>-O[level]</tt><br> |
| 129 | <tt>-O[+]flag</tt> <tt>-O-flag</tt><br> | 129 | <tt>-O[+]flag</tt> <tt>-O-flag</tt><br> |
| 130 | <tt>-Oparam=value</tt></h3> | 130 | <tt>-Oparam=value</tt></h3> |
| 131 | <p> | 131 | <p> |
| 132 | This options allows fine-tuned control of the optimizations used by | 132 | This options allows fine-tuned control of the optimizations used by |
diff --git a/doc/status.html b/doc/status.html index 3da8fe78..a2de90ab 100644 --- a/doc/status.html +++ b/doc/status.html | |||
| @@ -67,30 +67,31 @@ This is a list of the things you should know about the LuaJIT 2.0 beta test: | |||
| 67 | </p> | 67 | </p> |
| 68 | <ul> | 68 | <ul> |
| 69 | <li> | 69 | <li> |
| 70 | The JIT compiler only generates code for CPUs with support for | ||
| 71 | <b>SSE2</b> instructions. I.e. you need at least a P4, Core 2/i5/i7 | ||
| 72 | or K8/K10 to get the full benefit.<br> | ||
| 73 | If you run LuaJIT on older CPUs without SSE2 support, the JIT compiler | ||
| 74 | is disabled and the VM falls back to the interpreter. | ||
| 75 | Run the command line executable without arguments to show the current status | ||
| 76 | (<tt>JIT: ON</tt> or <tt>JIT: OFF</tt>). | ||
| 77 | </li> | ||
| 78 | <li> | ||
| 79 | Obviously there will be many <b>bugs</b> in a VM which has been | 70 | Obviously there will be many <b>bugs</b> in a VM which has been |
| 80 | rewritten from the ground up. Please report your findings together with | 71 | rewritten from the ground up. Please report your findings together with |
| 81 | the circumstances needed to reproduce the bug. If possible reduce the | 72 | the circumstances needed to reproduce the bug. If possible, reduce the |
| 82 | problem down to a simple test cases.<br> | 73 | problem down to a simple test case.<br> |
| 83 | There is no formal bug tracker at the moment. The best place for | 74 | There is no formal bug tracker at the moment. The best place for |
| 84 | discussion is the | 75 | discussion is the |
| 85 | <a href="http://www.lua.org/lua-l.html"><span class="ext">»</span> Lua mailing list</a>. Of course | 76 | <a href="http://www.lua.org/lua-l.html"><span class="ext">»</span> Lua mailing list</a>. Of course |
| 86 | you may also send your bug report directly to me, especially when they | 77 | you may also send your bug reports <a href="contact.html">directly to me</a>, |
| 87 | contains lengthy debug output. Please check the | 78 | especially when they contain lengthy debug output or if you require |
| 88 | <a href="contact.html">Contact</a> page for details. | 79 | confidentiality. |
| 80 | </li> | ||
| 81 | <li> | ||
| 82 | The JIT compiler only generates code for CPUs with support for | ||
| 83 | <b>SSE2</b> instructions. I.e. you need at least a P4, Core 2/i3/i5/i7, | ||
| 84 | Atom or K8/K10 to get the full benefit.<br> | ||
| 85 | If you run LuaJIT on older CPUs without SSE2 support, the JIT compiler | ||
| 86 | is disabled and the VM falls back to the LuaJIT interpreter. This is faster | ||
| 87 | than the Lua interpreter, but not nearly as fast as the JIT compiler of course. | ||
| 88 | Run the command line executable without arguments to show the current status | ||
| 89 | (<tt>JIT: ON</tt> or <tt>JIT: OFF</tt>). | ||
| 89 | </li> | 90 | </li> |
| 90 | <li> | 91 | <li> |
| 91 | The VM is complete in the sense that it <b>should</b> run all Lua code | 92 | The VM is complete in the sense that it <b>should</b> run all Lua code |
| 92 | just fine. It's considered a serious bug if the VM crashes or produces | 93 | just fine. It's considered a serious bug if the VM crashes or produces |
| 93 | unexpected results — please report it. There are only very few | 94 | unexpected results — please report this. There are only very few |
| 94 | known incompatibilities with standard Lua: | 95 | known incompatibilities with standard Lua: |
| 95 | <ul> | 96 | <ul> |
| 96 | <li> | 97 | <li> |
| @@ -125,12 +126,12 @@ demonstrable need is shown. | |||
| 125 | <li> | 126 | <li> |
| 126 | The <b>JIT compiler</b> is not complete (yet) and falls back to the | 127 | The <b>JIT compiler</b> is not complete (yet) and falls back to the |
| 127 | interpreter in some cases. All of this works transparently, so unless | 128 | interpreter in some cases. All of this works transparently, so unless |
| 128 | you use <tt>-jv</tt>, you'll probably never notice (the interpreter is quite | 129 | you use <tt>-jv</tt>, you'll probably never notice (the interpreter is |
| 129 | fast, too). Here are the known issues: | 130 | <a href="http://luajit.org/performance.html"><span class="ext">»</span> quite fast</a>, too). Here are the known issues: |
| 130 | <ul> | 131 | <ul> |
| 131 | <li> | 132 | <li> |
| 132 | Many known issues cause a <b>NYI</b> (not yet implemented) trace abort | 133 | Most known issues cause a <b>NYI</b> (not yet implemented) trace abort |
| 133 | message. E.g. for calls to vararg functions or many string library | 134 | message. E.g. for calls to some internal library |
| 134 | functions. Reporting these is only mildly useful, except if you have good | 135 | functions. Reporting these is only mildly useful, except if you have good |
| 135 | example code that shows the problem. Obviously, reports accompanied with | 136 | example code that shows the problem. Obviously, reports accompanied with |
| 136 | a patch to fix the issue are more than welcome. But please check back | 137 | a patch to fix the issue are more than welcome. But please check back |
| @@ -138,7 +139,7 @@ with me, before writing major improvements, to avoid duplication of | |||
| 138 | effort. | 139 | effort. |
| 139 | </li> | 140 | </li> |
| 140 | <li> | 141 | <li> |
| 141 | The trace compiler currently does not back off specialization for | 142 | The trace compiler currently doesn't back off specialization for |
| 142 | function call dispatch. It should really fall back to specializing on | 143 | function call dispatch. It should really fall back to specializing on |
| 143 | the prototype, not the closure identity. This can lead to the so-called | 144 | the prototype, not the closure identity. This can lead to the so-called |
| 144 | "trace explosion" problem with <b>closure-heavy programming</b>. The | 145 | "trace explosion" problem with <b>closure-heavy programming</b>. The |
| @@ -191,20 +192,20 @@ overriding goal for a low-footprint, low-overhead JIT compiler. | |||
| 191 | <li> | 192 | <li> |
| 192 | More <b>optimizations</b> will be added in parallel to the last step on | 193 | More <b>optimizations</b> will be added in parallel to the last step on |
| 193 | an as-needed basis. Sinking of stores | 194 | an as-needed basis. Sinking of stores |
| 194 | to aggregates and sinking of allocations are high on the list. Faster | 195 | to aggregates and sinking of allocations are high on the list. |
| 195 | handling of NEWREF and better alias analysis are desirable, too. More | 196 | More complex optimizations with less pay-off, such as value-range-propagation |
| 196 | complex optimizations with less pay-off, such as value-range-propagation | ||
| 197 | (VRP) will have to wait. | 197 | (VRP) will have to wait. |
| 198 | </li> | 198 | </li> |
| 199 | <li> | 199 | <li> |
| 200 | LuaJIT 2.0 has been designed with <b>portability</b> in mind. | 200 | LuaJIT 2.0 has been designed with <b>portability</b> in mind. |
| 201 | Nonetheless, it compiles to native code and needs to be adapted to each | 201 | Nonetheless, it compiles to native code and needs to be adapted to each |
| 202 | architecture. Porting the compiler backend is probably the easier task, | 202 | architecture. The two major work items are porting the the fast interpreter, |
| 203 | but a key element of its design is the fast interpreter, written in | 203 | which is written in assembler, and porting the compiler backend. |
| 204 | machine-specific assembler.<br> | 204 | Most other portability issues like endianess or 32 vs. 64 bit CPUs |
| 205 | An x64 port is already available, thanks to the | 205 | have already been taken care of.<br> |
| 206 | Several ports are already available, thanks to the | ||
| 206 | <a href="sponsors.html">LuaJIT sponsorship program</a>. | 207 | <a href="sponsors.html">LuaJIT sponsorship program</a>. |
| 207 | Other ports will follow — companies which are | 208 | More ports will follow in the future — companies which are |
| 208 | interested in sponsoring a port to a particular architecture, please | 209 | interested in sponsoring a port to a particular architecture, please |
| 209 | use the given contact address. | 210 | use the given contact address. |
| 210 | </li> | 211 | </li> |
| @@ -230,9 +231,10 @@ for efficient <b>vectorization</b>. | |||
| 230 | Currently Lua is missing a standard library for access to <b>structured | 231 | Currently Lua is missing a standard library for access to <b>structured |
| 231 | binary data</b> and <b>arrays/buffers</b> holding low-level data types. | 232 | binary data</b> and <b>arrays/buffers</b> holding low-level data types. |
| 232 | Allowing calls to arbitrary C functions (<b>FFI</b>) would obviate the | 233 | Allowing calls to arbitrary C functions (<b>FFI</b>) would obviate the |
| 233 | need to write manual bindings. A variety of extension modules is floating | 234 | need to write manual bindings. A variety of Lua extension modules are |
| 234 | around, with different scope and capabilities. Alas, none of them has been | 235 | available, with different scope and capabilities. Alas, none of them has been |
| 235 | designed with a JIT compiler in mind. | 236 | designed with a JIT compiler in mind. An FFI for LuaJIT is currently |
| 237 | in the design phase, but there's no ETA, yet. | ||
| 236 | </li> | 238 | </li> |
| 237 | </ul> | 239 | </ul> |
| 238 | <br class="flush"> | 240 | <br class="flush"> |
