diff options
author | Roland Levillain <rpl@google.com> | 2014-11-14 11:47:14 +0000 |
---|---|---|
committer | Roland Levillain <rpl@google.com> | 2014-11-14 11:51:41 +0000 |
commit | 981e45424f52735b1c61ae0eac7e299ed313f8db (patch) | |
tree | b52598c87d7e1cd030e570da2a59ee26199ae481 /compiler/utils/arm/assembler_thumb2_test.cc | |
parent | 4594ad627a48e249ee1680e954558dea15f0d133 (diff) | |
download | android_art-981e45424f52735b1c61ae0eac7e299ed313f8db.tar.gz android_art-981e45424f52735b1c61ae0eac7e299ed313f8db.tar.bz2 android_art-981e45424f52735b1c61ae0eac7e299ed313f8db.zip |
Add support for int-to-char in the optimizing compiler.
- Add support for the int-to-char Dex instruction in the
optimizing compiler.
- Implement the ARM and Thumb-2 UBFX instructions and add
tests for them.
- Generate x86, x86-64 and ARM (but not ARM64) code for
byte to char, short to char, int to char (and char to
char!) HTypeConversion nodes.
- Add related tests to test/422-type-conversion.
Change-Id: I5cd4c6d86f0f6a966c059715b98db35cc8f9de76
Diffstat (limited to 'compiler/utils/arm/assembler_thumb2_test.cc')
-rw-r--r-- | compiler/utils/arm/assembler_thumb2_test.cc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/compiler/utils/arm/assembler_thumb2_test.cc b/compiler/utils/arm/assembler_thumb2_test.cc index 57ba0ca5ee..65d6d45296 100644 --- a/compiler/utils/arm/assembler_thumb2_test.cc +++ b/compiler/utils/arm/assembler_thumb2_test.cc @@ -120,4 +120,40 @@ TEST_F(AssemblerThumb2Test, Sbfx) { DriverStr(expected, "sbfx"); } +TEST_F(AssemblerThumb2Test, Ubfx) { + GetAssembler()->ubfx(arm::R0, arm::R1, 0, 1); + GetAssembler()->ubfx(arm::R0, arm::R1, 0, 8); + GetAssembler()->ubfx(arm::R0, arm::R1, 0, 16); + GetAssembler()->ubfx(arm::R0, arm::R1, 0, 32); + + GetAssembler()->ubfx(arm::R0, arm::R1, 8, 1); + GetAssembler()->ubfx(arm::R0, arm::R1, 8, 8); + GetAssembler()->ubfx(arm::R0, arm::R1, 8, 16); + GetAssembler()->ubfx(arm::R0, arm::R1, 8, 24); + + GetAssembler()->ubfx(arm::R0, arm::R1, 16, 1); + GetAssembler()->ubfx(arm::R0, arm::R1, 16, 8); + GetAssembler()->ubfx(arm::R0, arm::R1, 16, 16); + + GetAssembler()->ubfx(arm::R0, arm::R1, 31, 1); + + const char* expected = + "ubfx r0, r1, #0, #1\n" + "ubfx r0, r1, #0, #8\n" + "ubfx r0, r1, #0, #16\n" + "ubfx r0, r1, #0, #32\n" + + "ubfx r0, r1, #8, #1\n" + "ubfx r0, r1, #8, #8\n" + "ubfx r0, r1, #8, #16\n" + "ubfx r0, r1, #8, #24\n" + + "ubfx r0, r1, #16, #1\n" + "ubfx r0, r1, #16, #8\n" + "ubfx r0, r1, #16, #16\n" + + "ubfx r0, r1, #31, #1\n"; + DriverStr(expected, "ubfx"); +} + } // namespace art |