diff options
author | 2016-09-30 17:04:49 +0000 | |
---|---|---|
committer | 2016-09-30 18:08:09 +0100 | |
commit | 5f926055cb88089d8ca27243f35a9dfd89d981f0 (patch) | |
tree | 8d87d400e36301eb648e19bcd225f13c469648ad /compiler/utils/arm/assembler_thumb2.cc | |
parent | 9e5739aaa690a8529c104f4c05035a657616c310 (diff) |
Revert "Store resolved Strings for AOT code in .bss."
There are some issues with oat_test64 on host and aosp_mips-eng.
Also reverts "compiler_driver: Fix build."
Bug: 20323084
Bug: 30627598
This reverts commit 63dccbbefef3014c99c22748d18befcc7bcb3b41.
This reverts commit 04a44135ace10123f059373691594ae0f270a8a4.
Change-Id: I568ba3e58cf103987fdd63c8a21521010a9f27c4
Diffstat (limited to 'compiler/utils/arm/assembler_thumb2.cc')
-rw-r--r-- | compiler/utils/arm/assembler_thumb2.cc | 76 |
1 files changed, 49 insertions, 27 deletions
diff --git a/compiler/utils/arm/assembler_thumb2.cc b/compiler/utils/arm/assembler_thumb2.cc index 61b7f08518..2269ba2d20 100644 --- a/compiler/utils/arm/assembler_thumb2.cc +++ b/compiler/utils/arm/assembler_thumb2.cc @@ -2461,36 +2461,58 @@ void Thumb2Assembler::EmitLoadStore(Condition cond, } } else { // Register shift. - CHECK_NE(ad.GetRegister(), PC); - if (ad.GetShiftCount() != 0) { - // If there is a shift count this must be 32 bit. - must_be_32bit = true; - } else if (IsHighRegister(ad.GetRegisterOffset())) { - must_be_32bit = true; - } - - if (must_be_32bit) { - int32_t encoding = 0x1f << 27 | (load ? B20 : 0) | static_cast<uint32_t>(rd) << 12 | - ad.encodingThumb(true); - if (half) { - encoding |= B21; - } else if (!byte) { - encoding |= B22; - } - if (load && is_signed && (byte || half)) { - encoding |= B24; + if (ad.GetRegister() == PC) { + // PC relative literal encoding. + int32_t offset = ad.GetOffset(); + if (must_be_32bit || offset < 0 || offset >= (1 << 10) || !load) { + int32_t up = B23; + if (offset < 0) { + offset = -offset; + up = 0; + } + CHECK_LT(offset, (1 << 12)); + int32_t encoding = 0x1f << 27 | 0xf << 16 | B22 | (load ? B20 : 0) | + offset | up | + static_cast<uint32_t>(rd) << 12; + Emit32(encoding); + } else { + // 16 bit literal load. + CHECK_GE(offset, 0); + CHECK_LT(offset, (1 << 10)); + int32_t encoding = B14 | (load ? B11 : 0) | static_cast<uint32_t>(rd) << 8 | offset >> 2; + Emit16(encoding); } - Emit32(encoding); } else { - // 16 bit register offset. - int32_t encoding = B14 | B12 | (load ? B11 : 0) | static_cast<uint32_t>(rd) | - ad.encodingThumb(false); - if (byte) { - encoding |= B10; - } else if (half) { - encoding |= B9; + if (ad.GetShiftCount() != 0) { + // If there is a shift count this must be 32 bit. + must_be_32bit = true; + } else if (IsHighRegister(ad.GetRegisterOffset())) { + must_be_32bit = true; + } + + if (must_be_32bit) { + int32_t encoding = 0x1f << 27 | (load ? B20 : 0) | static_cast<uint32_t>(rd) << 12 | + ad.encodingThumb(true); + if (half) { + encoding |= B21; + } else if (!byte) { + encoding |= B22; + } + if (load && is_signed && (byte || half)) { + encoding |= B24; + } + Emit32(encoding); + } else { + // 16 bit register offset. + int32_t encoding = B14 | B12 | (load ? B11 : 0) | static_cast<uint32_t>(rd) | + ad.encodingThumb(false); + if (byte) { + encoding |= B10; + } else if (half) { + encoding |= B9; + } + Emit16(encoding); } - Emit16(encoding); } } } |