diff options
author | Roland Levillain <rpl@google.com> | 2014-11-13 14:11:42 +0000 |
---|---|---|
committer | Roland Levillain <rpl@google.com> | 2014-11-13 17:30:06 +0000 |
commit | 51d3fc40637fc73d4156ad617cd451b844cbb75e (patch) | |
tree | 21669a66124a23dfc78a8c3f1d8b89415bfb0271 /compiler/utils/arm/assembler_arm32.cc | |
parent | d94a0a1d2868baaab49f4d2835bca086d98cf763 (diff) | |
download | android_art-51d3fc40637fc73d4156ad617cd451b844cbb75e.tar.gz android_art-51d3fc40637fc73d4156ad617cd451b844cbb75e.tar.bz2 android_art-51d3fc40637fc73d4156ad617cd451b844cbb75e.zip |
Add support for int-to-byte in the optimizing compiler.
- Add support for the int-to-byte Dex instruction in the
optimizing compiler.
- Implement the ARM and Thumb-2 SBFX instructions.
- Generate x86, x86-64 and ARM (but not ARM64) code for
char to byte, short to byte and int to byte
HTypeConversion nodes.
- Add related tests to test/422-type-conversion.
Change-Id: Ic8b8911b90d4b5281fad15bcee96bc3ee85dc577
Diffstat (limited to 'compiler/utils/arm/assembler_arm32.cc')
-rw-r--r-- | compiler/utils/arm/assembler_arm32.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/compiler/utils/arm/assembler_arm32.cc b/compiler/utils/arm/assembler_arm32.cc index c8a57b1873..29cbf5851f 100644 --- a/compiler/utils/arm/assembler_arm32.cc +++ b/compiler/utils/arm/assembler_arm32.cc @@ -208,6 +208,25 @@ void Arm32Assembler::udiv(Register rd, Register rn, Register rm, Condition cond) } +void Arm32Assembler::sbfx(Register rd, Register rn, uint32_t lsb, uint32_t width, Condition cond) { + CHECK_NE(rd, kNoRegister); + CHECK_NE(rn, kNoRegister); + CHECK_NE(cond, kNoCondition); + CHECK_LE(lsb, 31U); + CHECK(1U <= width && width <= 32U) << width; + uint32_t widthminus1 = width - 1; + + int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | + B26 | B25 | B24 | B23 | B21 | + (widthminus1 << 16) | + (static_cast<uint32_t>(rd) << 12) | + (lsb << 7) | + B6 | B4 | + static_cast<uint32_t>(rn); + Emit(encoding); +} + + void Arm32Assembler::ldr(Register rd, const Address& ad, Condition cond) { EmitMemOp(cond, true, false, rd, ad); } |