aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMike Pall <mike>2013-03-13 22:44:01 +0100
committerMike Pall <mike>2013-03-14 06:03:18 +0100
commita98aede37772797b4471e1a094452051edff5862 (patch)
tree6e8c86838e359b899ffa0021bf3149087caa71da /doc
parent3e8f5ac7186ecac63e17688b9ba6e72697143dbb (diff)
downloadluajit-a98aede37772797b4471e1a094452051edff5862.tar.gz
luajit-a98aede37772797b4471e1a094452051edff5862.tar.bz2
luajit-a98aede37772797b4471e1a094452051edff5862.zip
FFI: Add 64 bit bitwise operations.
Diffstat (limited to 'doc')
-rw-r--r--doc/ext_ffi_semantics.html17
-rw-r--r--doc/extensions.html3
2 files changed, 19 insertions, 1 deletions
diff --git a/doc/ext_ffi_semantics.html b/doc/ext_ffi_semantics.html
index 03229012..15c9a6db 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&nbsp;bit integer to a Lua
730number (e.g. for regular floating-point calculations) with 730number (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&nbsp;bit bitwise operations</b>: the rules for 64&nbsp;bit
734arithmetic operators apply analogously.<br>
735
736Unlike the other <tt>bit.*</tt> operations, <tt>bit.tobit()</tt>
737converts a cdata number via <tt>int64_t</tt> to <tt>int32_t</tt> and
738returns a Lua number.<br>
739
740For <tt>bit.band()</tt>, <tt>bit.bor()</tt> and <tt>bit.bxor()</tt>, the
741conversion 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
744For all other operations, only the first argument is used to determine
745the output type. This implies that a cdata number as a shift count for
746shifts and rotates is accepted, but that alone does <em>not</em> cause
747a 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>
@@ -1222,7 +1238,6 @@ value.</li>
1222Other missing features: 1238Other missing features:
1223</p> 1239</p>
1224<ul> 1240<ul>
1225<li>Bit operations for 64&nbsp;bit types.</li>
1226<li>Arithmetic for <tt>complex</tt> numbers.</li> 1241<li>Arithmetic for <tt>complex</tt> numbers.</li>
1227<li>Passing structs by value to vararg C&nbsp;functions.</li> 1242<li>Passing structs by value to vararg C&nbsp;functions.</li>
1228<li><a href="extensions.html#exceptions">C++ exception interoperability</a> 1243<li><a href="extensions.html#exceptions">C++ exception interoperability</a>
diff --git a/doc/extensions.html b/doc/extensions.html
index 2bfcc76c..f288fbde 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
113This module is a LuaJIT built-in &mdash; you don't need to download or 113This module is a LuaJIT built-in &mdash; you don't need to download or
114install Lua BitOp. The Lua BitOp site has full documentation for all 114install Lua BitOp. The Lua BitOp site has full documentation for all
115<a href="http://bitop.luajit.org/api.html"><span class="ext">&raquo;</span>&nbsp;Lua BitOp API functions</a>. 115<a href="http://bitop.luajit.org/api.html"><span class="ext">&raquo;</span>&nbsp;Lua BitOp API functions</a>.
116The FFI adds support for
117<a href="ext_ffi_semantics.html#cdata_arith">64&nbsp;bit bitwise operations<a>,
118using the same API functions.
116</p> 119</p>
117<p> 120<p>
118Please make sure to <tt>require</tt> the module before using any of 121Please make sure to <tt>require</tt> the module before using any of