OSDN Git Service

Implement fp to bits methods as intrinsics.
authorAart Bik <ajcbik@google.com>
Thu, 25 Feb 2016 19:32:32 +0000 (11:32 -0800)
committerAart Bik <ajcbik@google.com>
Fri, 26 Feb 2016 17:16:07 +0000 (09:16 -0800)
commit2a6aad9d388bd29bff04aeec3eb9429d436d1873
treea5fa70df33d410af1be1064c460b6e34f07caf93
parent9ec486cc08ad658eee33f9bde405b97502562840
Implement fp to bits methods as intrinsics.

Rationale:
Better optimization, better performance.

Results on libcore benchmark:

Most gain is from moving the invariant call out of the loop
after we detect everything is a side-effect free intrinsic.
But generated code in general case is much cleaner too.

Before:
timeFloatToIntBits() in 181 ms.
timeFloatToRawIntBits() in 35 ms.
timeDoubleToLongBits() in 208 ms.
timeDoubleToRawLongBits() in 35 ms.

After:
timeFloatToIntBits() in 36 ms.
timeFloatToRawIntBits() in 35 ms.
timeDoubleToLongBits() in 35 ms.
timeDoubleToRawLongBits() in 34 ms.

bug=11548336

Change-Id: I6e001bd3708e800bd75a82b8950fb3a0fc01766e
15 files changed:
compiler/dex/quick/dex_file_method_inliner.cc
compiler/dex/quick/dex_file_method_inliner.h
compiler/optimizing/instruction_simplifier.cc
compiler/optimizing/intrinsics.cc
compiler/optimizing/intrinsics_arm.cc
compiler/optimizing/intrinsics_arm64.cc
compiler/optimizing/intrinsics_list.h
compiler/optimizing/intrinsics_mips.cc
compiler/optimizing/intrinsics_mips64.cc
compiler/optimizing/intrinsics_x86.cc
compiler/optimizing/intrinsics_x86_64.cc
runtime/quick/inline_method_analyser.h
test/577-checker-fp2int/expected.txt [new file with mode: 0644]
test/577-checker-fp2int/info.txt [new file with mode: 0644]
test/577-checker-fp2int/src/Main.java [new file with mode: 0644]