aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-04-17 12:33:08 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-04-17 12:33:08 -0700
commitc584078d47008008102c0d580a8f97d928683331 (patch)
tree47640e42f637f9d0fbf6e014973a563bca5790e5 /src
parent87d62e4e7505c77c53ebc00d5bc56540863699db (diff)
parent8e812b712fb6d281b48fba60af36103e062f495e (diff)
Merge pull request #2301 from sbalko/incoming
asm.js-ify some LLVM intrinsics
Diffstat (limited to 'src')
-rw-r--r--src/library.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/library.js b/src/library.js
index 1d5a9140..c2830397 100644
--- a/src/library.js
+++ b/src/library.js
@@ -3908,12 +3908,18 @@ LibraryManager.library = {
{{{ makeCopyValues('(ppdest+'+Runtime.QUANTUM_SIZE+')', '(ppsrc+'+Runtime.QUANTUM_SIZE+')', Runtime.QUANTUM_SIZE, 'null', null, 1) }}};
},
+ llvm_bswap_i16__asm: true,
+ llvm_bswap_i16__sig: 'ii',
llvm_bswap_i16: function(x) {
- return ((x&0xff)<<8) | ((x>>8)&0xff);
+ x = x|0;
+ return (((x&0xff)<<8) | ((x>>8)&0xff))|0;
},
+ llvm_bswap_i32__asm: true,
+ llvm_bswap_i32__sig: 'ii',
llvm_bswap_i32: function(x) {
- return ((x&0xff)<<24) | (((x>>8)&0xff)<<16) | (((x>>16)&0xff)<<8) | (x>>>24);
+ x = x|0;
+ return (((x&0xff)<<24) | (((x>>8)&0xff)<<16) | (((x>>16)&0xff)<<8) | (x>>>24))|0;
},
llvm_bswap_i64__deps: ['llvm_bswap_i32'],