summaryrefslogtreecommitdiffstats
path: root/compiler/utils/arm/assembler_thumb2_test.cc
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-02-02 13:17:52 -0800
committerAndreas Gampe <agampe@google.com>2015-02-02 17:22:48 -0800
commit513ea0c203a86e9d81a8630b56cb62704e126cc2 (patch)
treee11a9e337750c77e49fa543e76ae5550fa0f64c4 /compiler/utils/arm/assembler_thumb2_test.cc
parent4336b97fc291d28f883607c88feaff202a684a59 (diff)
downloadandroid_art-513ea0c203a86e9d81a8630b56cb62704e126cc2.tar.gz
android_art-513ea0c203a86e9d81a8630b56cb62704e126cc2.tar.bz2
android_art-513ea0c203a86e9d81a8630b56cb62704e126cc2.zip
ART: Fix thumb2 utils assembler
It didn't correctly put down the 16b variants, as it was not checking the ShifterOperand correctly. Add one simple test. TODO: exhaustive testing. Change-Id: Ied08da115f8417a3ca92bd9967c6dcdc102e7510
Diffstat (limited to 'compiler/utils/arm/assembler_thumb2_test.cc')
-rw-r--r--compiler/utils/arm/assembler_thumb2_test.cc27
1 files changed, 25 insertions, 2 deletions
diff --git a/compiler/utils/arm/assembler_thumb2_test.cc b/compiler/utils/arm/assembler_thumb2_test.cc
index 425ccd7ea3..e571e72402 100644
--- a/compiler/utils/arm/assembler_thumb2_test.cc
+++ b/compiler/utils/arm/assembler_thumb2_test.cc
@@ -30,11 +30,15 @@ class AssemblerThumb2Test : public AssemblerTest<arm::Thumb2Assembler,
}
std::string GetAssemblerParameters() OVERRIDE {
- return " -mthumb -mfpu=neon";
+ return " -march=armv7-a -mcpu=cortex-a15 -mfpu=neon -mthumb";
+ }
+
+ const char* GetAssemblyHeader() OVERRIDE {
+ return kThumb2AssemblyHeader;
}
std::string GetDisassembleParameters() OVERRIDE {
- return " -D -bbinary -marm --no-show-raw-insn";
+ return " -D -bbinary -marm --disassembler-options=force-thumb --no-show-raw-insn";
}
void SetUpHelpers() OVERRIDE {
@@ -76,6 +80,8 @@ class AssemblerThumb2Test : public AssemblerTest<arm::Thumb2Assembler,
private:
std::vector<arm::Register*> registers_;
+
+ static constexpr const char* kThumb2AssemblyHeader = ".syntax unified\n.thumb\n";
};
@@ -192,4 +198,21 @@ TEST_F(AssemblerThumb2Test, strexd) {
DriverStr(expected, "strexd");
}
+TEST_F(AssemblerThumb2Test, eor) {
+#define __ GetAssembler()->
+ __ eor(arm::R1, arm::R1, arm::ShifterOperand(arm::R0));
+ __ eor(arm::R1, arm::R0, arm::ShifterOperand(arm::R1));
+ __ eor(arm::R1, arm::R8, arm::ShifterOperand(arm::R0));
+ __ eor(arm::R8, arm::R1, arm::ShifterOperand(arm::R0));
+ __ eor(arm::R1, arm::R0, arm::ShifterOperand(arm::R8));
+
+ const char* expected =
+ "eors r1, r0\n"
+ "eor r1, r0, r1\n"
+ "eor r1, r8, r0\n"
+ "eor r8, r1, r0\n"
+ "eor r1, r0, r8\n";
+ DriverStr(expected, "abs");
+}
+
} // namespace art