aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPierre Renaux <pierre@talansoft.com>2012-04-07 20:05:02 +0800
committerPierre Renaux <pierre@talansoft.com>2012-04-19 11:48:26 +0800
commit8356efd9a97bfbf69b7fc96df4012daa066e5d1f (patch)
treebd43515213d5394bfe6693447a39c0a0ce674ea4 /src
parentd8085249b4f2420c7456ed0ba86f6d03e59271bd (diff)
[src/library.js]: Added llvm_bswap_i16 ;
Diffstat (limited to 'src')
-rw-r--r--src/library.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js
index 6009bc78..7a46a68f 100644
--- a/src/library.js
+++ b/src/library.js
@@ -4394,6 +4394,21 @@ LibraryManager.library = {
*/
},
+ llvm_bswap_i16: function(x) {
+ x = unSign(x, 32);
+ var bytes = [];
+ bytes[0] = x & 255;
+ x >>= 8;
+ bytes[1] = x & 255;
+ x >>= 8;
+ var ret = 0;
+ ret <<= 8;
+ ret += bytes[0];
+ ret <<= 8;
+ ret += bytes[1];
+ return ret;
+ },
+
llvm_bswap_i32: function(x) {
x = unSign(x, 32);
var bytes = [];