diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-29 17:40:00 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-29 17:40:00 -0800 |
commit | 29d1e223681c3d33ab44dac76592ef9eab88bc1a (patch) | |
tree | 016251457d23fb44349c493d133c532f6bddcbf3 | |
parent | 9f8132c93fc0669e08187f55204f440f8363b9a1 (diff) |
add llvm_bswap_i64 for #768
-rw-r--r-- | src/library.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js index 956d062c..4dfd9438 100644 --- a/src/library.js +++ b/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 ) { |