diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-04-20 16:02:42 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-04-20 16:02:42 -0700 |
commit | 6f8af49c568abfb3b4203f1d3dc95e12fe573986 (patch) | |
tree | 5694a8ac1f6ab81aa0304e4701a4d5cdd2e3bffe /tools/test-js-optimizer-asm-pre.js | |
parent | 31872fbd01ca23962d954ca40232c7b8bfde58fe (diff) |
optimize HEAPU?8[..] << 24 >> 24 and similar
Diffstat (limited to 'tools/test-js-optimizer-asm-pre.js')
-rw-r--r-- | tools/test-js-optimizer-asm-pre.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/tools/test-js-optimizer-asm-pre.js b/tools/test-js-optimizer-asm-pre.js index 0fb7050f..f2ffaef4 100644 --- a/tools/test-js-optimizer-asm-pre.js +++ b/tools/test-js-optimizer-asm-pre.js @@ -74,4 +74,25 @@ function retf() { } // missing final return, need it as a float } -// EMSCRIPTEN_GENERATED_FUNCTIONS: ["a", "b", "rett", "ret2t", "retf"] +function i32_8() { + if (((HEAP8[$4 & 16777215] | 0) << 24 >> 24) == 0) { + print(5); + } + if ((HEAP8[$5 & 16777215] << 24 >> 24) == 0) { + print(5); + } + if (((HEAPU8[$6 & 16777215] | 0) << 24 >> 24) == 0) { + print(5); + } + if ((HEAPU8[$7 & 16777215] << 24 >> 24) == 0) { + print(5); + } + // non-valid + if ((HEAPU8[$8 & 16777215] << 24 >> 16) == 0) { + print(5); + } + if ((HEAPU8[$9 & 16777215] << 16 >> 16) == 0) { + print(5); + } +} +// EMSCRIPTEN_GENERATED_FUNCTIONS: ["a", "b", "rett", "ret2t", "retf", "i32_8"] |