diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/ext_ffi_semantics.html | 22 | ||||
-rw-r--r-- | doc/extensions.html | 3 |
2 files changed, 21 insertions, 4 deletions
diff --git a/doc/ext_ffi_semantics.html b/doc/ext_ffi_semantics.html index 03229012..6f84533c 100644 --- a/doc/ext_ffi_semantics.html +++ b/doc/ext_ffi_semantics.html | |||
@@ -730,6 +730,22 @@ You'll have to explicitly convert a 64 bit integer to a Lua | |||
730 | number (e.g. for regular floating-point calculations) with | 730 | number (e.g. for regular floating-point calculations) with |
731 | <tt>tonumber()</tt>. But note this may incur a precision loss.</li> | 731 | <tt>tonumber()</tt>. But note this may incur a precision loss.</li> |
732 | 732 | ||
733 | <li><b>64 bit bitwise operations</b>: the rules for 64 bit | ||
734 | arithmetic operators apply analogously.<br> | ||
735 | |||
736 | Unlike the other <tt>bit.*</tt> operations, <tt>bit.tobit()</tt> | ||
737 | converts a cdata number via <tt>int64_t</tt> to <tt>int32_t</tt> and | ||
738 | returns a Lua number.<br> | ||
739 | |||
740 | For <tt>bit.band()</tt>, <tt>bit.bor()</tt> and <tt>bit.bxor()</tt>, the | ||
741 | conversion to <tt>int64_t</tt> or <tt>uint64_t</tt> applies to | ||
742 | <em>all</em> arguments, if <em>any</em> argument is a cdata number.<br> | ||
743 | |||
744 | For all other operations, only the first argument is used to determine | ||
745 | the output type. This implies that a cdata number as a shift count for | ||
746 | shifts and rotates is accepted, but that alone does <em>not</em> cause | ||
747 | a cdata number output. | ||
748 | |||
733 | </ul> | 749 | </ul> |
734 | 750 | ||
735 | <h3 id="cdata_comp">Comparisons of cdata objects</h3> | 751 | <h3 id="cdata_comp">Comparisons of cdata objects</h3> |
@@ -1203,9 +1219,8 @@ suboptimal performance, especially when used in inner loops: | |||
1203 | <li>Vector operations.</li> | 1219 | <li>Vector operations.</li> |
1204 | <li>Table initializers.</li> | 1220 | <li>Table initializers.</li> |
1205 | <li>Initialization of nested <tt>struct</tt>/<tt>union</tt> types.</li> | 1221 | <li>Initialization of nested <tt>struct</tt>/<tt>union</tt> types.</li> |
1206 | <li>Allocations of variable-length arrays or structs.</li> | 1222 | <li>Non-default initialization of VLA/VLS or large C types |
1207 | <li>Allocations of C types with a size > 128 bytes or an | 1223 | (> 128 bytes or > 16 array elements.</li> |
1208 | alignment > 8 bytes.</li> | ||
1209 | <li>Conversions from lightuserdata to <tt>void *</tt>.</li> | 1224 | <li>Conversions from lightuserdata to <tt>void *</tt>.</li> |
1210 | <li>Pointer differences for element sizes that are not a power of | 1225 | <li>Pointer differences for element sizes that are not a power of |
1211 | two.</li> | 1226 | two.</li> |
@@ -1222,7 +1237,6 @@ value.</li> | |||
1222 | Other missing features: | 1237 | Other missing features: |
1223 | </p> | 1238 | </p> |
1224 | <ul> | 1239 | <ul> |
1225 | <li>Bit operations for 64 bit types.</li> | ||
1226 | <li>Arithmetic for <tt>complex</tt> numbers.</li> | 1240 | <li>Arithmetic for <tt>complex</tt> numbers.</li> |
1227 | <li>Passing structs by value to vararg C functions.</li> | 1241 | <li>Passing structs by value to vararg C functions.</li> |
1228 | <li><a href="extensions.html#exceptions">C++ exception interoperability</a> | 1242 | <li><a href="extensions.html#exceptions">C++ exception interoperability</a> |
diff --git a/doc/extensions.html b/doc/extensions.html index 8684dc32..8300753e 100644 --- a/doc/extensions.html +++ b/doc/extensions.html | |||
@@ -113,6 +113,9 @@ bit.lshift bit.rshift bit.arshift bit.rol bit.ror bit.bswap | |||
113 | This module is a LuaJIT built-in — you don't need to download or | 113 | This module is a LuaJIT built-in — you don't need to download or |
114 | install Lua BitOp. The Lua BitOp site has full documentation for all | 114 | install Lua BitOp. The Lua BitOp site has full documentation for all |
115 | <a href="http://bitop.luajit.org/api.html"><span class="ext">»</span> Lua BitOp API functions</a>. | 115 | <a href="http://bitop.luajit.org/api.html"><span class="ext">»</span> Lua BitOp API functions</a>. |
116 | The FFI adds support for | ||
117 | <a href="ext_ffi_semantics.html#cdata_arith">64 bit bitwise operations<a>, | ||
118 | using the same API functions. | ||
116 | </p> | 119 | </p> |
117 | <p> | 120 | <p> |
118 | Please make sure to <tt>require</tt> the module before using any of | 121 | Please make sure to <tt>require</tt> the module before using any of |