Permalink
Browse files

add llvm_bswap_i64 for #768

  • Loading branch information...
1 parent 9f8132c commit 29d1e223681c3d33ab44dac76592ef9eab88bc1a @kripken committed Dec 30, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/library.js
View
11 src/library.js
@@ -4763,6 +4763,17 @@ LibraryManager.library = {
return ((x&0xff)<<24) | (((x>>8)&0xff)<<16) | (((x>>16)&0xff)<<8) | (x>>>24);
},
+ llvm_bswap_i64__deps: ['llvm_bswap_i32'],
+ llvm_bswap_i64: function(l, h) {
+ var retl = _llvm_bswap_i32(h)>>>0;
+ var reth = _llvm_bswap_i32(l)>>>0;
+#if USE_TYPED_ARRAYS == 2
+ return [retl, reth];
+#else
+ throw 'unsupported';
+#endif
+ },
+
llvm_ctlz_i32: function(x) {
for (var i=0; i<32; i++) {
if ( (x & (1 << (31-i))) != 0 ) {

0 comments on commit 29d1e22

Please sign in to comment.