OSDN Git Service

Optimizing: double-negated bitwise operations simplifications
authorKevin Brodsky <kevin.brodsky@linaro.org>
Fri, 15 Jan 2016 09:49:20 +0000 (09:49 +0000)
committerKevin Brodsky <kevin.brodsky@linaro.org>
Fri, 22 Jan 2016 14:43:37 +0000 (14:43 +0000)
commit96798493170521691d709be50dd2102ead47b083
tree34d03d55e9a2eeaa3f06bc7198c192156aa676b4
parent7d9f95f29d07c455c3ab76d89b7952755a3e0a28
Optimizing: double-negated bitwise operations simplifications

Generic instruction simplifications applying to bitwise operations when
both inputs are Not's. And and Or are handled by De Morgan's laws,
removing one instruction:
~a & ~b -> ~(a | b)
~a | ~b -> ~(a & b)
Xor is handled by this trivial relation, removing two instructions:
~a ^ ~b = a ^ b

The simplifications only happen when neither Not is used by other
instructions.

Change-Id: I5d5187af2f625c475c3e49466af6bc3e87595f8f
compiler/optimizing/instruction_simplifier.cc
test/565-checker-doublenegbitwise/expected.txt [new file with mode: 0644]
test/565-checker-doublenegbitwise/info.txt [new file with mode: 0644]
test/565-checker-doublenegbitwise/src/Main.java [new file with mode: 0644]