OSDN Git Service

Replace rotate patterns and invokes with HRor IR.
authorScott Wakeling <scott.wakeling@linaro.org>
Fri, 11 Dec 2015 09:50:36 +0000 (09:50 +0000)
committerVladimir Marko <vmarko@google.com>
Fri, 11 Dec 2015 16:13:44 +0000 (16:13 +0000)
commit40a04bf64e5837fa48aceaffe970c9984c94084a
tree27aeff3b9492b396050155734d81aba3c57ffbb7
parent763fd2d3d131898cad6295a19ae9a30e22ce5f2a
Replace rotate patterns and invokes with HRor IR.

Replace constant and register version bitfield rotate patterns, and
rotateRight/Left intrinsic invokes, with new HRor IR.

Where k is constant and r is a register, with the UShr and Shl on
either side of a |, +, or ^, the following patterns are replaced:

  x >>> #k OP x << #(reg_size - k)
  x >>> #k OP x << #-k

  x >>> r OP x << (#reg_size - r)
  x >>> (#reg_size - r) OP x << r

  x >>> r OP x << -r
  x >>> -r OP x << r

Implemented for ARM/ARM64 & X86/X86_64.

Tests changed to not be inlined to prevent optimization from folding
them out. Additional tests added for constant rotate amounts.

Change-Id: I5847d104c0a0348e5792be6c5072ce5090ca2c34
23 files changed:
compiler/optimizing/code_generator_arm.cc
compiler/optimizing/code_generator_arm.h
compiler/optimizing/code_generator_arm64.cc
compiler/optimizing/code_generator_mips.cc
compiler/optimizing/code_generator_mips64.cc
compiler/optimizing/code_generator_x86.cc
compiler/optimizing/code_generator_x86_64.cc
compiler/optimizing/common_arm64.h
compiler/optimizing/graph_checker.cc
compiler/optimizing/instruction_simplifier.cc
compiler/optimizing/intrinsics_arm.cc
compiler/optimizing/intrinsics_arm64.cc
compiler/optimizing/intrinsics_x86.cc
compiler/optimizing/intrinsics_x86_64.cc
compiler/optimizing/nodes.h
compiler/optimizing/nodes_arm64.h
test/541-checker-instruction-simplifier-rotate/expected.txt [new file with mode: 0644]
test/541-checker-instruction-simplifier-rotate/info.txt [new file with mode: 0644]
test/541-checker-instruction-simplifier-rotate/src/Main.java [new file with mode: 0644]
test/542-bitfield-rotates/expected.txt [new file with mode: 0644]
test/542-bitfield-rotates/info.txt [new file with mode: 0644]
test/542-bitfield-rotates/src/Main.java [new file with mode: 0644]
test/Android.run-test.mk