OSDN Git Service

Thumb2 assembler for JNI compiler and optimizing compiler
authorDave Allison <dallison@google.com>
Mon, 28 Apr 2014 20:45:27 +0000 (13:45 -0700)
committerDave Allison <dallison@google.com>
Thu, 5 Jun 2014 19:45:20 +0000 (12:45 -0700)
commit65fcc2cf3c5cd97b84330c094908f3a6a7a8d4e7
treefc0ce77d446477be37f0ec8c86d67df4941cac9b
parente3b5cb502371aff7e7b7291facfc27b092e7803e
Thumb2 assembler for JNI compiler and optimizing compiler

This provides a programmatic assembler for the thumb2 instruction set for
ARM.  The interface is the same as the ARM assembler and the ARM assembler has
been moved into Arm32Assembler.  The assembler handles most 16 and 32 bit instructions
and also allows relocations due to branch expansion.  It will also rewrite cbz/cbnz
instructions if they go out of range.

It also changes the JNI compiler to use the thumb2 assembler as opposed
to forcing it to use ARM32.  The trampoline compiler still uses ARM due to the
way it returns the address of its generated code.  A trampoline in thumb2 is the
same size as that in ARM anyway (8 bytes).

Provides gtest for testing the thumb2 instruction output.  This gtest only runs
on the host as it uses arm-eabi-objdump to disassemble the generated code.  On the
target the output is not checked but the assembler will still be run to perform
all its checks.

Change-Id: Icd9742b6f13541bec5b23097896727392e3a6fb6
16 files changed:
build/Android.gtest.mk
compiler/Android.mk
compiler/jni/quick/jni_compiler.cc
compiler/optimizing/code_generator_arm.h
compiler/trampolines/trampoline_compiler.cc
compiler/utils/arm/assembler_arm.cc
compiler/utils/arm/assembler_arm.h
compiler/utils/arm/assembler_arm32.cc [new file with mode: 0644]
compiler/utils/arm/assembler_arm32.h [new file with mode: 0644]
compiler/utils/arm/assembler_thumb2.cc [new file with mode: 0644]
compiler/utils/arm/assembler_thumb2.h [new file with mode: 0644]
compiler/utils/arm/constants_arm.h
compiler/utils/assembler.cc
compiler/utils/assembler.h
compiler/utils/assembler_thumb_test.cc [new file with mode: 0644]
compiler/utils/assembler_thumb_test_expected.cc.inc [new file with mode: 0644]