diff options
author | 2016-07-07 15:37:02 +0100 | |
---|---|---|
committer | 2016-07-08 14:33:16 +0100 | |
commit | ebdbf4b6f213fb98654604073985fb074c7beca1 (patch) | |
tree | 4901cc586575c92b87e72f159ce3335805e0fb91 /compiler/utils/arm/assembler_arm.h | |
parent | 74c0d1bb67f9c6ee8306f0318ab7251d56dc99d6 (diff) |
ARM: Use 64-bit literals for LoadDImmediate().
And rewrite the medium-range long/fp literal to use
MOVW+ADD+LDRD/VLDR because the old instruction sequence
was broken if the "ADD ip, pc" was not 4-byte aligned.
Test: assembler_thumb2_test has been updated. Standard
ART test suite has been run on host and Nexus 5.
Change-Id: I37c6a62aa6e77c6a9701b5a1fb4db2e666c1eae9
Diffstat (limited to 'compiler/utils/arm/assembler_arm.h')
-rw-r--r-- | compiler/utils/arm/assembler_arm.h | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/compiler/utils/arm/assembler_arm.h b/compiler/utils/arm/assembler_arm.h index a571d14a71..9cf72a2601 100644 --- a/compiler/utils/arm/assembler_arm.h +++ b/compiler/utils/arm/assembler_arm.h @@ -754,32 +754,7 @@ class ArmAssembler : public Assembler { } } - void LoadDImmediate(DRegister sd, double value, Condition cond = AL) { - if (!vmovd(sd, value, cond)) { - uint64_t int_value = bit_cast<uint64_t, double>(value); - if (int_value == bit_cast<uint64_t, double>(0.0)) { - // 0.0 is quite common, so we special case it by loading - // 2.0 in `sd` and then substracting it. - bool success = vmovd(sd, 2.0, cond); - CHECK(success); - vsubd(sd, sd, sd, cond); - } else { - if (sd < 16) { - SRegister low = static_cast<SRegister>(sd << 1); - SRegister high = static_cast<SRegister>(low + 1); - LoadSImmediate(low, bit_cast<float, uint32_t>(Low32Bits(int_value)), cond); - if (High32Bits(int_value) == Low32Bits(int_value)) { - vmovs(high, low); - } else { - LoadSImmediate(high, bit_cast<float, uint32_t>(High32Bits(int_value)), cond); - } - } else { - LOG(FATAL) << "Unimplemented loading of double into a D register " - << "that cannot be split into two S registers"; - } - } - } - } + virtual void LoadDImmediate(DRegister dd, double value, Condition cond = AL) = 0; virtual void MarkExceptionHandler(Label* label) = 0; virtual void LoadFromOffset(LoadOperandType type, |