diff options
author | Dan Gohman <sunfish@google.com> | 2013-07-08 11:23:18 -0700 |
---|---|---|
committer | Dan Gohman <sunfish@google.com> | 2013-07-08 11:23:18 -0700 |
commit | b090967580b4b1d03134b4dd11d849fd50f23951 (patch) | |
tree | 041e5826045ab5482ac715b4e391cb30a09affea /tools/test-js-optimizer-asm-pre-output.js | |
parent | 3117fa129fe2aef34a7c954bfe02c1eb0e5f8d29 (diff) |
Xor optimizations.
Optimize x^-1 to ~x; this comes up because LLVM does not have a bitwise
negate operator. Optimize x&1^1 to !x; this comes up because of how LLVM
lowers C++ bool variables.
Also, add an optimization to simplifyExpressionsPre to eliminate |0 from
'~' expressions in more cases.
Diffstat (limited to 'tools/test-js-optimizer-asm-pre-output.js')
-rw-r--r-- | tools/test-js-optimizer-asm-pre-output.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/test-js-optimizer-asm-pre-output.js b/tools/test-js-optimizer-asm-pre-output.js index 59a42010..d66c28a4 100644 --- a/tools/test-js-optimizer-asm-pre-output.js +++ b/tools/test-js-optimizer-asm-pre-output.js @@ -63,6 +63,9 @@ function b($this, $__n) { HEAP32[($this + 4 & 16777215) >> 2] = $40; } HEAP8[$38 + $40 & 16777215] = 0; + HEAP32[$4] = ~HEAP32[$5]; + HEAP32[$4] = ~HEAP32[$5]; + HEAP32[$4] = ~HEAP32[$5]; return; } function rett() { |