aboutsummaryrefslogtreecommitdiff
path: root/tools/test-js-optimizer-asm-pre.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/test-js-optimizer-asm-pre.js')
-rw-r--r--tools/test-js-optimizer-asm-pre.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/test-js-optimizer-asm-pre.js b/tools/test-js-optimizer-asm-pre.js
index c7c92124..7ca941fa 100644
--- a/tools/test-js-optimizer-asm-pre.js
+++ b/tools/test-js-optimizer-asm-pre.js
@@ -122,6 +122,18 @@ function sign_extension_simplification() {
print(5);
}
}
+function compare_result_simplification() {
+ // Eliminate these '&1's.
+ HEAP32[$4] = (HEAP32[$5] < HEAP32[$6]) & 1;
+ HEAP32[$4] = (HEAP32[$5] > HEAP32[$6]) & 1;
+ HEAP32[$4] = (HEAP32[$5] <= HEAP32[$6]) & 1;
+ HEAP32[$4] = (HEAP32[$5] <= HEAP32[$6]) & 1;
+ HEAP32[$4] = (HEAP32[$5] == HEAP32[$6]) & 1;
+ HEAP32[$4] = (HEAP32[$5] === HEAP32[$6]) & 1;
+ HEAP32[$4] = (HEAP32[$5] != HEAP32[$6]) & 1;
+ // Convert the &1 to |0 here, since we don't get an implicit coersion.
+ var x = (HEAP32[$5] != HEAP32[$6]) & 1;
+}
function tempDoublePtr($45, $14, $28, $42) {
$45 = $45 | 0;
$14 = $14 | 0;