aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgia Kouveli <georgia.kouveli@arm.com>2017-05-12 18:07:45 +0100
committerGeorgia Kouveli <georgia.kouveli@arm.com>2017-05-15 13:59:37 +0100
commit275c9d477d5bb717ac48f29db4ed153495be5ad3 (patch)
tree0d4b2707a1b47d82d0aeb8a01088f6f98db0d031
parent9cd420f65453048b29e4d259f9cfdc440f1d9b92 (diff)
[pool-manager] Split Label and Literal.
Add a new Location class that's a parent of both Label and Literal. Uses of Label and Literal in the MacroAssembler stay as before, whereas in the Assembler the new simple Location class is used. Also changes the EmitOperator to store the ISA of the reference instruction (to avoid storing this information in ForwardReference), and removes the minimum and maximum offsets from EmitOperator, since that information is now stored in ReferenceInfo. Addition of the architecture-specific PC-offset is now done in the Encode method of the EmitOperator, where we don't need to check which instruction set we are using (it's statically known). These changes are in preparation of integration with the new pool manager, but also clean up usage of labels and literals in some cases. For example, it won't be possible to jump to a literal with the MacroAssembler anymore, as Literal does not derive from Label. Change-Id: I1139faaccfbd087e97ecbff2cfc2433a35582973
-rw-r--r--examples/aarch32/custom-aarch32-disasm.cc10
-rw-r--r--src/aarch32/assembler-aarch32.cc1004
-rw-r--r--src/aarch32/assembler-aarch32.h187
-rw-r--r--src/aarch32/disasm-aarch32.cc285
-rw-r--r--src/aarch32/disasm-aarch32.h52
-rw-r--r--src/aarch32/instructions-aarch32.h2
-rw-r--r--src/aarch32/label-aarch32.h153
-rw-r--r--src/aarch32/macro-assembler-aarch32.cc56
-rw-r--r--src/aarch32/macro-assembler-aarch32.h23
-rw-r--r--test/aarch32/test-disasm-a32.cc8
10 files changed, 958 insertions, 822 deletions
diff --git a/examples/aarch32/custom-aarch32-disasm.cc b/examples/aarch32/custom-aarch32-disasm.cc
index 95d090e2..72ce564c 100644
--- a/examples/aarch32/custom-aarch32-disasm.cc
+++ b/examples/aarch32/custom-aarch32-disasm.cc
@@ -41,14 +41,14 @@ namespace aarch32 {
// Example of disassembly customization.
class CustomStream : public Disassembler::DisassemblerStream {
- std::map<Label::Offset, const char*> symbols_;
+ std::map<Location::Offset, const char*> symbols_;
public:
CustomStream() : Disassembler::DisassemblerStream(std::cout) {}
- std::map<Label::Offset, const char*>& GetSymbols() { return symbols_; }
+ std::map<Location::Offset, const char*>& GetSymbols() { return symbols_; }
virtual DisassemblerStream& operator<<(const Disassembler::PrintLabel& label)
VIXL_OVERRIDE {
- std::map<Label::Offset, const char*>::iterator symbol =
+ std::map<Location::Offset, const char*>::iterator symbol =
symbols_.find(label.GetLocation());
// If the label was named, print the name instead of the address.
if (symbol != symbols_.end()) {
@@ -76,7 +76,7 @@ class CustomDisassembler : public PrintDisassembler {
virtual void PrintCodeAddress(uint32_t pc) VIXL_OVERRIDE {
// If the address matches a label, then print the label. Otherwise, print
// nothing.
- std::map<Label::Offset, const char*>::iterator symbol =
+ std::map<Location::Offset, const char*>::iterator symbol =
GetStream()->GetSymbols().find(pc);
if (symbol != GetStream()->GetSymbols().end()) {
os().os() << symbol->second << ":" << std::endl;
@@ -104,7 +104,7 @@ class NamedLabel : public Label {
~NamedLabel() {
if (IsBound()) {
stream_->GetSymbols().insert(
- std::pair<Label::Offset, const char*>(GetLocation(), name_));
+ std::pair<Location::Offset, const char*>(GetLocation(), name_));
}
}
};
diff --git a/src/aarch32/assembler-aarch32.cc b/src/aarch32/assembler-aarch32.cc
index 248d91e8..fa90fa93 100644
--- a/src/aarch32/assembler-aarch32.cc
+++ b/src/aarch32/assembler-aarch32.cc
@@ -80,59 +80,63 @@ void Assembler::PerformCheckIT(Condition condition) {
void Assembler::BindHelper(Label* label) {
- VIXL_ASSERT(!label->IsBound());
- label->Bind(GetCursorOffset());
+ BindLocationHelper(label);
- for (Label::ForwardRefList::iterator ref = label->GetFirstForwardRef();
- ref != label->GetEndForwardRef();
- ref++) {
- EncodeLabelFor(*ref, label);
- }
if (label->IsInVeneerPool()) {
label->GetVeneerPoolManager()->RemoveLabel(label);
}
}
+void Assembler::BindLocationHelper(Location* location) {
+ VIXL_ASSERT(!location->IsBound());
+ location->Bind(GetCursorOffset());
+
+ for (Location::ForwardRefList::iterator ref = location->GetFirstForwardRef();
+ ref != location->GetEndForwardRef();
+ ref++) {
+ EncodeLocationFor(*ref, location);
+ }
+}
+
+
uint32_t Assembler::Link(uint32_t instr,
- Label* label,
- const Label::LabelEmitOperator& op) {
- label->SetReferenced();
- if (label->IsBound()) {
- return op.Encode(instr,
- GetCursorOffset() + GetArchitectureStatePCOffset(),
- label);
- }
- label->AddForwardRef(GetCursorOffset(), GetInstructionSetInUse(), op);
+ Location* location,
+ const Location::EmitOperator& op,
+ const struct ReferenceInfo* info) {
+ location->SetReferenced();
+ if (location->IsBound()) {
+ return op.Encode(instr, GetCursorOffset(), location);
+ }
+ location->AddForwardRef(GetCursorOffset(), op, info->max_offset);
return instr;
}
-void Assembler::EncodeLabelFor(const Label::ForwardReference& forward,
- Label* label) {
- const uint32_t location = forward.GetLocation();
- const uint32_t from = location + forward.GetStatePCOffset();
- const Label::LabelEmitOperator& encoder = forward.GetEmitOperator();
- if (forward.IsUsingT32()) {
- uint16_t* instr_ptr = buffer_.GetOffsetAddress<uint16_t*>(location);
+void Assembler::EncodeLocationFor(const Location::ForwardReference& forward,
+ Location* location) {
+ const uint32_t from = forward.GetLocation();
+ const Location::EmitOperator& encoder = forward.GetEmitOperator();
+ if (encoder.IsUsingT32()) {
+ uint16_t* instr_ptr = buffer_.GetOffsetAddress<uint16_t*>(from);
if (Is16BitEncoding(instr_ptr[0])) {
// The Encode methods always deals with uint32_t types so we need
// to explicitely cast it.
uint32_t instr = static_cast<uint32_t>(instr_ptr[0]);
- instr = encoder.Encode(instr, from, label);
+ instr = encoder.Encode(instr, from, location);
// The Encode method should not ever set the top 16 bits.
VIXL_ASSERT((instr & ~0xffff) == 0);
instr_ptr[0] = static_cast<uint16_t>(instr);
} else {
uint32_t instr =
instr_ptr[1] | (static_cast<uint32_t>(instr_ptr[0]) << 16);
- instr = encoder.Encode(instr, from, label);
+ instr = encoder.Encode(instr, from, location);
instr_ptr[0] = static_cast<uint16_t>(instr >> 16);
instr_ptr[1] = static_cast<uint16_t>(instr);
}
} else {
- uint32_t* instr_ptr = buffer_.GetOffsetAddress<uint32_t*>(location);
- instr_ptr[0] = encoder.Encode(instr_ptr[0], from, label);
+ uint32_t* instr_ptr = buffer_.GetOffsetAddress<uint32_t*>(from);
+ instr_ptr[0] = encoder.Encode(instr_ptr[0], from, location);
}
}
@@ -2624,40 +2628,42 @@ void Assembler::addw(Condition cond,
void Assembler::adr(Condition cond,
EncodingSize size,
Register rd,
- Label* label) {
+ Location* location) {
VIXL_ASSERT(AllowAssembler());
CheckIT(cond);
- Label::Offset offset =
- label->IsBound()
- ? label->GetLocation() -
+ Location::Offset offset =
+ location->IsBound()
+ ? location->GetLocation() -
AlignDown(GetCursorOffset() + GetArchitectureStatePCOffset(), 4)
: 0;
if (IsUsingT32()) {
int32_t neg_offset = -offset;
// ADR{<c>}{<q>} <Rd>, <label> ; T1
if (!size.IsWide() && rd.IsLow() &&
- ((label->IsBound() && (offset >= 0) && (offset <= 1020) &&
+ ((location->IsBound() && (offset >= 0) && (offset <= 1020) &&
((offset & 0x3) == 0)) ||
- (!label->IsBound() && size.IsNarrow()))) {
- static class EmitOp : public Label::LabelEmitOperator {
+ (!location->IsBound() && size.IsNarrow()))) {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(0, 1020) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= 0) && (offset <= 1020) &&
((offset & 0x3) == 0));
const int32_t target = offset >> 2;
return instr | (target & 0xff);
}
} immop;
- EmitT32_16(Link(0xa000 | (rd.GetCode() << 8), label, immop));
+ EmitT32_16(
+ Link(0xa000 | (rd.GetCode() << 8), location, immop, &kAdrT1Info));
AdvanceIT();
return;
}
// ADR{<c>}{<q>} <Rd>, <label> ; T2
- if (!size.IsNarrow() && label->IsBound() && (neg_offset > 0) &&
+ if (!size.IsNarrow() && location->IsBound() && (neg_offset > 0) &&
(neg_offset <= 4095) && (!rd.IsPC() || AllowUnpredictable())) {
EmitT32_32(0xf2af0000U | (rd.GetCode() << 8) | (neg_offset & 0xff) |
((neg_offset & 0x700) << 4) | ((neg_offset & 0x800) << 15));
@@ -2666,15 +2672,16 @@ void Assembler::adr(Condition cond,
}
// ADR{<c>}{<q>} <Rd>, <label> ; T3
if (!size.IsNarrow() &&
- (!label->IsBound() || ((offset >= 0) && (offset <= 4095))) &&
+ (!location->IsBound() || ((offset >= 0) && (offset <= 4095))) &&
(!rd.IsPC() || AllowUnpredictable())) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(0, 4095) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
int32_t target;
if ((offset >= 0) && (offset <= 4095)) {
target = offset;
@@ -2688,7 +2695,10 @@ void Assembler::adr(Condition cond,
((target & 0x800) << 15);
}
} immop;
- EmitT32_32(Link(0xf20f0000U | (rd.GetCode() << 8), label, immop));
+ EmitT32_32(Link(0xf20f0000U | (rd.GetCode() << 8),
+ location,
+ immop,
+ &kAdrT3Info));
AdvanceIT();
return;
}
@@ -2696,15 +2706,16 @@ void Assembler::adr(Condition cond,
ImmediateA32 positive_immediate_a32(offset);
ImmediateA32 negative_immediate_a32(-offset);
// ADR{<c>}{<q>} <Rd>, <label> ; A1
- if ((!label->IsBound() || positive_immediate_a32.IsValid()) &&
+ if ((!location->IsBound() || positive_immediate_a32.IsValid()) &&
cond.IsNotNever()) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(0, 255) {}
+ EmitOp() : Location::EmitOperator(A32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kA32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
int32_t target;
ImmediateA32 positive_immediate_a32(offset);
if (positive_immediate_a32.IsValid()) {
@@ -2721,28 +2732,29 @@ void Assembler::adr(Condition cond,
} immop;
EmitA32(
Link(0x028f0000U | (cond.GetCondition() << 28) | (rd.GetCode() << 12),
- label,
- immop));
+ location,
+ immop,
+ &kAdrA1Info));
return;
}
// ADR{<c>}{<q>} <Rd>, <label> ; A2
- if (label->IsBound() && negative_immediate_a32.IsValid() &&
+ if (location->IsBound() && negative_immediate_a32.IsValid() &&
cond.IsNotNever()) {
EmitA32(0x024f0000U | (cond.GetCondition() << 28) | (rd.GetCode() << 12) |
negative_immediate_a32.GetEncodingValue());
return;
}
}
- Delegate(kAdr, &Assembler::adr, cond, size, rd, label);
+ Delegate(kAdr, &Assembler::adr, cond, size, rd, location);
}
bool Assembler::adr_info(Condition cond,
EncodingSize size,
Register rd,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info) {
- VIXL_ASSERT(!label->IsBound());
- USE(label);
+ VIXL_ASSERT(!location->IsBound());
+ USE(location);
if (IsUsingT32()) {
// ADR{<c>}{<q>} <Rd>, <label> ; T1
if (!size.IsWide() && rd.IsLow() && size.IsNarrow()) {
@@ -3084,73 +3096,79 @@ void Assembler::asrs(Condition cond,
Delegate(kAsrs, &Assembler::asrs, cond, size, rd, rm, operand);
}
-void Assembler::b(Condition cond, EncodingSize size, Label* label) {
+void Assembler::b(Condition cond, EncodingSize size, Location* location) {
VIXL_ASSERT(AllowAssembler());
- Label::Offset offset =
- label->IsBound()
- ? label->GetLocation() -
+ Location::Offset offset =
+ location->IsBound()
+ ? location->GetLocation() -
(GetCursorOffset() + GetArchitectureStatePCOffset())
: 0;
if (IsUsingT32()) {
// B<c>{<q>} <label> ; T1
if (OutsideITBlock() && !size.IsWide() &&
- ((label->IsBound() && (offset >= -256) && (offset <= 254) &&
+ ((location->IsBound() && (offset >= -256) && (offset <= 254) &&
((offset & 0x1) == 0)) ||
- (!label->IsBound() && size.IsNarrow())) &&
+ (!location->IsBound() && size.IsNarrow())) &&
!cond.Is(al) && cond.IsNotNever()) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-256, 254) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - pc;
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - pc;
VIXL_ASSERT((offset >= -256) && (offset <= 254) &&
((offset & 0x1) == 0));
const int32_t target = offset >> 1;
return instr | (target & 0xff);
}
} immop;
- EmitT32_16(Link(0xd000 | (cond.GetCondition() << 8), label, immop));
+ EmitT32_16(Link(0xd000 | (cond.GetCondition() << 8),
+ location,
+ immop,
+ &kBT1Info));
AdvanceIT();
return;
}
// B{<c>}{<q>} <label> ; T2
if (OutsideITBlockAndAlOrLast(cond) && !size.IsWide() &&
- ((label->IsBound() && (offset >= -2048) && (offset <= 2046) &&
+ ((location->IsBound() && (offset >= -2048) && (offset <= 2046) &&
((offset & 0x1) == 0)) ||
- (!label->IsBound() && size.IsNarrow()))) {
+ (!location->IsBound() && size.IsNarrow()))) {
CheckIT(cond);
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-2048, 2046) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - pc;
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - pc;
VIXL_ASSERT((offset >= -2048) && (offset <= 2046) &&
((offset & 0x1) == 0));
const int32_t target = offset >> 1;
return instr | (target & 0x7ff);
}
} immop;
- EmitT32_16(Link(0xe000, label, immop));
+ EmitT32_16(Link(0xe000, location, immop, &kBT2Info));
AdvanceIT();
return;
}
// B<c>{<q>} <label> ; T3
if (OutsideITBlock() && !size.IsNarrow() &&
- ((label->IsBound() && (offset >= -1048576) && (offset <= 1048574) &&
+ ((location->IsBound() && (offset >= -1048576) && (offset <= 1048574) &&
((offset & 0x1) == 0)) ||
- !label->IsBound()) &&
+ !location->IsBound()) &&
!cond.Is(al) && cond.IsNotNever()) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-1048576, 1048574) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - pc;
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - pc;
VIXL_ASSERT((offset >= -1048576) && (offset <= 1048574) &&
((offset & 0x1) == 0));
const int32_t target = offset >> 1;
@@ -3159,23 +3177,27 @@ void Assembler::b(Condition cond, EncodingSize size, Label* label) {
((target & 0x80000) << 7);
}
} immop;
- EmitT32_32(Link(0xf0008000U | (cond.GetCondition() << 22), label, immop));
+ EmitT32_32(Link(0xf0008000U | (cond.GetCondition() << 22),
+ location,
+ immop,
+ &kBT3Info));
AdvanceIT();
return;
}
// B{<c>}{<q>} <label> ; T4
if (OutsideITBlockAndAlOrLast(cond) && !size.IsNarrow() &&
- ((label->IsBound() && (offset >= -16777216) && (offset <= 16777214) &&
- ((offset & 0x1) == 0)) ||
- !label->IsBound())) {
+ ((location->IsBound() && (offset >= -16777216) &&
+ (offset <= 16777214) && ((offset & 0x1) == 0)) ||
+ !location->IsBound())) {
CheckIT(cond);
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-16777216, 16777214) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - pc;
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - pc;
VIXL_ASSERT((offset >= -16777216) && (offset <= 16777214) &&
((offset & 0x1) == 0));
int32_t target = offset >> 1;
@@ -3186,42 +3208,46 @@ void Assembler::b(Condition cond, EncodingSize size, Label* label) {
((target & 0x800000) << 3);
}
} immop;
- EmitT32_32(Link(0xf0009000U, label, immop));
+ EmitT32_32(Link(0xf0009000U, location, immop, &kBT4Info));
AdvanceIT();
return;
}
} else {
// B{<c>}{<q>} <label> ; A1
- if (((label->IsBound() && (offset >= -33554432) && (offset <= 33554428) &&
- ((offset & 0x3) == 0)) ||
- !label->IsBound()) &&
+ if (((location->IsBound() && (offset >= -33554432) &&
+ (offset <= 33554428) && ((offset & 0x3) == 0)) ||
+ !location->IsBound()) &&
cond.IsNotNever()) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-33554432, 33554428) {}
+ EmitOp() : Location::EmitOperator(A32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - pc;
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kA32PcDelta;
+ Location::Offset offset = location->GetLocation() - pc;
VIXL_ASSERT((offset >= -33554432) && (offset <= 33554428) &&
((offset & 0x3) == 0));
const int32_t target = offset >> 2;
return instr | (target & 0xffffff);
}
} immop;
- EmitA32(Link(0x0a000000U | (cond.GetCondition() << 28), label, immop));
+ EmitA32(Link(0x0a000000U | (cond.GetCondition() << 28),
+ location,
+ immop,
+ &kBA1Info));
return;
}
}
- Delegate(kB, &Assembler::b, cond, size, label);
+ Delegate(kB, &Assembler::b, cond, size, location);
}
bool Assembler::b_info(Condition cond,
EncodingSize size,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info) {
- VIXL_ASSERT(!label->IsBound());
- USE(label);
+ VIXL_ASSERT(!location->IsBound());
+ USE(location);
if (IsUsingT32()) {
// B<c>{<q>} <label> ; T1
if (OutsideITBlock() && !size.IsWide() && size.IsNarrow() && !cond.Is(al) &&
@@ -3508,27 +3534,28 @@ void Assembler::bkpt(Condition cond, uint32_t imm) {
Delegate(kBkpt, &Assembler::bkpt, cond, imm);
}
-void Assembler::bl(Condition cond, Label* label) {
+void Assembler::bl(Condition cond, Location* location) {
VIXL_ASSERT(AllowAssembler());
CheckIT(cond);
- Label::Offset offset =
- label->IsBound()
- ? label->GetLocation() -
+ Location::Offset offset =
+ location->IsBound()
+ ? location->GetLocation() -
(GetCursorOffset() + GetArchitectureStatePCOffset())
: 0;
if (IsUsingT32()) {
// BL{<c>}{<q>} <label> ; T1
- if (((label->IsBound() && (offset >= -16777216) && (offset <= 16777214) &&
- ((offset & 0x1) == 0)) ||
- !label->IsBound()) &&
+ if (((location->IsBound() && (offset >= -16777216) &&
+ (offset <= 16777214) && ((offset & 0x1) == 0)) ||
+ !location->IsBound()) &&
(OutsideITBlockAndAlOrLast(cond) || AllowUnpredictable())) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-16777216, 16777214) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - pc;
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - pc;
VIXL_ASSERT((offset >= -16777216) && (offset <= 16777214) &&
((offset & 0x1) == 0));
int32_t target = offset >> 1;
@@ -3539,41 +3566,45 @@ void Assembler::bl(Condition cond, Label* label) {
((target & 0x800000) << 3);
}
} immop;
- EmitT32_32(Link(0xf000d000U, label, immop));
+ EmitT32_32(Link(0xf000d000U, location, immop, &kBlT1Info));
AdvanceIT();
return;
}
} else {
// BL{<c>}{<q>} <label> ; A1
- if (((label->IsBound() && (offset >= -33554432) && (offset <= 33554428) &&
- ((offset & 0x3) == 0)) ||
- !label->IsBound()) &&
+ if (((location->IsBound() && (offset >= -33554432) &&
+ (offset <= 33554428) && ((offset & 0x3) == 0)) ||
+ !location->IsBound()) &&
cond.IsNotNever()) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-33554432, 33554428) {}
+ EmitOp() : Location::EmitOperator(A32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - pc;
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kA32PcDelta;
+ Location::Offset offset = location->GetLocation() - pc;
VIXL_ASSERT((offset >= -33554432) && (offset <= 33554428) &&
((offset & 0x3) == 0));
const int32_t target = offset >> 2;
return instr | (target & 0xffffff);
}
} immop;
- EmitA32(Link(0x0b000000U | (cond.GetCondition() << 28), label, immop));
+ EmitA32(Link(0x0b000000U | (cond.GetCondition() << 28),
+ location,
+ immop,
+ &kBlA1Info));
return;
}
}
- Delegate(kBl, &Assembler::bl, cond, label);
+ Delegate(kBl, &Assembler::bl, cond, location);
}
bool Assembler::bl_info(Condition cond,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info) {
- VIXL_ASSERT(!label->IsBound());
- USE(label);
+ VIXL_ASSERT(!location->IsBound());
+ USE(location);
if (IsUsingT32()) {
// BL{<c>}{<q>} <label> ; T1
if (true) {
@@ -3590,27 +3621,28 @@ bool Assembler::bl_info(Condition cond,
return false;
}
-void Assembler::blx(Condition cond, Label* label) {
+void Assembler::blx(Condition cond, Location* location) {
VIXL_ASSERT(AllowAssembler());
CheckIT(cond);
- Label::Offset offset =
- label->IsBound()
- ? label->GetLocation() -
+ Location::Offset offset =
+ location->IsBound()
+ ? location->GetLocation() -
AlignDown(GetCursorOffset() + GetArchitectureStatePCOffset(), 4)
: 0;
if (IsUsingT32()) {
// BLX{<c>}{<q>} <label> ; T2
- if (((label->IsBound() && (offset >= -16777216) && (offset <= 16777212) &&
- ((offset & 0x3) == 0)) ||
- !label->IsBound()) &&
+ if (((location->IsBound() && (offset >= -16777216) &&
+ (offset <= 16777212) && ((offset & 0x3) == 0)) ||
+ !location->IsBound()) &&
(OutsideITBlockAndAlOrLast(cond) || AllowUnpredictable())) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-16777216, 16777212) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -16777216) && (offset <= 16777212) &&
((offset & 0x3) == 0));
int32_t target = offset >> 2;
@@ -3621,42 +3653,45 @@ void Assembler::blx(Condition cond, Label* label) {
((target & 0x400000) << 4);
}
} immop;
- EmitT32_32(Link(0xf000c000U, label, immop));
+ EmitT32_32(Link(0xf000c000U, location, immop, &kBlxT2Info));
AdvanceIT();
return;
}
} else {
// BLX{<c>}{<q>} <label> ; A2
- if (((label->IsBound() && (offset >= -33554432) && (offset <= 33554430) &&
- ((offset & 0x1) == 0)) ||
- !label->IsBound())) {
+ if (((location->IsBound() && (offset >= -33554432) &&
+ (offset <= 33554430) && ((offset & 0x1) == 0)) ||
+ !location->IsBound())) {
if (cond.Is(al) || AllowStronglyDiscouraged()) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-33554432, 33554430) {}
+ EmitOp() : Location::EmitOperator(A32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const
+ VIXL_OVERRIDE {
+ pc += kA32PcDelta;
+ Location::Offset offset =
+ location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -33554432) && (offset <= 33554430) &&
((offset & 0x1) == 0));
const int32_t target = offset >> 1;
return instr | ((target & 0x1) << 24) | ((target & 0x1fffffe) >> 1);
}
} immop;
- EmitA32(Link(0xfa000000U, label, immop));
+ EmitA32(Link(0xfa000000U, location, immop, &kBlxA2Info));
return;
}
}
}
- Delegate(kBlx, &Assembler::blx, cond, label);
+ Delegate(kBlx, &Assembler::blx, cond, location);
}
bool Assembler::blx_info(Condition cond,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info) {
- VIXL_ASSERT(!label->IsBound());
- USE(label);
+ VIXL_ASSERT(!location->IsBound());
+ USE(location);
USE(cond);
if (IsUsingT32()) {
// BLX{<c>}{<q>} <label> ; T2
@@ -3736,45 +3771,46 @@ void Assembler::bxj(Condition cond, Register rm) {
Delegate(kBxj, &Assembler::bxj, cond, rm);
}
-void Assembler::cbnz(Register rn, Label* label) {
+void Assembler::cbnz(Register rn, Location* location) {
VIXL_ASSERT(AllowAssembler());
CheckIT(al);
- Label::Offset offset =
- label->IsBound()
- ? label->GetLocation() -
+ Location::Offset offset =
+ location->IsBound()
+ ? location->GetLocation() -
(GetCursorOffset() + GetArchitectureStatePCOffset())
: 0;
if (IsUsingT32()) {
// CBNZ{<q>} <Rn>, <label> ; T1
- if (rn.IsLow() && ((label->IsBound() && (offset >= 0) && (offset <= 126) &&
- ((offset & 0x1) == 0)) ||
- !label->IsBound())) {
- static class EmitOp : public Label::LabelEmitOperator {
+ if (rn.IsLow() && ((location->IsBound() && (offset >= 0) &&
+ (offset <= 126) && ((offset & 0x1) == 0)) ||
+ !location->IsBound())) {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(0, 126) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - pc;
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - pc;
VIXL_ASSERT((offset >= 0) && (offset <= 126) &&
((offset & 0x1) == 0));
const int32_t target = offset >> 1;
return instr | ((target & 0x1f) << 3) | ((target & 0x20) << 4);
}
} immop;
- EmitT32_16(Link(0xb900 | rn.GetCode(), label, immop));
+ EmitT32_16(Link(0xb900 | rn.GetCode(), location, immop, &kCbnzT1Info));
AdvanceIT();
return;
}
}
- Delegate(kCbnz, &Assembler::cbnz, rn, label);
+ Delegate(kCbnz, &Assembler::cbnz, rn, location);
}
bool Assembler::cbnz_info(Register rn,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info) {
- VIXL_ASSERT(!label->IsBound());
- USE(label);
+ VIXL_ASSERT(!location->IsBound());
+ USE(location);
if (IsUsingT32()) {
// CBNZ{<q>} <Rn>, <label> ; T1
if (rn.IsLow()) {
@@ -3785,45 +3821,46 @@ bool Assembler::cbnz_info(Register rn,
return false;
}
-void Assembler::cbz(Register rn, Label* label) {
+void Assembler::cbz(Register rn, Location* location) {
VIXL_ASSERT(AllowAssembler());
CheckIT(al);
- Label::Offset offset =
- label->IsBound()
- ? label->GetLocation() -
+ Location::Offset offset =
+ location->IsBound()
+ ? location->GetLocation() -
(GetCursorOffset() + GetArchitectureStatePCOffset())
: 0;
if (IsUsingT32()) {
// CBZ{<q>} <Rn>, <label> ; T1
- if (rn.IsLow() && ((label->IsBound() && (offset >= 0) && (offset <= 126) &&
- ((offset & 0x1) == 0)) ||
- !label->IsBound())) {
- static class EmitOp : public Label::LabelEmitOperator {
+ if (rn.IsLow() && ((location->IsBound() && (offset >= 0) &&
+ (offset <= 126) && ((offset & 0x1) == 0)) ||
+ !location->IsBound())) {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(0, 126) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - pc;
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - pc;
VIXL_ASSERT((offset >= 0) && (offset <= 126) &&
((offset & 0x1) == 0));
const int32_t target = offset >> 1;
return instr | ((target & 0x1f) << 3) | ((target & 0x20) << 4);
}
} immop;
- EmitT32_16(Link(0xb100 | rn.GetCode(), label, immop));
+ EmitT32_16(Link(0xb100 | rn.GetCode(), location, immop, &kCbzT1Info));
AdvanceIT();
return;
}
}
- Delegate(kCbz, &Assembler::cbz, rn, label);
+ Delegate(kCbz, &Assembler::cbz, rn, location);
}
bool Assembler::cbz_info(Register rn,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info) {
- VIXL_ASSERT(!label->IsBound());
- USE(label);
+ VIXL_ASSERT(!location->IsBound());
+ USE(location);
if (IsUsingT32()) {
// CBZ{<q>} <Rn>, <label> ; T1
if (rn.IsLow()) {
@@ -5235,72 +5272,79 @@ void Assembler::ldr(Condition cond,
void Assembler::ldr(Condition cond,
EncodingSize size,
Register rt,
- Label* label) {
+ Location* location) {
VIXL_ASSERT(AllowAssembler());
CheckIT(cond);
- Label::Offset offset =
- label->IsBound()
- ? label->GetLocation() -
+ Location::Offset offset =
+ location->IsBound()
+ ? location->GetLocation() -
AlignDown(GetCursorOffset() + GetArchitectureStatePCOffset(), 4)
: 0;
if (IsUsingT32()) {
// LDR{<c>}{<q>} <Rt>, <label> ; T1
if (!size.IsWide() && rt.IsLow() &&
- ((label->IsBound() && (offset >= 0) && (offset <= 1020) &&
+ ((location->IsBound() && (offset >= 0) && (offset <= 1020) &&
((offset & 0x3) == 0)) ||
- (!label->IsBound() && size.IsNarrow()))) {
- static class EmitOp : public Label::LabelEmitOperator {
+ (!location->IsBound() && size.IsNarrow()))) {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(0, 1020) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= 0) && (offset <= 1020) &&
((offset & 0x3) == 0));
const int32_t target = offset >> 2;
return instr | (target & 0xff);
}
} immop;
- EmitT32_16(Link(0x4800 | (rt.GetCode() << 8), label, immop));
+ EmitT32_16(
+ Link(0x4800 | (rt.GetCode() << 8), location, immop, &kLdrT1Info));
AdvanceIT();
return;
}
// LDR{<c>}{<q>} <Rt>, <label> ; T2
if (!size.IsNarrow() &&
- ((label->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
- !label->IsBound()) &&
+ ((location->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
+ !location->IsBound()) &&
((!rt.IsPC() || OutsideITBlockAndAlOrLast(cond)) ||
AllowUnpredictable())) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-4095, 4095) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -4095) && (offset <= 4095));
uint32_t U = (offset >= 0);
int32_t target = abs(offset) | (U << 12);
return instr | (target & 0xfff) | ((target & 0x1000) << 11);
}
} immop;
- EmitT32_32(Link(0xf85f0000U | (rt.GetCode() << 12), label, immop));
+ EmitT32_32(Link(0xf85f0000U | (rt.GetCode() << 12),
+ location,
+ immop,
+ &kLdrT2Info));
AdvanceIT();
return;
}
} else {
// LDR{<c>}{<q>} <Rt>, <label> ; A1
- if (((label->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
- !label->IsBound()) &&
+ if (((location->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
+ !location->IsBound()) &&
cond.IsNotNever()) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-4095, 4095) {}
+ EmitOp() : Location::EmitOperator(A32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kA32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -4095) && (offset <= 4095));
uint32_t U = (offset >= 0);
int32_t target = abs(offset) | (U << 12);
@@ -5309,21 +5353,22 @@ void Assembler::ldr(Condition cond,
} immop;
EmitA32(
Link(0x051f0000U | (cond.GetCondition() << 28) | (rt.GetCode() << 12),
- label,
- immop));
+ location,
+ immop,
+ &kLdrA1Info));
return;
}
}
- Delegate(kLdr, &Assembler::ldr, cond, size, rt, label);
+ Delegate(kLdr, &Assembler::ldr, cond, size, rt, location);
}
bool Assembler::ldr_info(Condition cond,
EncodingSize size,
Register rt,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info) {
- VIXL_ASSERT(!label->IsBound());
- USE(label);
+ VIXL_ASSERT(!location->IsBound());
+ USE(location);
if (IsUsingT32()) {
// LDR{<c>}{<q>} <Rt>, <label> ; T1
if (!size.IsWide() && rt.IsLow() && size.IsNarrow()) {
@@ -5525,48 +5570,53 @@ void Assembler::ldrb(Condition cond,
Delegate(kLdrb, &Assembler::ldrb, cond, size, rt, operand);
}
-void Assembler::ldrb(Condition cond, Register rt, Label* label) {
+void Assembler::ldrb(Condition cond, Register rt, Location* location) {
VIXL_ASSERT(AllowAssembler());
CheckIT(cond);
- Label::Offset offset =
- label->IsBound()
- ? label->GetLocation() -
+ Location::Offset offset =
+ location->IsBound()
+ ? location->GetLocation() -
AlignDown(GetCursorOffset() + GetArchitectureStatePCOffset(), 4)
: 0;
if (IsUsingT32()) {
// LDRB{<c>}{<q>} <Rt>, <label> ; T1
- if (((label->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
- !label->IsBound()) &&
+ if (((location->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
+ !location->IsBound()) &&
!rt.Is(pc)) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-4095, 4095) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -4095) && (offset <= 4095));
uint32_t U = (offset >= 0);
int32_t target = abs(offset) | (U << 12);
return instr | (target & 0xfff) | ((target & 0x1000) << 11);
}
} immop;
- EmitT32_32(Link(0xf81f0000U | (rt.GetCode() << 12), label, immop));
+ EmitT32_32(Link(0xf81f0000U | (rt.GetCode() << 12),
+ location,
+ immop,
+ &kLdrbT1Info));
AdvanceIT();
return;
}
} else {
// LDRB{<c>}{<q>} <Rt>, <label> ; A1
- if (((label->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
- !label->IsBound()) &&
+ if (((location->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
+ !location->IsBound()) &&
cond.IsNotNever() && (!rt.IsPC() || AllowUnpredictable())) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-4095, 4095) {}
+ EmitOp() : Location::EmitOperator(A32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kA32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -4095) && (offset <= 4095));
uint32_t U = (offset >= 0);
int32_t target = abs(offset) | (U << 12);
@@ -5575,20 +5625,21 @@ void Assembler::ldrb(Condition cond, Register rt, Label* label) {
} immop;
EmitA32(
Link(0x055f0000U | (cond.GetCondition() << 28) | (rt.GetCode() << 12),
- label,
- immop));
+ location,
+ immop,
+ &kLdrbA1Info));
return;
}
}
- Delegate(kLdrb, &Assembler::ldrb, cond, rt, label);
+ Delegate(kLdrb, &Assembler::ldrb, cond, rt, location);
}
bool Assembler::ldrb_info(Condition cond,
Register rt,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info) {
- VIXL_ASSERT(!label->IsBound());
- USE(label);
+ VIXL_ASSERT(!location->IsBound());
+ USE(location);
if (IsUsingT32()) {
// LDRB{<c>}{<q>} <Rt>, <label> ; T1
if (!rt.Is(pc)) {
@@ -5757,27 +5808,31 @@ void Assembler::ldrd(Condition cond,
Delegate(kLdrd, &Assembler::ldrd, cond, rt, rt2, operand);
}
-void Assembler::ldrd(Condition cond, Register rt, Register rt2, Label* label) {
+void Assembler::ldrd(Condition cond,
+ Register rt,
+ Register rt2,
+ Location* location) {
VIXL_ASSERT(AllowAssembler());
CheckIT(cond);
- Label::Offset offset =
- label->IsBound()
- ? label->GetLocation() -
+ Location::Offset offset =
+ location->IsBound()
+ ? location->GetLocation() -
AlignDown(GetCursorOffset() + GetArchitectureStatePCOffset(), 4)
: 0;
if (IsUsingT32()) {
// LDRD{<c>}{<q>} <Rt>, <Rt2>, <label> ; T1
- if (((label->IsBound() && (offset >= -1020) && (offset <= 1020) &&
+ if (((location->IsBound() && (offset >= -1020) && (offset <= 1020) &&
((offset & 0x3) == 0)) ||
- !label->IsBound()) &&
+ !location->IsBound()) &&
((!rt.IsPC() && !rt2.IsPC()) || AllowUnpredictable())) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-1020, 1020) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -1020) && (offset <= 1020) &&
((offset & 0x3) == 0));
int32_t target = offset >> 2;
@@ -5787,25 +5842,27 @@ void Assembler::ldrd(Condition cond, Register rt, Register rt2, Label* label) {
}
} immop;
EmitT32_32(Link(0xe95f0000U | (rt.GetCode() << 12) | (rt2.GetCode() << 8),
- label,
- immop));
+ location,
+ immop,
+ &kLdrdT1Info));
AdvanceIT();
return;
}
} else {
// LDRD{<c>}{<q>} <Rt>, <Rt2>, <label> ; A1
if ((((rt.GetCode() + 1) % kNumberOfRegisters) == rt2.GetCode()) &&
- ((label->IsBound() && (offset >= -255) && (offset <= 255)) ||
- !label->IsBound()) &&
+ ((location->IsBound() && (offset >= -255) && (offset <= 255)) ||
+ !location->IsBound()) &&
cond.IsNotNever() &&
((((rt.GetCode() & 1) == 0) && !rt2.IsPC()) || AllowUnpredictable())) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-255, 255) {}
+ EmitOp() : Location::EmitOperator(A32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kA32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -255) && (offset <= 255));
uint32_t U = (offset >= 0);
int32_t target = abs(offset) | (U << 8);
@@ -5815,21 +5872,22 @@ void Assembler::ldrd(Condition cond, Register rt, Register rt2, Label* label) {
} immop;
EmitA32(
Link(0x014f00d0U | (cond.GetCondition() << 28) | (rt.GetCode() << 12),
- label,
- immop));
+ location,
+ immop,
+ &kLdrdA1Info));
return;
}
}
- Delegate(kLdrd, &Assembler::ldrd, cond, rt, rt2, label);
+ Delegate(kLdrd, &Assembler::ldrd, cond, rt, rt2, location);
}
bool Assembler::ldrd_info(Condition cond,
Register rt,
Register rt2,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info) {
- VIXL_ASSERT(!label->IsBound());
- USE(label);
+ VIXL_ASSERT(!location->IsBound());
+ USE(location);
if (IsUsingT32()) {
// LDRD{<c>}{<q>} <Rt>, <Rt2>, <label> ; T1
if (true) {
@@ -6136,48 +6194,53 @@ void Assembler::ldrh(Condition cond,
Delegate(kLdrh, &Assembler::ldrh, cond, size, rt, operand);
}
-void Assembler::ldrh(Condition cond, Register rt, Label* label) {
+void Assembler::ldrh(Condition cond, Register rt, Location* location) {
VIXL_ASSERT(AllowAssembler());
CheckIT(cond);
- Label::Offset offset =
- label->IsBound()
- ? label->GetLocation() -
+ Location::Offset offset =
+ location->IsBound()
+ ? location->GetLocation() -
AlignDown(GetCursorOffset() + GetArchitectureStatePCOffset(), 4)
: 0;
if (IsUsingT32()) {
// LDRH{<c>}{<q>} <Rt>, <label> ; T1
- if (((label->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
- !label->IsBound()) &&
+ if (((location->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
+ !location->IsBound()) &&
!rt.Is(pc)) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-4095, 4095) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -4095) && (offset <= 4095));
uint32_t U = (offset >= 0);
int32_t target = abs(offset) | (U << 12);
return instr | (target & 0xfff) | ((target & 0x1000) << 11);
}
} immop;
- EmitT32_32(Link(0xf83f0000U | (rt.GetCode() << 12), label, immop));
+ EmitT32_32(Link(0xf83f0000U | (rt.GetCode() << 12),
+ location,
+ immop,
+ &kLdrhT1Info));
AdvanceIT();
return;
}
} else {
// LDRH{<c>}{<q>} <Rt>, <label> ; A1
- if (((label->IsBound() && (offset >= -255) && (offset <= 255)) ||
- !label->IsBound()) &&
+ if (((location->IsBound() && (offset >= -255) && (offset <= 255)) ||
+ !location->IsBound()) &&
cond.IsNotNever() && (!rt.IsPC() || AllowUnpredictable())) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-255, 255) {}
+ EmitOp() : Location::EmitOperator(A32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kA32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -255) && (offset <= 255));
uint32_t U = (offset >= 0);
int32_t target = abs(offset) | (U << 8);
@@ -6187,20 +6250,21 @@ void Assembler::ldrh(Condition cond, Register rt, Label* label) {
} immop;
EmitA32(
Link(0x015f00b0U | (cond.GetCondition() << 28) | (rt.GetCode() << 12),
- label,
- immop));
+ location,
+ immop,
+ &kLdrhA1Info));
return;
}
}
- Delegate(kLdrh, &Assembler::ldrh, cond, rt, label);
+ Delegate(kLdrh, &Assembler::ldrh, cond, rt, location);
}
bool Assembler::ldrh_info(Condition cond,
Register rt,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info) {
- VIXL_ASSERT(!label->IsBound());
- USE(label);
+ VIXL_ASSERT(!location->IsBound());
+ USE(location);
if (IsUsingT32()) {
// LDRH{<c>}{<q>} <Rt>, <label> ; T1
if (!rt.Is(pc)) {
@@ -6383,48 +6447,53 @@ void Assembler::ldrsb(Condition cond,
Delegate(kLdrsb, &Assembler::ldrsb, cond, size, rt, operand);
}
-void Assembler::ldrsb(Condition cond, Register rt, Label* label) {
+void Assembler::ldrsb(Condition cond, Register rt, Location* location) {
VIXL_ASSERT(AllowAssembler());
CheckIT(cond);
- Label::Offset offset =
- label->IsBound()
- ? label->GetLocation() -
+ Location::Offset offset =
+ location->IsBound()
+ ? location->GetLocation() -
AlignDown(GetCursorOffset() + GetArchitectureStatePCOffset(), 4)
: 0;
if (IsUsingT32()) {
// LDRSB{<c>}{<q>} <Rt>, <label> ; T1
- if (((label->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
- !label->IsBound()) &&
+ if (((location->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
+ !location->IsBound()) &&
!rt.Is(pc)) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-4095, 4095) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -4095) && (offset <= 4095));
uint32_t U = (offset >= 0);
int32_t target = abs(offset) | (U << 12);
return instr | (target & 0xfff) | ((target & 0x1000) << 11);
}
} immop;
- EmitT32_32(Link(0xf91f0000U | (rt.GetCode() << 12), label, immop));
+ EmitT32_32(Link(0xf91f0000U | (rt.GetCode() << 12),
+ location,
+ immop,
+ &kLdrsbT1Info));
AdvanceIT();
return;
}
} else {
// LDRSB{<c>}{<q>} <Rt>, <label> ; A1
- if (((label->IsBound() && (offset >= -255) && (offset <= 255)) ||
- !label->IsBound()) &&
+ if (((location->IsBound() && (offset >= -255) && (offset <= 255)) ||
+ !location->IsBound()) &&
cond.IsNotNever() && (!rt.IsPC() || AllowUnpredictable())) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-255, 255) {}
+ EmitOp() : Location::EmitOperator(A32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kA32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -255) && (offset <= 255));
uint32_t U = (offset >= 0);
int32_t target = abs(offset) | (U << 8);
@@ -6434,20 +6503,21 @@ void Assembler::ldrsb(Condition cond, Register rt, Label* label) {
} immop;
EmitA32(
Link(0x015f00d0U | (cond.GetCondition() << 28) | (rt.GetCode() << 12),
- label,
- immop));
+ location,
+ immop,
+ &kLdrsbA1Info));
return;
}
}
- Delegate(kLdrsb, &Assembler::ldrsb, cond, rt, label);
+ Delegate(kLdrsb, &Assembler::ldrsb, cond, rt, location);
}
bool Assembler::ldrsb_info(Condition cond,
Register rt,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info) {
- VIXL_ASSERT(!label->IsBound());
- USE(label);
+ VIXL_ASSERT(!location->IsBound());
+ USE(location);
if (IsUsingT32()) {
// LDRSB{<c>}{<q>} <Rt>, <label> ; T1
if (!rt.Is(pc)) {
@@ -6630,48 +6700,53 @@ void Assembler::ldrsh(Condition cond,
Delegate(kLdrsh, &Assembler::ldrsh, cond, size, rt, operand);
}
-void Assembler::ldrsh(Condition cond, Register rt, Label* label) {
+void Assembler::ldrsh(Condition cond, Register rt, Location* location) {
VIXL_ASSERT(AllowAssembler());
CheckIT(cond);
- Label::Offset offset =
- label->IsBound()
- ? label->GetLocation() -
+ Location::Offset offset =
+ location->IsBound()
+ ? location->GetLocation() -
AlignDown(GetCursorOffset() + GetArchitectureStatePCOffset(), 4)
: 0;
if (IsUsingT32()) {
// LDRSH{<c>}{<q>} <Rt>, <label> ; T1
- if (((label->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
- !label->IsBound()) &&
+ if (((location->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
+ !location->IsBound()) &&
!rt.Is(pc)) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-4095, 4095) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -4095) && (offset <= 4095));
uint32_t U = (offset >= 0);
int32_t target = abs(offset) | (U << 12);
return instr | (target & 0xfff) | ((target & 0x1000) << 11);
}
} immop;
- EmitT32_32(Link(0xf93f0000U | (rt.GetCode() << 12), label, immop));
+ EmitT32_32(Link(0xf93f0000U | (rt.GetCode() << 12),
+ location,
+ immop,
+ &kLdrshT1Info));
AdvanceIT();
return;
}
} else {
// LDRSH{<c>}{<q>} <Rt>, <label> ; A1
- if (((label->IsBound() && (offset >= -255) && (offset <= 255)) ||
- !label->IsBound()) &&
+ if (((location->IsBound() && (offset >= -255) && (offset <= 255)) ||
+ !location->IsBound()) &&
cond.IsNotNever() && (!rt.IsPC() || AllowUnpredictable())) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-255, 255) {}
+ EmitOp() : Location::EmitOperator(A32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kA32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -255) && (offset <= 255));
uint32_t U = (offset >= 0);
int32_t target = abs(offset) | (U << 8);
@@ -6681,20 +6756,21 @@ void Assembler::ldrsh(Condition cond, Register rt, Label* label) {
} immop;
EmitA32(
Link(0x015f00f0U | (cond.GetCondition() << 28) | (rt.GetCode() << 12),
- label,
- immop));
+ location,
+ immop,
+ &kLdrshA1Info));
return;
}
}
- Delegate(kLdrsh, &Assembler::ldrsh, cond, rt, label);
+ Delegate(kLdrsh, &Assembler::ldrsh, cond, rt, location);
}
bool Assembler::ldrsh_info(Condition cond,
Register rt,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info) {
- VIXL_ASSERT(!label->IsBound());
- USE(label);
+ VIXL_ASSERT(!location->IsBound());
+ USE(location);
if (IsUsingT32()) {
// LDRSH{<c>}{<q>} <Rt>, <label> ; T1
if (!rt.Is(pc)) {
@@ -8029,66 +8105,70 @@ void Assembler::pkhtb(Condition cond,
Delegate(kPkhtb, &Assembler::pkhtb, cond, rd, rn, operand);
}
-void Assembler::pld(Condition cond, Label* label) {
+void Assembler::pld(Condition cond, Location* location) {
VIXL_ASSERT(AllowAssembler());
CheckIT(cond);
- Label::Offset offset =
- label->IsBound()
- ? label->GetLocation() -
+ Location::Offset offset =
+ location->IsBound()
+ ? location->GetLocation() -
AlignDown(GetCursorOffset() + GetArchitectureStatePCOffset(), 4)
: 0;
if (IsUsingT32()) {
// PLD{<c>}{<q>} <label> ; T1
- if (((label->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
- !label->IsBound())) {
- static class EmitOp : public Label::LabelEmitOperator {
+ if (((location->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
+ !location->IsBound())) {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-4095, 4095) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -4095) && (offset <= 4095));
uint32_t U = (offset >= 0);
int32_t target = abs(offset) | (U << 12);
return instr | (target & 0xfff) | ((target & 0x1000) << 11);
}
} immop;
- EmitT32_32(Link(0xf81ff000U, label, immop));
+ EmitT32_32(Link(0xf81ff000U, location, immop, &kPldT1Info));
AdvanceIT();
return;
}
} else {
// PLD{<c>}{<q>} <label> ; A1
- if (((label->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
- !label->IsBound())) {
+ if (((location->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
+ !location->IsBound())) {
if (cond.Is(al)) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-4095, 4095) {}
+ EmitOp() : Location::EmitOperator(A32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const
+ VIXL_OVERRIDE {
+ pc += kA32PcDelta;
+ Location::Offset offset =
+ location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -4095) && (offset <= 4095));
uint32_t U = (offset >= 0);
int32_t target = abs(offset) | (U << 12);
return instr | (target & 0xfff) | ((target & 0x1000) << 11);
}
} immop;
- EmitA32(Link(0xf55ff000U, label, immop));
+ EmitA32(Link(0xf55ff000U, location, immop, &kPldA1Info));
return;
}
}
}
- Delegate(kPld, &Assembler::pld, cond, label);
+ Delegate(kPld, &Assembler::pld, cond, location);
}
bool Assembler::pld_info(Condition cond,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info) {
- VIXL_ASSERT(!label->IsBound());
- USE(label);
+ VIXL_ASSERT(!location->IsBound());
+ USE(location);
USE(cond);
if (IsUsingT32()) {
// PLD{<c>}{<q>} <label> ; T1
@@ -8389,66 +8469,70 @@ void Assembler::pli(Condition cond, const MemOperand& operand) {
Delegate(kPli, &Assembler::pli, cond, operand);
}
-void Assembler::pli(Condition cond, Label* label) {
+void Assembler::pli(Condition cond, Location* location) {
VIXL_ASSERT(AllowAssembler());
CheckIT(cond);
- Label::Offset offset =
- label->IsBound()
- ? label->GetLocation() -
+ Location::Offset offset =
+ location->IsBound()
+ ? location->GetLocation() -
AlignDown(GetCursorOffset() + GetArchitectureStatePCOffset(), 4)
: 0;
if (IsUsingT32()) {
// PLI{<c>}{<q>} <label> ; T3
- if (((label->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
- !label->IsBound())) {
- static class EmitOp : public Label::LabelEmitOperator {
+ if (((location->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
+ !location->IsBound())) {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-4095, 4095) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -4095) && (offset <= 4095));
uint32_t U = (offset >= 0);
int32_t target = abs(offset) | (U << 12);
return instr | (target & 0xfff) | ((target & 0x1000) << 11);
}
} immop;
- EmitT32_32(Link(0xf91ff000U, label, immop));
+ EmitT32_32(Link(0xf91ff000U, location, immop, &kPliT3Info));
AdvanceIT();
return;
}
} else {
// PLI{<c>}{<q>} <label> ; A1
- if (((label->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
- !label->IsBound())) {
+ if (((location->IsBound() && (offset >= -4095) && (offset <= 4095)) ||
+ !location->IsBound())) {
if (cond.Is(al)) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-4095, 4095) {}
+ EmitOp() : Location::EmitOperator(A32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const
+ VIXL_OVERRIDE {
+ pc += kA32PcDelta;
+ Location::Offset offset =
+ location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -4095) && (offset <= 4095));
uint32_t U = (offset >= 0);
int32_t target = abs(offset) | (U << 12);
return instr | (target & 0xfff) | ((target & 0x1000) << 11);
}
} immop;
- EmitA32(Link(0xf45ff000U, label, immop));
+ EmitA32(Link(0xf45ff000U, location, immop, &kPliA1Info));
return;
}
}
}
- Delegate(kPli, &Assembler::pli, cond, label);
+ Delegate(kPli, &Assembler::pli, cond, location);
}
bool Assembler::pli_info(Condition cond,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info) {
- VIXL_ASSERT(!label->IsBound());
- USE(label);
+ VIXL_ASSERT(!location->IsBound());
+ USE(location);
USE(cond);
if (IsUsingT32()) {
// PLI{<c>}{<q>} <label> ; T3
@@ -19553,27 +19637,31 @@ void Assembler::vldmia(Condition cond,
Delegate(kVldmia, &Assembler::vldmia, cond, dt, rn, write_back, sreglist);
}
-void Assembler::vldr(Condition cond, DataType dt, DRegister rd, Label* label) {
+void Assembler::vldr(Condition cond,
+ DataType dt,
+ DRegister rd,
+ Location* location) {
VIXL_ASSERT(AllowAssembler());
CheckIT(cond);
- Label::Offset offset =
- label->IsBound()
- ? label->GetLocation() -
+ Location::Offset offset =
+ location->IsBound()
+ ? location->GetLocation() -
AlignDown(GetCursorOffset() + GetArchitectureStatePCOffset(), 4)
: 0;
if (IsUsingT32()) {
// VLDR{<c>}{<q>}{.64} <Dd>, <label> ; T1
if (dt.IsNoneOr(Untyped64) &&
- ((label->IsBound() && (offset >= -1020) && (offset <= 1020) &&
+ ((location->IsBound() && (offset >= -1020) && (offset <= 1020) &&
((offset & 0x3) == 0)) ||
- !label->IsBound())) {
- static class EmitOp : public Label::LabelEmitOperator {
+ !location->IsBound())) {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-1020, 1020) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -1020) && (offset <= 1020) &&
((offset & 0x3) == 0));
int32_t target = offset >> 2;
@@ -19582,24 +19670,26 @@ void Assembler::vldr(Condition cond, DataType dt, DRegister rd, Label* label) {
return instr | (target & 0xff) | ((target & 0x100) << 15);
}
} immop;
- EmitT32_32(Link(0xed1f0b00U | rd.Encode(22, 12), label, immop));
+ EmitT32_32(
+ Link(0xed1f0b00U | rd.Encode(22, 12), location, immop, &kVldrT1Info));
AdvanceIT();
return;
}
} else {
// VLDR{<c>}{<q>}{.64} <Dd>, <label> ; A1
if (dt.IsNoneOr(Untyped64) &&
- ((label->IsBound() && (offset >= -1020) && (offset <= 1020) &&
+ ((location->IsBound() && (offset >= -1020) && (offset <= 1020) &&
((offset & 0x3) == 0)) ||
- !label->IsBound()) &&
+ !location->IsBound()) &&
cond.IsNotNever()) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-1020, 1020) {}
+ EmitOp() : Location::EmitOperator(A32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kA32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -1020) && (offset <= 1020) &&
((offset & 0x3) == 0));
int32_t target = offset >> 2;
@@ -19610,21 +19700,22 @@ void Assembler::vldr(Condition cond, DataType dt, DRegister rd, Label* label) {
} immop;
EmitA32(
Link(0x0d1f0b00U | (cond.GetCondition() << 28) | rd.Encode(22, 12),
- label,
- immop));
+ location,
+ immop,
+ &kVldrA1Info));
return;
}
}
- Delegate(kVldr, &Assembler::vldr, cond, dt, rd, label);
+ Delegate(kVldr, &Assembler::vldr, cond, dt, rd, location);
}
bool Assembler::vldr_info(Condition cond,
DataType dt,
DRegister rd,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info) {
- VIXL_ASSERT(!label->IsBound());
- USE(label);
+ VIXL_ASSERT(!location->IsBound());
+ USE(location);
USE(rd);
if (IsUsingT32()) {
// VLDR{<c>}{<q>}{.64} <Dd>, <label> ; T1
@@ -19698,27 +19789,31 @@ void Assembler::vldr(Condition cond,
Delegate(kVldr, &Assembler::vldr, cond, dt, rd, operand);
}
-void Assembler::vldr(Condition cond, DataType dt, SRegister rd, Label* label) {
+void Assembler::vldr(Condition cond,
+ DataType dt,
+ SRegister rd,
+ Location* location) {
VIXL_ASSERT(AllowAssembler());
CheckIT(cond);
- Label::Offset offset =
- label->IsBound()
- ? label->GetLocation() -
+ Location::Offset offset =
+ location->IsBound()
+ ? location->GetLocation() -
AlignDown(GetCursorOffset() + GetArchitectureStatePCOffset(), 4)
: 0;
if (IsUsingT32()) {
// VLDR{<c>}{<q>}{.32} <Sd>, <label> ; T2
if (dt.IsNoneOr(Untyped32) &&
- ((label->IsBound() && (offset >= -1020) && (offset <= 1020) &&
+ ((location->IsBound() && (offset >= -1020) && (offset <= 1020) &&
((offset & 0x3) == 0)) ||
- !label->IsBound())) {
- static class EmitOp : public Label::LabelEmitOperator {
+ !location->IsBound())) {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-1020, 1020) {}
+ EmitOp() : Location::EmitOperator(T32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kT32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -1020) && (offset <= 1020) &&
((offset & 0x3) == 0));
int32_t target = offset >> 2;
@@ -19727,24 +19822,26 @@ void Assembler::vldr(Condition cond, DataType dt, SRegister rd, Label* label) {
return instr | (target & 0xff) | ((target & 0x100) << 15);
}
} immop;
- EmitT32_32(Link(0xed1f0a00U | rd.Encode(22, 12), label, immop));
+ EmitT32_32(
+ Link(0xed1f0a00U | rd.Encode(22, 12), location, immop, &kVldrT2Info));
AdvanceIT();
return;
}
} else {
// VLDR{<c>}{<q>}{.32} <Sd>, <label> ; A2
if (dt.IsNoneOr(Untyped32) &&
- ((label->IsBound() && (offset >= -1020) && (offset <= 1020) &&
+ ((location->IsBound() && (offset >= -1020) && (offset <= 1020) &&
((offset & 0x3) == 0)) ||
- !label->IsBound()) &&
+ !location->IsBound()) &&
cond.IsNotNever()) {
- static class EmitOp : public Label::LabelEmitOperator {
+ static class EmitOp : public Location::EmitOperator {
public:
- EmitOp() : Label::LabelEmitOperator(-1020, 1020) {}
+ EmitOp() : Location::EmitOperator(A32) {}
virtual uint32_t Encode(uint32_t instr,
- Label::Offset pc,
- const Label* label) const VIXL_OVERRIDE {
- Label::Offset offset = label->GetLocation() - AlignDown(pc, 4);
+ Location::Offset pc,
+ const Location* location) const VIXL_OVERRIDE {
+ pc += kA32PcDelta;
+ Location::Offset offset = location->GetLocation() - AlignDown(pc, 4);
VIXL_ASSERT((offset >= -1020) && (offset <= 1020) &&
((offset & 0x3) == 0));
int32_t target = offset >> 2;
@@ -19755,21 +19852,22 @@ void Assembler::vldr(Condition cond, DataType dt, SRegister rd, Label* label) {
} immop;
EmitA32(
Link(0x0d1f0a00U | (cond.GetCondition() << 28) | rd.Encode(22, 12),
- label,
- immop));
+ location,
+ immop,
+ &kVldrA2Info));
return;
}
}
- Delegate(kVldr, &Assembler::vldr, cond, dt, rd, label);
+ Delegate(kVldr, &Assembler::vldr, cond, dt, rd, location);
}
bool Assembler::vldr_info(Condition cond,
DataType dt,
SRegister rd,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info) {
- VIXL_ASSERT(!label->IsBound());
- USE(label);
+ VIXL_ASSERT(!location->IsBound());
+ USE(location);
USE(rd);
if (IsUsingT32()) {
// VLDR{<c>}{<q>}{.32} <Sd>, <label> ; T2
diff --git a/src/aarch32/assembler-aarch32.h b/src/aarch32/assembler-aarch32.h
index d349ef03..5488bb84 100644
--- a/src/aarch32/assembler-aarch32.h
+++ b/src/aarch32/assembler-aarch32.h
@@ -43,6 +43,9 @@ class Assembler : public internal::AssemblerBase {
bool allow_unpredictable_;
bool allow_strongly_discouraged_;
+ public:
+ struct ReferenceInfo;
+
protected:
void EmitT32_16(uint16_t instr);
void EmitT32_32(uint32_t instr);
@@ -61,13 +64,15 @@ class Assembler : public internal::AssemblerBase {
#endif
void AdvanceIT() { it_mask_ = (it_mask_ << 1) & 0xf; }
void BindHelper(Label* label);
+ void BindLocationHelper(Location* location);
void PlaceHelper(RawLiteral* literal) {
- BindHelper(literal);
+ BindLocationHelper(literal);
GetBuffer()->EmitData(literal->GetDataAddress(), literal->GetSize());
}
uint32_t Link(uint32_t instr,
- Label* label,
- const Label::LabelEmitOperator& op);
+ Location* location,
+ const Location::EmitOperator& op,
+ const ReferenceInfo* info);
public:
class AllowUnpredictableScope {
@@ -208,7 +213,8 @@ class Assembler : public internal::AssemblerBase {
return buffer_.GetOffsetFrom(label->GetLocation());
}
- void EncodeLabelFor(const Label::ForwardReference& forward, Label* label);
+ void EncodeLocationFor(const Location::ForwardReference& forward,
+ Location* location);
// Helpers for it instruction.
void it(Condition cond) { it(cond, 0x8); }
@@ -245,10 +251,10 @@ class Assembler : public internal::AssemblerBase {
typedef void (Assembler::*InstructionCondSizeRL)(Condition cond,
EncodingSize size,
Register rd,
- Label* label);
+ Location* location);
typedef void (Assembler::*InstructionCondSizeL)(Condition cond,
EncodingSize size,
- Label* label);
+ Location* location);
typedef void (Assembler::*InstructionCondRII)(Condition cond,
Register rd,
uint32_t lsb,
@@ -256,9 +262,10 @@ class Assembler : public internal::AssemblerBase {
typedef void (Assembler::*InstructionCondRRII)(
Condition cond, Register rd, Register rn, uint32_t lsb, uint32_t width);
typedef void (Assembler::*InstructionCondI)(Condition cond, uint32_t imm);
- typedef void (Assembler::*InstructionCondL)(Condition cond, Label* label);
+ typedef void (Assembler::*InstructionCondL)(Condition cond,
+ Location* location);
typedef void (Assembler::*InstructionCondR)(Condition cond, Register rm);
- typedef void (Assembler::*InstructionRL)(Register rn, Label* label);
+ typedef void (Assembler::*InstructionRL)(Register rn, Location* location);
typedef void (Assembler::*InstructionCond)(Condition cond);
typedef void (Assembler::*InstructionCondRR)(Condition cond,
Register rd,
@@ -299,11 +306,11 @@ class Assembler : public internal::AssemblerBase {
const MemOperand& operand);
typedef void (Assembler::*InstructionCondRL)(Condition cond,
Register rt,
- Label* label);
+ Location* location);
typedef void (Assembler::*InstructionCondRRL)(Condition cond,
Register rt,
Register rt2,
- Label* label);
+ Location* location);
typedef void (Assembler::*InstructionCondRRRR)(
Condition cond, Register rd, Register rn, Register rm, Register ra);
typedef void (Assembler::*InstructionCondRSr)(Condition cond,
@@ -488,7 +495,7 @@ class Assembler : public internal::AssemblerBase {
typedef void (Assembler::*InstructionCondDtDL)(Condition cond,
DataType dt,
DRegister rd,
- Label* label);
+ Location* location);
typedef void (Assembler::*InstructionCondDtDMop)(Condition cond,
DataType dt,
DRegister rd,
@@ -496,7 +503,7 @@ class Assembler : public internal::AssemblerBase {
typedef void (Assembler::*InstructionCondDtSL)(Condition cond,
DataType dt,
SRegister rd,
- Label* label);
+ Location* location);
typedef void (Assembler::*InstructionCondDtSMop)(Condition cond,
DataType dt,
SRegister rd,
@@ -665,7 +672,7 @@ class Assembler : public internal::AssemblerBase {
Condition /*cond*/,
EncodingSize /*size*/,
Register /*rd*/,
- Label* /*label*/) {
+ Location* /*location*/) {
USE(type);
VIXL_ASSERT((type == kAdr) || (type == kLdr));
UnimplementedDelegate(type);
@@ -674,7 +681,7 @@ class Assembler : public internal::AssemblerBase {
InstructionCondSizeL /*instruction*/,
Condition /*cond*/,
EncodingSize /*size*/,
- Label* /*label*/) {
+ Location* /*location*/) {
USE(type);
VIXL_ASSERT((type == kB));
UnimplementedDelegate(type);
@@ -712,7 +719,7 @@ class Assembler : public internal::AssemblerBase {
virtual void Delegate(InstructionType type,
InstructionCondL /*instruction*/,
Condition /*cond*/,
- Label* /*label*/) {
+ Location* /*location*/) {
USE(type);
VIXL_ASSERT((type == kBl) || (type == kBlx) || (type == kPld) ||
(type == kPli));
@@ -729,7 +736,7 @@ class Assembler : public internal::AssemblerBase {
virtual void Delegate(InstructionType type,
InstructionRL /*instruction*/,
Register /*rn*/,
- Label* /*label*/) {
+ Location* /*location*/) {
USE(type);
VIXL_ASSERT((type == kCbnz) || (type == kCbz));
UnimplementedDelegate(type);
@@ -882,7 +889,7 @@ class Assembler : public internal::AssemblerBase {
InstructionCondRL /*instruction*/,
Condition /*cond*/,
Register /*rt*/,
- Label* /*label*/) {
+ Location* /*location*/) {
USE(type);
VIXL_ASSERT((type == kLdrb) || (type == kLdrh) || (type == kLdrsb) ||
(type == kLdrsh));
@@ -893,7 +900,7 @@ class Assembler : public internal::AssemblerBase {
Condition /*cond*/,
Register /*rt*/,
Register /*rt2*/,
- Label* /*label*/) {
+ Location* /*location*/) {
USE(type);
VIXL_ASSERT((type == kLdrd));
UnimplementedDelegate(type);
@@ -1516,7 +1523,7 @@ class Assembler : public internal::AssemblerBase {
Condition /*cond*/,
DataType /*dt*/,
DRegister /*rd*/,
- Label* /*label*/) {
+ Location* /*location*/) {
USE(type);
VIXL_ASSERT((type == kVldr));
UnimplementedDelegate(type);
@@ -1536,7 +1543,7 @@ class Assembler : public internal::AssemblerBase {
Condition /*cond*/,
DataType /*dt*/,
SRegister /*rd*/,
- Label* /*label*/) {
+ Location* /*location*/) {
USE(type);
VIXL_ASSERT((type == kVldr));
UnimplementedDelegate(type);
@@ -1916,18 +1923,18 @@ class Assembler : public internal::AssemblerBase {
addw(al, rd, rn, operand);
}
- void adr(Condition cond, EncodingSize size, Register rd, Label* label);
+ void adr(Condition cond, EncodingSize size, Register rd, Location* location);
bool adr_info(Condition cond,
EncodingSize size,
Register rd,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info);
- void adr(Register rd, Label* label) { adr(al, Best, rd, label); }
- void adr(Condition cond, Register rd, Label* label) {
- adr(cond, Best, rd, label);
+ void adr(Register rd, Location* location) { adr(al, Best, rd, location); }
+ void adr(Condition cond, Register rd, Location* location) {
+ adr(cond, Best, rd, location);
}
- void adr(EncodingSize size, Register rd, Label* label) {
- adr(al, size, rd, label);
+ void adr(EncodingSize size, Register rd, Location* location) {
+ adr(al, size, rd, location);
}
void and_(Condition cond,
@@ -2002,14 +2009,14 @@ class Assembler : public internal::AssemblerBase {
asrs(al, size, rd, rm, operand);
}
- void b(Condition cond, EncodingSize size, Label* label);
+ void b(Condition cond, EncodingSize size, Location* location);
bool b_info(Condition cond,
EncodingSize size,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info);
- void b(Label* label) { b(al, Best, label); }
- void b(Condition cond, Label* label) { b(cond, Best, label); }
- void b(EncodingSize size, Label* label) { b(al, size, label); }
+ void b(Location* location) { b(al, Best, location); }
+ void b(Condition cond, Location* location) { b(cond, Best, location); }
+ void b(EncodingSize size, Location* location) { b(al, size, location); }
void bfc(Condition cond, Register rd, uint32_t lsb, uint32_t width);
void bfc(Register rd, uint32_t lsb, uint32_t width) {
@@ -2061,15 +2068,17 @@ class Assembler : public internal::AssemblerBase {
void bkpt(Condition cond, uint32_t imm);
void bkpt(uint32_t imm) { bkpt(al, imm); }
- void bl(Condition cond, Label* label);
- bool bl_info(Condition cond, Label* label, const struct ReferenceInfo** info);
- void bl(Label* label) { bl(al, label); }
+ void bl(Condition cond, Location* location);
+ bool bl_info(Condition cond,
+ Location* location,
+ const struct ReferenceInfo** info);
+ void bl(Location* location) { bl(al, location); }
- void blx(Condition cond, Label* label);
+ void blx(Condition cond, Location* location);
bool blx_info(Condition cond,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info);
- void blx(Label* label) { blx(al, label); }
+ void blx(Location* location) { blx(al, location); }
void blx(Condition cond, Register rm);
void blx(Register rm) { blx(al, rm); }
@@ -2080,11 +2089,15 @@ class Assembler : public internal::AssemblerBase {
void bxj(Condition cond, Register rm);
void bxj(Register rm) { bxj(al, rm); }
- void cbnz(Register rn, Label* label);
- bool cbnz_info(Register rn, Label* label, const struct ReferenceInfo** info);
+ void cbnz(Register rn, Location* location);
+ bool cbnz_info(Register rn,
+ Location* location,
+ const struct ReferenceInfo** info);
- void cbz(Register rn, Label* label);
- bool cbz_info(Register rn, Label* label, const struct ReferenceInfo** info);
+ void cbz(Register rn, Location* location);
+ bool cbz_info(Register rn,
+ Location* location,
+ const struct ReferenceInfo** info);
void clrex(Condition cond);
void clrex() { clrex(al); }
@@ -2359,18 +2372,18 @@ class Assembler : public internal::AssemblerBase {
ldr(al, size, rt, operand);
}
- void ldr(Condition cond, EncodingSize size, Register rt, Label* label);
+ void ldr(Condition cond, EncodingSize size, Register rt, Location* location);
bool ldr_info(Condition cond,
EncodingSize size,
Register rt,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info);
- void ldr(Register rt, Label* label) { ldr(al, Best, rt, label); }
- void ldr(Condition cond, Register rt, Label* label) {
- ldr(cond, Best, rt, label);
+ void ldr(Register rt, Location* location) { ldr(al, Best, rt, location); }
+ void ldr(Condition cond, Register rt, Location* location) {
+ ldr(cond, Best, rt, location);
}
- void ldr(EncodingSize size, Register rt, Label* label) {
- ldr(al, size, rt, label);
+ void ldr(EncodingSize size, Register rt, Location* location) {
+ ldr(al, size, rt, location);
}
void ldrb(Condition cond,
@@ -2387,12 +2400,12 @@ class Assembler : public internal::AssemblerBase {
ldrb(al, size, rt, operand);
}
- void ldrb(Condition cond, Register rt, Label* label);
+ void ldrb(Condition cond, Register rt, Location* location);
bool ldrb_info(Condition cond,
Register rt,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info);
- void ldrb(Register rt, Label* label) { ldrb(al, rt, label); }
+ void ldrb(Register rt, Location* location) { ldrb(al, rt, location); }
void ldrd(Condition cond,
Register rt,
@@ -2402,14 +2415,14 @@ class Assembler : public internal::AssemblerBase {
ldrd(al, rt, rt2, operand);
}
- void ldrd(Condition cond, Register rt, Register rt2, Label* label);
+ void ldrd(Condition cond, Register rt, Register rt2, Location* location);
bool ldrd_info(Condition cond,
Register rt,
Register rt2,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info);
- void ldrd(Register rt, Register rt2, Label* label) {
- ldrd(al, rt, rt2, label);
+ void ldrd(Register rt, Register rt2, Location* location) {
+ ldrd(al, rt, rt2, location);
}
void ldrex(Condition cond, Register rt, const MemOperand& operand);
@@ -2447,12 +2460,12 @@ class Assembler : public internal::AssemblerBase {
ldrh(al, size, rt, operand);
}
- void ldrh(Condition cond, Register rt, Label* label);
+ void ldrh(Condition cond, Register rt, Location* location);
bool ldrh_info(Condition cond,
Register rt,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info);
- void ldrh(Register rt, Label* label) { ldrh(al, rt, label); }
+ void ldrh(Register rt, Location* location) { ldrh(al, rt, location); }
void ldrsb(Condition cond,
EncodingSize size,
@@ -2468,12 +2481,12 @@ class Assembler : public internal::AssemblerBase {
ldrsb(al, size, rt, operand);
}
- void ldrsb(Condition cond, Register rt, Label* label);
+ void ldrsb(Condition cond, Register rt, Location* location);
bool ldrsb_info(Condition cond,
Register rt,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info);
- void ldrsb(Register rt, Label* label) { ldrsb(al, rt, label); }
+ void ldrsb(Register rt, Location* location) { ldrsb(al, rt, location); }
void ldrsh(Condition cond,
EncodingSize size,
@@ -2489,12 +2502,12 @@ class Assembler : public internal::AssemblerBase {
ldrsh(al, size, rt, operand);
}
- void ldrsh(Condition cond, Register rt, Label* label);
+ void ldrsh(Condition cond, Register rt, Location* location);
bool ldrsh_info(Condition cond,
Register rt,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info);
- void ldrsh(Register rt, Label* label) { ldrsh(al, rt, label); }
+ void ldrsh(Register rt, Location* location) { ldrsh(al, rt, location); }
void lsl(Condition cond,
EncodingSize size,
@@ -2725,11 +2738,11 @@ class Assembler : public internal::AssemblerBase {
pkhtb(al, rd, rn, operand);
}
- void pld(Condition cond, Label* label);
+ void pld(Condition cond, Location* location);
bool pld_info(Condition cond,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info);
- void pld(Label* label) { pld(al, label); }
+ void pld(Location* location) { pld(al, location); }
void pld(Condition cond, const MemOperand& operand);
void pld(const MemOperand& operand) { pld(al, operand); }
@@ -2740,11 +2753,11 @@ class Assembler : public internal::AssemblerBase {
void pli(Condition cond, const MemOperand& operand);
void pli(const MemOperand& operand) { pli(al, operand); }
- void pli(Condition cond, Label* label);
+ void pli(Condition cond, Location* location);
bool pli_info(Condition cond,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info);
- void pli(Label* label) { pli(al, label); }
+ void pli(Location* location) { pli(al, location); }
void pop(Condition cond, EncodingSize size, RegisterList registers);
void pop(RegisterList registers) { pop(al, Best, registers); }
@@ -4665,18 +4678,20 @@ class Assembler : public internal::AssemblerBase {
vldmia(cond, kDataTypeValueNone, rn, write_back, sreglist);
}
- void vldr(Condition cond, DataType dt, DRegister rd, Label* label);
+ void vldr(Condition cond, DataType dt, DRegister rd, Location* location);
bool vldr_info(Condition cond,
DataType dt,
DRegister rd,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info);
- void vldr(DataType dt, DRegister rd, Label* label) {
- vldr(al, dt, rd, label);
+ void vldr(DataType dt, DRegister rd, Location* location) {
+ vldr(al, dt, rd, location);
+ }
+ void vldr(DRegister rd, Location* location) {
+ vldr(al, Untyped64, rd, location);
}
- void vldr(DRegister rd, Label* label) { vldr(al, Untyped64, rd, label); }
- void vldr(Condition cond, DRegister rd, Label* label) {
- vldr(cond, Untyped64, rd, label);
+ void vldr(Condition cond, DRegister rd, Location* location) {
+ vldr(cond, Untyped64, rd, location);
}
void vldr(Condition cond,
@@ -4693,18 +4708,20 @@ class Assembler : public internal::AssemblerBase {
vldr(cond, Untyped64, rd, operand);
}
- void vldr(Condition cond, DataType dt, SRegister rd, Label* label);
+ void vldr(Condition cond, DataType dt, SRegister rd, Location* location);
bool vldr_info(Condition cond,
DataType dt,
SRegister rd,
- Label* label,
+ Location* location,
const struct ReferenceInfo** info);
- void vldr(DataType dt, SRegister rd, Label* label) {
- vldr(al, dt, rd, label);
+ void vldr(DataType dt, SRegister rd, Location* location) {
+ vldr(al, dt, rd, location);
+ }
+ void vldr(SRegister rd, Location* location) {
+ vldr(al, Untyped32, rd, location);
}
- void vldr(SRegister rd, Label* label) { vldr(al, Untyped32, rd, label); }
- void vldr(Condition cond, SRegister rd, Label* label) {
- vldr(cond, Untyped32, rd, label);
+ void vldr(Condition cond, SRegister rd, Location* location) {
+ vldr(cond, Untyped32, rd, location);
}
void vldr(Condition cond,
diff --git a/src/aarch32/disasm-aarch32.cc b/src/aarch32/disasm-aarch32.cc
index c06597fa..96f65014 100644
--- a/src/aarch32/disasm-aarch32.cc
+++ b/src/aarch32/disasm-aarch32.cc
@@ -1196,10 +1196,11 @@ void Disassembler::addw(Condition cond,
void Disassembler::adr(Condition cond,
EncodingSize size,
Register rd,
- Label* label) {
+ Location* location) {
os().SetCurrentInstruction(kAdr, kAddress);
os() << ToCString(kAdr) << ConditionPrinter(it_block_, cond) << size << " "
- << rd << ", " << PrintLabel(kAnyLocation, label, GetCodeAddress() & ~3);
+ << rd << ", "
+ << PrintLabel(kAnyLocation, location, GetCodeAddress() & ~3);
}
void Disassembler::and_(Condition cond,
@@ -1258,10 +1259,10 @@ void Disassembler::asrs(Condition cond,
os() << rm << ", " << operand;
}
-void Disassembler::b(Condition cond, EncodingSize size, Label* label) {
+void Disassembler::b(Condition cond, EncodingSize size, Location* location) {
os().SetCurrentInstruction(kB, kAddress | kBranch);
os() << ToCString(kB) << ConditionPrinter(it_block_, cond) << size << " "
- << PrintLabel(kCodeLocation, label, GetCodeAddress());
+ << PrintLabel(kCodeLocation, location, GetCodeAddress());
}
void Disassembler::bfc(Condition cond,
@@ -1317,16 +1318,16 @@ void Disassembler::bkpt(Condition cond, uint32_t imm) {
os() << ToCString(kBkpt) << ConditionPrinter(it_block_, cond) << " " << imm;
}
-void Disassembler::bl(Condition cond, Label* label) {
+void Disassembler::bl(Condition cond, Location* location) {
os().SetCurrentInstruction(kBl, kAddress | kBranch);
os() << ToCString(kBl) << ConditionPrinter(it_block_, cond) << " "
- << PrintLabel(kCodeLocation, label, GetCodeAddress());
+ << PrintLabel(kCodeLocation, location, GetCodeAddress());
}
-void Disassembler::blx(Condition cond, Label* label) {
+void Disassembler::blx(Condition cond, Location* location) {
os().SetCurrentInstruction(kBlx, kAddress | kBranch);
os() << ToCString(kBlx) << ConditionPrinter(it_block_, cond) << " "
- << PrintLabel(kCodeLocation, label, GetCodeAddress() & ~3);
+ << PrintLabel(kCodeLocation, location, GetCodeAddress() & ~3);
}
void Disassembler::blx(Condition cond, Register rm) {
@@ -1344,16 +1345,16 @@ void Disassembler::bxj(Condition cond, Register rm) {
os() << ToCString(kBxj) << ConditionPrinter(it_block_, cond) << " " << rm;
}
-void Disassembler::cbnz(Register rn, Label* label) {
+void Disassembler::cbnz(Register rn, Location* location) {
os().SetCurrentInstruction(kCbnz, kAddress | kBranch);
os() << ToCString(kCbnz) << " " << rn << ", "
- << PrintLabel(kCodeLocation, label, GetCodeAddress());
+ << PrintLabel(kCodeLocation, location, GetCodeAddress());
}
-void Disassembler::cbz(Register rn, Label* label) {
+void Disassembler::cbz(Register rn, Location* location) {
os().SetCurrentInstruction(kCbz, kAddress | kBranch);
os() << ToCString(kCbz) << " " << rn << ", "
- << PrintLabel(kCodeLocation, label, GetCodeAddress());
+ << PrintLabel(kCodeLocation, location, GetCodeAddress());
}
void Disassembler::clrex(Condition cond) {
@@ -1701,11 +1702,11 @@ void Disassembler::ldr(Condition cond,
void Disassembler::ldr(Condition cond,
EncodingSize size,
Register rt,
- Label* label) {
+ Location* location) {
os().SetCurrentInstruction(kLdr, kAddress | kLoadStore);
os() << ToCString(kLdr) << ConditionPrinter(it_block_, cond) << size << " "
<< rt << ", "
- << PrintLabel(kLoadWordLocation, label, GetCodeAddress() & ~3);
+ << PrintLabel(kLoadWordLocation, location, GetCodeAddress() & ~3);
}
void Disassembler::ldrb(Condition cond,
@@ -1717,10 +1718,11 @@ void Disassembler::ldrb(Condition cond,
<< rt << ", " << PrintMemOperand(kLoadByteLocation, operand);
}
-void Disassembler::ldrb(Condition cond, Register rt, Label* label) {
+void Disassembler::ldrb(Condition cond, Register rt, Location* location) {
os().SetCurrentInstruction(kLdrb, kAddress | kLoadStore);
os() << ToCString(kLdrb) << ConditionPrinter(it_block_, cond) << " " << rt
- << ", " << PrintLabel(kLoadByteLocation, label, GetCodeAddress() & ~3);
+ << ", "
+ << PrintLabel(kLoadByteLocation, location, GetCodeAddress() & ~3);
}
void Disassembler::ldrd(Condition cond,
@@ -1736,11 +1738,11 @@ void Disassembler::ldrd(Condition cond,
void Disassembler::ldrd(Condition cond,
Register rt,
Register rt2,
- Label* label) {
+ Location* location) {
os().SetCurrentInstruction(kLdrd, kAddress | kLoadStore);
os() << ToCString(kLdrd) << ConditionPrinter(it_block_, cond) << " " << rt
<< ", " << rt2 << ", "
- << PrintLabel(kLoadDoubleWordLocation, label, GetCodeAddress() & ~3);
+ << PrintLabel(kLoadDoubleWordLocation, location, GetCodeAddress() & ~3);
}
void Disassembler::ldrex(Condition cond,
@@ -1786,11 +1788,11 @@ void Disassembler::ldrh(Condition cond,
<< rt << ", " << PrintMemOperand(kLoadHalfWordLocation, operand);
}
-void Disassembler::ldrh(Condition cond, Register rt, Label* label) {
+void Disassembler::ldrh(Condition cond, Register rt, Location* location) {
os().SetCurrentInstruction(kLdrh, kAddress | kLoadStore);
os() << ToCString(kLdrh) << ConditionPrinter(it_block_, cond) << " " << rt
<< ", "
- << PrintLabel(kLoadHalfWordLocation, label, GetCodeAddress() & ~3);
+ << PrintLabel(kLoadHalfWordLocation, location, GetCodeAddress() & ~3);
}
void Disassembler::ldrsb(Condition cond,
@@ -1802,11 +1804,11 @@ void Disassembler::ldrsb(Condition cond,
<< rt << ", " << PrintMemOperand(kLoadSignedByteLocation, operand);
}
-void Disassembler::ldrsb(Condition cond, Register rt, Label* label) {
+void Disassembler::ldrsb(Condition cond, Register rt, Location* location) {
os().SetCurrentInstruction(kLdrsb, kAddress | kLoadStore);
os() << ToCString(kLdrsb) << ConditionPrinter(it_block_, cond) << " " << rt
<< ", "
- << PrintLabel(kLoadSignedByteLocation, label, GetCodeAddress() & ~3);
+ << PrintLabel(kLoadSignedByteLocation, location, GetCodeAddress() & ~3);
}
void Disassembler::ldrsh(Condition cond,
@@ -1818,11 +1820,12 @@ void Disassembler::ldrsh(Condition cond,
<< rt << ", " << PrintMemOperand(kLoadSignedHalfWordLocation, operand);
}
-void Disassembler::ldrsh(Condition cond, Register rt, Label* label) {
+void Disassembler::ldrsh(Condition cond, Register rt, Location* location) {
os().SetCurrentInstruction(kLdrsh, kAddress | kLoadStore);
os() << ToCString(kLdrsh) << ConditionPrinter(it_block_, cond) << " " << rt
- << ", "
- << PrintLabel(kLoadSignedHalfWordLocation, label, GetCodeAddress() & ~3);
+ << ", " << PrintLabel(kLoadSignedHalfWordLocation,
+ location,
+ GetCodeAddress() & ~3);
}
void Disassembler::lsl(Condition cond,
@@ -2062,10 +2065,10 @@ void Disassembler::pkhtb(Condition cond,
os() << rn << ", " << operand;
}
-void Disassembler::pld(Condition cond, Label* label) {
+void Disassembler::pld(Condition cond, Location* location) {
os().SetCurrentInstruction(kPld, kAddress);
os() << ToCString(kPld) << ConditionPrinter(it_block_, cond) << " "
- << PrintLabel(kDataLocation, label, GetCodeAddress() & ~3);
+ << PrintLabel(kDataLocation, location, GetCodeAddress() & ~3);
}
void Disassembler::pld(Condition cond, const MemOperand& operand) {
@@ -2086,10 +2089,10 @@ void Disassembler::pli(Condition cond, const MemOperand& operand) {
<< PrintMemOperand(kCodeLocation, operand);
}
-void Disassembler::pli(Condition cond, Label* label) {
+void Disassembler::pli(Condition cond, Location* location) {
os().SetCurrentInstruction(kPli, kAddress);
os() << ToCString(kPli) << ConditionPrinter(it_block_, cond) << " "
- << PrintLabel(kCodeLocation, label, GetCodeAddress() & ~3);
+ << PrintLabel(kCodeLocation, location, GetCodeAddress() & ~3);
}
void Disassembler::pop(Condition cond,
@@ -5002,11 +5005,11 @@ void Disassembler::vldmia(Condition cond,
void Disassembler::vldr(Condition cond,
DataType dt,
DRegister rd,
- Label* label) {
+ Location* location) {
os().SetCurrentInstruction(kVldr, kFpNeon);
os() << ToCString(kVldr) << ConditionPrinter(it_block_, cond) << dt << " "
<< rd << ", " << PrintLabel(kLoadDoublePrecisionLocation,
- label,
+ location,
GetCodeAddress() & ~3);
}
@@ -5022,11 +5025,11 @@ void Disassembler::vldr(Condition cond,
void Disassembler::vldr(Condition cond,
DataType dt,
SRegister rd,
- Label* label) {
+ Location* location) {
os().SetCurrentInstruction(kVldr, kFpNeon);
os() << ToCString(kVldr) << ConditionPrinter(it_block_, cond) << dt << " "
<< rd << ", " << PrintLabel(kLoadSinglePrecisionLocation,
- label,
+ location,
GetCodeAddress() & ~3);
}
@@ -7767,9 +7770,9 @@ void Disassembler::DecodeT32(uint32_t instr) {
// 0x48000000
unsigned rt = (instr >> 24) & 0x7;
int32_t imm = ((instr >> 16) & 0xff) << 2;
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
// LDR{<c>}{<q>} <Rt>, <label> ; T1
- ldr(CurrentCond(), Best, Register(rt), &label);
+ ldr(CurrentCond(), Best, Register(rt), &location);
break;
}
case 0x10000000: {
@@ -8012,9 +8015,9 @@ void Disassembler::DecodeT32(uint32_t instr) {
// 0xa0000000
unsigned rd = (instr >> 24) & 0x7;
int32_t imm = ((instr >> 16) & 0xff) << 2;
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
// ADR{<c>}{<q>} <Rd>, <label> ; T1
- adr(CurrentCond(), Best, Register(rd), &label);
+ adr(CurrentCond(), Best, Register(rd), &location);
break;
}
case 0x08000000: {
@@ -8100,9 +8103,9 @@ void Disassembler::DecodeT32(uint32_t instr) {
unsigned rn = (instr >> 16) & 0x7;
int32_t imm =
(((instr >> 19) & 0x1f) | ((instr >> 20) & 0x20)) << 1;
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
// CBZ{<q>} <Rn>, <label> ; T1
- cbz(Register(rn), &label);
+ cbz(Register(rn), &location);
break;
}
}
@@ -8206,9 +8209,9 @@ void Disassembler::DecodeT32(uint32_t instr) {
unsigned rn = (instr >> 16) & 0x7;
int32_t imm =
(((instr >> 19) & 0x1f) | ((instr >> 20) & 0x20)) << 1;
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
// CBNZ{<q>} <Rn>, <label> ; T1
- cbnz(Register(rn), &label);
+ cbnz(Register(rn), &location);
break;
}
}
@@ -8374,9 +8377,9 @@ void Disassembler::DecodeT32(uint32_t instr) {
}
Condition condition((instr >> 24) & 0xf);
int32_t imm = SignExtend<int32_t>((instr >> 16) & 0xff, 8) << 1;
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
// B<c>{<q>} <label> ; T1
- b(condition, Best, &label);
+ b(condition, Best, &location);
break;
}
}
@@ -8394,9 +8397,9 @@ void Disassembler::DecodeT32(uint32_t instr) {
case 0x00000000: {
// 0xe0000000
int32_t imm = SignExtend<int32_t>((instr >> 16) & 0x7ff, 11) << 1;
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
// B{<c>}{<q>} <label> ; T2
- b(CurrentCond(), Best, &label);
+ b(CurrentCond(), Best, &location);
break;
}
case 0x10000000: {
@@ -9075,16 +9078,22 @@ void Disassembler::DecodeT32(uint32_t instr) {
int32_t imm = (instr & 0xff) |
((instr >> 4) & 0x700) |
((instr >> 15) & 0x800);
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
if ((imm >= 0) && (imm <= 4095) &&
((rd < kNumberOfT32LowRegisters) &&
(imm >= 0) && (imm <= 1020) &&
((imm & 3) == 0))) {
// ADR{<c>}.W <Rd>, <label> ; T3
- adr(CurrentCond(), Wide, Register(rd), &label);
+ adr(CurrentCond(),
+ Wide,
+ Register(rd),
+ &location);
} else {
// ADR{<c>}{<q>} <Rd>, <label> ; T3
- adr(CurrentCond(), Best, Register(rd), &label);
+ adr(CurrentCond(),
+ Best,
+ Register(rd),
+ &location);
}
break;
}
@@ -9186,9 +9195,9 @@ void Disassembler::DecodeT32(uint32_t instr) {
int32_t imm = (instr & 0xff) |
((instr >> 4) & 0x700) |
((instr >> 15) & 0x800);
- Label label(-imm, kT32PcDelta);
+ Location location(-imm, kT32PcDelta);
// ADR{<c>}{<q>} <Rd>, <label> ; T2
- adr(CurrentCond(), Best, Register(rd), &label);
+ adr(CurrentCond(), Best, Register(rd), &location);
break;
}
}
@@ -9791,18 +9800,18 @@ void Disassembler::DecodeT32(uint32_t instr) {
((instr >> 7) & 0x80000),
20)
<< 1;
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
if (OutsideITBlock() && (imm >= -1048576) &&
(imm <= 1048574) && ((imm & 1) == 0) &&
((imm >= -256) && (imm <= 254) &&
((imm & 1) == 0))) {
// B<c>.W <label> ; T3
- b(condition, Wide, &label);
+ b(condition, Wide, &location);
} else {
VIXL_ASSERT(OutsideITBlock() && (imm >= -1048576) &&
(imm <= 1048574) && ((imm & 1) == 0));
// B<c>{<q>} <label> ; T3
- b(condition, Best, &label);
+ b(condition, Best, &location);
}
break;
}
@@ -9818,19 +9827,19 @@ void Disassembler::DecodeT32(uint32_t instr) {
uint32_t S = encoded_imm & (1 << 23);
encoded_imm ^= ((S >> 1) | (S >> 2)) ^ (3 << 21);
int32_t imm = SignExtend<int32_t>(encoded_imm << 1, 25);
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
if ((imm >= -16777216) && (imm <= 16777214) &&
((imm & 1) == 0) &&
(OutsideITBlockOrLast() && (imm >= -2048) &&
(imm <= 2046) && ((imm & 1) == 0))) {
// B{<c>}.W <label> ; T4
- b(CurrentCond(), Wide, &label);
+ b(CurrentCond(), Wide, &location);
} else {
VIXL_ASSERT(OutsideITBlockOrLast() &&
(imm >= -16777216) && (imm <= 16777214) &&
((imm & 1) == 0));
// B{<c>}{<q>} <label> ; T4
- b(CurrentCond(), Best, &label);
+ b(CurrentCond(), Best, &location);
}
break;
}
@@ -9845,9 +9854,9 @@ void Disassembler::DecodeT32(uint32_t instr) {
uint32_t S = encoded_imm & (1 << 22);
encoded_imm ^= ((S >> 1) | (S >> 2)) ^ (3 << 20);
int32_t imm = SignExtend<int32_t>(encoded_imm << 2, 25);
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
// BLX{<c>}{<q>} <label> ; T2
- blx(CurrentCond(), &label);
+ blx(CurrentCond(), &location);
} else {
UnallocatedT32(instr);
}
@@ -9862,9 +9871,9 @@ void Disassembler::DecodeT32(uint32_t instr) {
uint32_t S = encoded_imm & (1 << 23);
encoded_imm ^= ((S >> 1) | (S >> 2)) ^ (3 << 21);
int32_t imm = SignExtend<int32_t>(encoded_imm << 1, 25);
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
// BL{<c>}{<q>} <label> ; T1
- bl(CurrentCond(), &label);
+ bl(CurrentCond(), &location);
break;
}
}
@@ -10545,7 +10554,7 @@ void Disassembler::DecodeT32(uint32_t instr) {
imm <<= 2;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
// LDRD{<c>}{<q>} <Rt>, <Rt2>, <label> ; T1
if (minus_zero) {
ldrd(CurrentCond(),
@@ -10556,7 +10565,7 @@ void Disassembler::DecodeT32(uint32_t instr) {
ldrd(CurrentCond(),
Register(rt),
Register(rt2),
- &label);
+ &location);
}
if (((instr & 0xff7f0000) != 0xe95f0000)) {
UnpredictableT32(instr);
@@ -10603,7 +10612,7 @@ void Disassembler::DecodeT32(uint32_t instr) {
imm <<= 2;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
// LDRD{<c>}{<q>} <Rt>, <Rt2>, <label> ; T1
if (minus_zero) {
ldrd(CurrentCond(),
@@ -10614,7 +10623,7 @@ void Disassembler::DecodeT32(uint32_t instr) {
ldrd(CurrentCond(),
Register(rt),
Register(rt2),
- &label);
+ &location);
}
if (((instr & 0xff7f0000) != 0xe95f0000)) {
UnpredictableT32(instr);
@@ -10661,7 +10670,7 @@ void Disassembler::DecodeT32(uint32_t instr) {
imm <<= 2;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
// LDRD{<c>}{<q>} <Rt>, <Rt2>, <label> ; T1
if (minus_zero) {
ldrd(CurrentCond(),
@@ -10672,7 +10681,7 @@ void Disassembler::DecodeT32(uint32_t instr) {
ldrd(CurrentCond(),
Register(rt),
Register(rt2),
- &label);
+ &location);
}
if (((instr & 0xff7f0000) != 0xe95f0000)) {
UnpredictableT32(instr);
@@ -16800,12 +16809,12 @@ void Disassembler::DecodeT32(uint32_t instr) {
int32_t imm = instr & 0xfff;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
// PLD{<c>}{<q>} <label> ; T1
if (minus_zero) {
pld(CurrentCond(), MemOperand(pc, minus, 0));
} else {
- pld(CurrentCond(), &label);
+ pld(CurrentCond(), &location);
}
if (((instr & 0xff7ff000) != 0xf81ff000)) {
UnpredictableT32(instr);
@@ -16825,7 +16834,7 @@ void Disassembler::DecodeT32(uint32_t instr) {
int32_t imm = instr & 0xfff;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
// LDRB{<c>}{<q>} <Rt>, <label> ; T1
if (minus_zero) {
ldrb(CurrentCond(),
@@ -16833,7 +16842,9 @@ void Disassembler::DecodeT32(uint32_t instr) {
Register(rt),
MemOperand(pc, minus, 0));
} else {
- ldrb(CurrentCond(), Register(rt), &label);
+ ldrb(CurrentCond(),
+ Register(rt),
+ &location);
}
break;
}
@@ -16848,7 +16859,7 @@ void Disassembler::DecodeT32(uint32_t instr) {
int32_t imm = instr & 0xfff;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
// LDRH{<c>}{<q>} <Rt>, <label> ; T1
if (minus_zero) {
ldrh(CurrentCond(),
@@ -16856,7 +16867,9 @@ void Disassembler::DecodeT32(uint32_t instr) {
Register(rt),
MemOperand(pc, minus, 0));
} else {
- ldrh(CurrentCond(), Register(rt), &label);
+ ldrh(CurrentCond(),
+ Register(rt),
+ &location);
}
break;
}
@@ -17364,7 +17377,7 @@ void Disassembler::DecodeT32(uint32_t instr) {
int32_t imm = instr & 0xfff;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
if ((imm >= -4095) && (imm <= 4095) &&
((rt < kNumberOfT32LowRegisters) &&
(imm >= 0) && (imm <= 1020) &&
@@ -17379,7 +17392,7 @@ void Disassembler::DecodeT32(uint32_t instr) {
ldr(CurrentCond(),
Wide,
Register(rt),
- &label);
+ &location);
}
} else {
// LDR{<c>}{<q>} <Rt>, <label> ; T2
@@ -17392,7 +17405,7 @@ void Disassembler::DecodeT32(uint32_t instr) {
ldr(CurrentCond(),
Best,
Register(rt),
- &label);
+ &location);
}
}
break;
@@ -17614,13 +17627,13 @@ void Disassembler::DecodeT32(uint32_t instr) {
int32_t imm = instr & 0xfff;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
// PLI{<c>}{<q>} <label> ; T3
if (minus_zero) {
pli(CurrentCond(),
MemOperand(pc, minus, 0));
} else {
- pli(CurrentCond(), &label);
+ pli(CurrentCond(), &location);
}
break;
}
@@ -17634,7 +17647,7 @@ void Disassembler::DecodeT32(uint32_t instr) {
int32_t imm = instr & 0xfff;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
// LDRSB{<c>}{<q>} <Rt>, <label> ; T1
if (minus_zero) {
ldrsb(CurrentCond(),
@@ -17642,7 +17655,9 @@ void Disassembler::DecodeT32(uint32_t instr) {
Register(rt),
MemOperand(pc, minus, 0));
} else {
- ldrsb(CurrentCond(), Register(rt), &label);
+ ldrsb(CurrentCond(),
+ Register(rt),
+ &location);
}
break;
}
@@ -17910,7 +17925,7 @@ void Disassembler::DecodeT32(uint32_t instr) {
int32_t imm = instr & 0xfff;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
// LDRSH{<c>}{<q>} <Rt>, <label> ; T1
if (minus_zero) {
ldrsh(CurrentCond(),
@@ -17918,7 +17933,7 @@ void Disassembler::DecodeT32(uint32_t instr) {
Register(rt),
MemOperand(pc, minus, 0));
} else {
- ldrsh(CurrentCond(), Register(rt), &label);
+ ldrsh(CurrentCond(), Register(rt), &location);
}
break;
}
@@ -23067,7 +23082,7 @@ void Disassembler::DecodeT32(uint32_t instr) {
imm <<= 2;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
// VLDR{<c>}{<q>}{.32} <Sd>, <label> ; T2
if (minus_zero) {
vldr(CurrentCond(),
@@ -23078,7 +23093,7 @@ void Disassembler::DecodeT32(uint32_t instr) {
vldr(CurrentCond(),
kDataTypeValueNone,
SRegister(rd),
- &label);
+ &location);
}
break;
}
@@ -23090,7 +23105,7 @@ void Disassembler::DecodeT32(uint32_t instr) {
imm <<= 2;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kT32PcDelta);
+ Location location(imm, kT32PcDelta);
// VLDR{<c>}{<q>}{.64} <Dd>, <label> ; T1
if (minus_zero) {
vldr(CurrentCond(),
@@ -23101,7 +23116,7 @@ void Disassembler::DecodeT32(uint32_t instr) {
vldr(CurrentCond(),
kDataTypeValueNone,
DRegister(rd),
- &label);
+ &location);
}
break;
}
@@ -52277,12 +52292,12 @@ void Disassembler::DecodeA32(uint32_t instr) {
int32_t imm = instr & 0xfff;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// PLI{<c>}{<q>} <label> ; A1
if (minus_zero) {
pli(al, MemOperand(pc, minus, 0));
} else {
- pli(al, &label);
+ pli(al, &location);
}
if (((instr & 0xff7ff000) != 0xf45ff000)) {
UnpredictableA32(instr);
@@ -55254,12 +55269,12 @@ void Disassembler::DecodeA32(uint32_t instr) {
int32_t imm = instr & 0xfff;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// PLD{<c>}{<q>} <label> ; A1
if (minus_zero) {
pld(al, MemOperand(pc, minus, 0));
} else {
- pld(al, &label);
+ pld(al, &location);
}
if (((instr & 0xff7ff000) != 0xf55ff000)) {
UnpredictableA32(instr);
@@ -55583,9 +55598,9 @@ void Disassembler::DecodeA32(uint32_t instr) {
((instr << 1) & 0x1fffffe),
25)
<< 1;
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// BLX{<c>}{<q>} <label> ; A2
- blx(al, &label);
+ blx(al, &location);
break;
}
case 0x0c000000: {
@@ -58805,7 +58820,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
int32_t imm = (instr & 0xf) | ((instr >> 4) & 0xf0);
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// LDRD{<c>}{<q>} <Rt>, <Rt2>, <label> ; A1
if (minus_zero) {
ldrd(condition,
@@ -58816,7 +58831,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
ldrd(condition,
Register(rt),
Register(rt + 1),
- &label);
+ &location);
}
if (((instr & 0xf7f00f0) != 0x14f00d0)) {
UnpredictableA32(instr);
@@ -60952,7 +60967,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
int32_t imm = (instr & 0xf) | ((instr >> 4) & 0xf0);
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// LDRH{<c>}{<q>} <Rt>, <label> ; A1
if (minus_zero) {
ldrh(condition,
@@ -60960,7 +60975,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
Register(rt),
MemOperand(pc, minus, 0));
} else {
- ldrh(condition, Register(rt), &label);
+ ldrh(condition, Register(rt), &location);
}
if (((instr & 0xf7f00f0) != 0x15f00b0)) {
UnpredictableA32(instr);
@@ -61018,7 +61033,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
int32_t imm = (instr & 0xf) | ((instr >> 4) & 0xf0);
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// LDRH{<c>}{<q>} <Rt>, <label> ; A1
if (minus_zero) {
ldrh(condition,
@@ -61026,7 +61041,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
Register(rt),
MemOperand(pc, minus, 0));
} else {
- ldrh(condition, Register(rt), &label);
+ ldrh(condition, Register(rt), &location);
}
if (((instr & 0xf7f00f0) != 0x15f00b0)) {
UnpredictableA32(instr);
@@ -61075,7 +61090,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
int32_t imm = (instr & 0xf) | ((instr >> 4) & 0xf0);
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// LDRH{<c>}{<q>} <Rt>, <label> ; A1
if (minus_zero) {
ldrh(condition,
@@ -61083,7 +61098,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
Register(rt),
MemOperand(pc, minus, 0));
} else {
- ldrh(condition, Register(rt), &label);
+ ldrh(condition, Register(rt), &location);
}
if (((instr & 0xf7f00f0) != 0x15f00b0)) {
UnpredictableA32(instr);
@@ -61138,7 +61153,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
int32_t imm = (instr & 0xf) | ((instr >> 4) & 0xf0);
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// LDRSB{<c>}{<q>} <Rt>, <label> ; A1
if (minus_zero) {
ldrsb(condition,
@@ -61146,7 +61161,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
Register(rt),
MemOperand(pc, minus, 0));
} else {
- ldrsb(condition, Register(rt), &label);
+ ldrsb(condition, Register(rt), &location);
}
if (((instr & 0xf7f00f0) != 0x15f00d0)) {
UnpredictableA32(instr);
@@ -61204,7 +61219,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
int32_t imm = (instr & 0xf) | ((instr >> 4) & 0xf0);
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// LDRSB{<c>}{<q>} <Rt>, <label> ; A1
if (minus_zero) {
ldrsb(condition,
@@ -61212,7 +61227,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
Register(rt),
MemOperand(pc, minus, 0));
} else {
- ldrsb(condition, Register(rt), &label);
+ ldrsb(condition, Register(rt), &location);
}
if (((instr & 0xf7f00f0) != 0x15f00d0)) {
UnpredictableA32(instr);
@@ -61261,7 +61276,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
int32_t imm = (instr & 0xf) | ((instr >> 4) & 0xf0);
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// LDRSB{<c>}{<q>} <Rt>, <label> ; A1
if (minus_zero) {
ldrsb(condition,
@@ -61269,7 +61284,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
Register(rt),
MemOperand(pc, minus, 0));
} else {
- ldrsb(condition, Register(rt), &label);
+ ldrsb(condition, Register(rt), &location);
}
if (((instr & 0xf7f00f0) != 0x15f00d0)) {
UnpredictableA32(instr);
@@ -61324,7 +61339,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
int32_t imm = (instr & 0xf) | ((instr >> 4) & 0xf0);
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// LDRSH{<c>}{<q>} <Rt>, <label> ; A1
if (minus_zero) {
ldrsh(condition,
@@ -61332,7 +61347,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
Register(rt),
MemOperand(pc, minus, 0));
} else {
- ldrsh(condition, Register(rt), &label);
+ ldrsh(condition, Register(rt), &location);
}
if (((instr & 0xf7f00f0) != 0x15f00f0)) {
UnpredictableA32(instr);
@@ -61390,7 +61405,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
int32_t imm = (instr & 0xf) | ((instr >> 4) & 0xf0);
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// LDRSH{<c>}{<q>} <Rt>, <label> ; A1
if (minus_zero) {
ldrsh(condition,
@@ -61398,7 +61413,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
Register(rt),
MemOperand(pc, minus, 0));
} else {
- ldrsh(condition, Register(rt), &label);
+ ldrsh(condition, Register(rt), &location);
}
if (((instr & 0xf7f00f0) != 0x15f00f0)) {
UnpredictableA32(instr);
@@ -61447,7 +61462,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
int32_t imm = (instr & 0xf) | ((instr >> 4) & 0xf0);
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// LDRSH{<c>}{<q>} <Rt>, <label> ; A1
if (minus_zero) {
ldrsh(condition,
@@ -61455,7 +61470,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
Register(rt),
MemOperand(pc, minus, 0));
} else {
- ldrsh(condition, Register(rt), &label);
+ ldrsh(condition, Register(rt), &location);
}
if (((instr & 0xf7f00f0) != 0x15f00f0)) {
UnpredictableA32(instr);
@@ -61557,9 +61572,9 @@ void Disassembler::DecodeA32(uint32_t instr) {
Condition condition((instr >> 28) & 0xf);
unsigned rd = (instr >> 12) & 0xf;
uint32_t imm = ImmediateA32::Decode(instr & 0xfff);
- Label label(-imm, kA32PcDelta);
+ Location location(-imm, kA32PcDelta);
// ADR{<c>}{<q>} <Rd>, <label> ; A2
- adr(condition, Best, Register(rd), &label);
+ adr(condition, Best, Register(rd), &location);
break;
}
}
@@ -61737,9 +61752,9 @@ void Disassembler::DecodeA32(uint32_t instr) {
Condition condition((instr >> 28) & 0xf);
unsigned rd = (instr >> 12) & 0xf;
uint32_t imm = ImmediateA32::Decode(instr & 0xfff);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// ADR{<c>}{<q>} <Rd>, <label> ; A1
- adr(condition, Best, Register(rd), &label);
+ adr(condition, Best, Register(rd), &location);
break;
}
}
@@ -62375,7 +62390,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
int32_t imm = instr & 0xfff;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// LDR{<c>}{<q>} <Rt>, <label> ; A1
if (minus_zero) {
ldr(condition,
@@ -62383,7 +62398,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
Register(rt),
MemOperand(pc, minus, 0));
} else {
- ldr(condition, Best, Register(rt), &label);
+ ldr(condition, Best, Register(rt), &location);
}
if (((instr & 0xf7f0000) != 0x51f0000)) {
UnpredictableA32(instr);
@@ -62448,7 +62463,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
int32_t imm = instr & 0xfff;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// LDR{<c>}{<q>} <Rt>, <label> ; A1
if (minus_zero) {
ldr(condition,
@@ -62456,7 +62471,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
Register(rt),
MemOperand(pc, minus, 0));
} else {
- ldr(condition, Best, Register(rt), &label);
+ ldr(condition, Best, Register(rt), &location);
}
if (((instr & 0xf7f0000) != 0x51f0000)) {
UnpredictableA32(instr);
@@ -62500,7 +62515,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
int32_t imm = instr & 0xfff;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// LDR{<c>}{<q>} <Rt>, <label> ; A1
if (minus_zero) {
ldr(condition,
@@ -62508,7 +62523,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
Register(rt),
MemOperand(pc, minus, 0));
} else {
- ldr(condition, Best, Register(rt), &label);
+ ldr(condition, Best, Register(rt), &location);
}
if (((instr & 0xf7f0000) != 0x51f0000)) {
UnpredictableA32(instr);
@@ -62627,7 +62642,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
int32_t imm = instr & 0xfff;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// LDRB{<c>}{<q>} <Rt>, <label> ; A1
if (minus_zero) {
ldrb(condition,
@@ -62635,7 +62650,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
Register(rt),
MemOperand(pc, minus, 0));
} else {
- ldrb(condition, Register(rt), &label);
+ ldrb(condition, Register(rt), &location);
}
if (((instr & 0xf7f0000) != 0x55f0000)) {
UnpredictableA32(instr);
@@ -62688,7 +62703,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
int32_t imm = instr & 0xfff;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// LDRB{<c>}{<q>} <Rt>, <label> ; A1
if (minus_zero) {
ldrb(condition,
@@ -62696,7 +62711,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
Register(rt),
MemOperand(pc, minus, 0));
} else {
- ldrb(condition, Register(rt), &label);
+ ldrb(condition, Register(rt), &location);
}
if (((instr & 0xf7f0000) != 0x55f0000)) {
UnpredictableA32(instr);
@@ -62740,7 +62755,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
int32_t imm = instr & 0xfff;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// LDRB{<c>}{<q>} <Rt>, <label> ; A1
if (minus_zero) {
ldrb(condition,
@@ -62748,7 +62763,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
Register(rt),
MemOperand(pc, minus, 0));
} else {
- ldrb(condition, Register(rt), &label);
+ ldrb(condition, Register(rt), &location);
}
if (((instr & 0xf7f0000) != 0x55f0000)) {
UnpredictableA32(instr);
@@ -65300,9 +65315,9 @@ void Disassembler::DecodeA32(uint32_t instr) {
}
Condition condition((instr >> 28) & 0xf);
int32_t imm = SignExtend<int32_t>(instr & 0xffffff, 24) << 2;
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// B{<c>}{<q>} <label> ; A1
- b(condition, Best, &label);
+ b(condition, Best, &location);
break;
}
case 0x01000000: {
@@ -65313,9 +65328,9 @@ void Disassembler::DecodeA32(uint32_t instr) {
}
Condition condition((instr >> 28) & 0xf);
int32_t imm = SignExtend<int32_t>(instr & 0xffffff, 24) << 2;
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// BL{<c>}{<q>} <label> ; A1
- bl(condition, &label);
+ bl(condition, &location);
break;
}
}
@@ -65950,7 +65965,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
imm <<= 2;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// VLDR{<c>}{<q>}{.32} <Sd>, <label> ; A2
if (minus_zero) {
vldr(condition,
@@ -65961,7 +65976,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
vldr(condition,
kDataTypeValueNone,
SRegister(rd),
- &label);
+ &location);
}
break;
}
@@ -65978,7 +65993,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
imm <<= 2;
if (U == 0) imm = -imm;
bool minus_zero = (imm == 0) && (U == 0);
- Label label(imm, kA32PcDelta);
+ Location location(imm, kA32PcDelta);
// VLDR{<c>}{<q>}{.64} <Dd>, <label> ; A1
if (minus_zero) {
vldr(condition,
@@ -65989,7 +66004,7 @@ void Disassembler::DecodeA32(uint32_t instr) {
vldr(condition,
kDataTypeValueNone,
DRegister(rd),
- &label);
+ &location);
}
break;
}
diff --git a/src/aarch32/disasm-aarch32.h b/src/aarch32/disasm-aarch32.h
index 5e0ba2bb..ed230458 100644
--- a/src/aarch32/disasm-aarch32.h
+++ b/src/aarch32/disasm-aarch32.h
@@ -109,13 +109,13 @@ class Disassembler {
}
};
- // TODO: Merge this class with PrintLabel below. This Label class represents
- // a PC-relative offset, not an address.
- class Label {
+ // TODO: Merge this class with PrintLabel below. This Location class
+ // represents a PC-relative offset, not an address.
+ class Location {
public:
typedef int32_t Offset;
- Label(Offset immediate, Offset pc_offset)
+ Location(Offset immediate, Offset pc_offset)
: immediate_(immediate), pc_offset_(pc_offset) {}
Offset GetImmediate() const { return immediate_; }
Offset GetPCOffset() const { return pc_offset_; }
@@ -127,21 +127,21 @@ class Disassembler {
class PrintLabel {
LocationType location_type_;
- Label::Offset immediate_;
- Label::Offset location_;
+ Location::Offset immediate_;
+ Location::Offset location_;
public:
PrintLabel(LocationType location_type,
- Label* offset,
- Label::Offset position)
+ Location* offset,
+ Location::Offset position)
: location_type_(location_type),
immediate_(offset->GetImmediate()),
location_(offset->GetPCOffset() + offset->GetImmediate() + position) {
}
LocationType GetLocationType() const { return location_type_; }
- Label::Offset GetLocation() const { return location_; }
- Label::Offset GetImmediate() const { return immediate_; }
+ Location::Offset GetLocation() const { return location_; }
+ Location::Offset GetImmediate() const { return immediate_; }
friend inline std::ostream& operator<<(std::ostream& os,
const PrintLabel& label) {
@@ -523,7 +523,7 @@ class Disassembler {
void addw(Condition cond, Register rd, Register rn, const Operand& operand);
- void adr(Condition cond, EncodingSize size, Register rd, Label* label);
+ void adr(Condition cond, EncodingSize size, Register rd, Location* location);
void and_(Condition cond,
EncodingSize size,
@@ -549,7 +549,7 @@ class Disassembler {
Register rm,
const Operand& operand);
- void b(Condition cond, EncodingSize size, Label* label);
+ void b(Condition cond, EncodingSize size, Location* location);
void bfc(Condition cond, Register rd, uint32_t lsb, uint32_t width);
@@ -570,9 +570,9 @@ class Disassembler {
void bkpt(Condition cond, uint32_t imm);
- void bl(Condition cond, Label* label);
+ void bl(Condition cond, Location* location);
- void blx(Condition cond, Label* label);
+ void blx(Condition cond, Location* location);
void blx(Condition cond, Register rm);
@@ -580,9 +580,9 @@ class Disassembler {
void bxj(Condition cond, Register rm);
- void cbnz(Register rn, Label* label);
+ void cbnz(Register rn, Location* location);
- void cbz(Register rn, Label* label);
+ void cbz(Register rn, Location* location);
void clrex(Condition cond);
@@ -718,21 +718,21 @@ class Disassembler {
Register rt,
const MemOperand& operand);
- void ldr(Condition cond, EncodingSize size, Register rt, Label* label);
+ void ldr(Condition cond, EncodingSize size, Register rt, Location* location);
void ldrb(Condition cond,
EncodingSize size,
Register rt,
const MemOperand& operand);
- void ldrb(Condition cond, Register rt, Label* label);
+ void ldrb(Condition cond, Register rt, Location* location);
void ldrd(Condition cond,
Register rt,
Register rt2,
const MemOperand& operand);
- void ldrd(Condition cond, Register rt, Register rt2, Label* label);
+ void ldrd(Condition cond, Register rt, Register rt2, Location* location);
void ldrex(Condition cond, Register rt, const MemOperand& operand);
@@ -750,21 +750,21 @@ class Disassembler {
Register rt,
const MemOperand& operand);
- void ldrh(Condition cond, Register rt, Label* label);
+ void ldrh(Condition cond, Register rt, Location* location);
void ldrsb(Condition cond,
EncodingSize size,
Register rt,
const MemOperand& operand);
- void ldrsb(Condition cond, Register rt, Label* label);
+ void ldrsb(Condition cond, Register rt, Location* location);
void ldrsh(Condition cond,
EncodingSize size,
Register rt,
const MemOperand& operand);
- void ldrsh(Condition cond, Register rt, Label* label);
+ void ldrsh(Condition cond, Register rt, Location* location);
void lsl(Condition cond,
EncodingSize size,
@@ -853,7 +853,7 @@ class Disassembler {
void pkhtb(Condition cond, Register rd, Register rn, const Operand& operand);
- void pld(Condition cond, Label* label);
+ void pld(Condition cond, Location* location);
void pld(Condition cond, const MemOperand& operand);
@@ -861,7 +861,7 @@ class Disassembler {
void pli(Condition cond, const MemOperand& operand);
- void pli(Condition cond, Label* label);
+ void pli(Condition cond, Location* location);
void pop(Condition cond, EncodingSize size, RegisterList registers);
@@ -1790,14 +1790,14 @@ class Disassembler {
WriteBack write_back,
SRegisterList sreglist);
- void vldr(Condition cond, DataType dt, DRegister rd, Label* label);
+ void vldr(Condition cond, DataType dt, DRegister rd, Location* location);
void vldr(Condition cond,
DataType dt,
DRegister rd,
const MemOperand& operand);
- void vldr(Condition cond, DataType dt, SRegister rd, Label* label);
+ void vldr(Condition cond, DataType dt, SRegister rd, Location* location);
void vldr(Condition cond,
DataType dt,
diff --git a/src/aarch32/instructions-aarch32.h b/src/aarch32/instructions-aarch32.h
index 7c2fc447..ad54cd6a 100644
--- a/src/aarch32/instructions-aarch32.h
+++ b/src/aarch32/instructions-aarch32.h
@@ -1341,7 +1341,7 @@ inline std::ostream& operator<<(std::ostream& os, Alignment align) {
return os << " :" << (0x10 << static_cast<uint32_t>(align.GetType()));
}
-class RawLiteral : public Label {
+class RawLiteral : public Location {
public:
enum PlacementPolicy { kPlacedWhenUsed, kManuallyPlaced };
diff --git a/src/aarch32/label-aarch32.h b/src/aarch32/label-aarch32.h
index 95ecd341..74dda423 100644
--- a/src/aarch32/label-aarch32.h
+++ b/src/aarch32/label-aarch32.h
@@ -46,48 +46,30 @@ namespace aarch32 {
class VeneerPoolManager;
class MacroAssembler;
-class Label {
+class Location {
public:
typedef int32_t Offset;
static const Offset kMaxOffset = 0x7fffffff;
- class LabelEmitOperator {
- Label::Offset max_backward_;
- Label::Offset max_forward_;
-
- public:
- LabelEmitOperator(Label::Offset max_backward, Label::Offset max_forward)
- : max_backward_(max_backward), max_forward_(max_forward) {}
- virtual ~LabelEmitOperator() {}
- virtual uint32_t Encode(uint32_t /*instr*/,
- Label::Offset /*pc*/,
- const Label* /*label*/) const {
- return 0;
- }
- Label::Offset GetMaxForwardDistance() const { return max_forward_; }
- Label::Offset GetMaxBackwardDistance() const { return max_backward_; }
- };
+ class EmitOperator {
+ InstructionSet isa_;
- class ForwardReference {
public:
- ForwardReference(int32_t location,
- const LabelEmitOperator& op,
- InstructionSet isa)
- : location_(location), op_(op), isa_(isa), is_branch_(false) {
+ explicit EmitOperator(InstructionSet isa) : isa_(isa) {
#if defined(VIXL_INCLUDE_TARGET_A32_ONLY)
USE(isa_);
- VIXL_ASSERT(isa_ == A32);
+ VIXL_ASSERT(isa == A32);
#elif defined(VIXL_INCLUDE_TARGET_T32_ONLY)
USE(isa_);
VIXL_ASSERT(isa == T32);
#endif
}
- Offset GetMaxForwardDistance() const { return op_.GetMaxForwardDistance(); }
- int32_t GetLocation() const { return location_; }
- uint32_t GetStatePCOffset() const {
- return IsUsingT32() ? kT32PcDelta : kA32PcDelta;
+ virtual ~EmitOperator() {}
+ virtual uint32_t Encode(uint32_t /*instr*/,
+ Location::Offset /*pc*/,
+ const Location* /*label*/) const {
+ return 0;
}
-
#if defined(VIXL_INCLUDE_TARGET_A32_ONLY)
bool IsUsingT32() const { return false; }
#elif defined(VIXL_INCLUDE_TARGET_T32_ONLY)
@@ -95,24 +77,41 @@ class Label {
#else
bool IsUsingT32() const { return isa_ == T32; }
#endif
+ };
+
+ class ForwardReference {
+ public:
+ ForwardReference(int32_t location,
+ const EmitOperator& op,
+ Offset max_offset)
+ : location_(location),
+ op_(op),
+ is_branch_(false),
+ max_forward_(max_offset) {}
+ Offset GetMaxForwardDistance() const { return max_forward_; }
+ int32_t GetLocation() const { return location_; }
+ uint32_t GetStatePCOffset() const {
+ return op_.IsUsingT32() ? kT32PcDelta : kA32PcDelta;
+ }
+ bool IsUsingT32() const { return op_.IsUsingT32(); }
bool IsBranch() const { return is_branch_; }
void SetIsBranch() { is_branch_ = true; }
- const LabelEmitOperator& GetEmitOperator() const { return op_; }
+ const EmitOperator& GetEmitOperator() const { return op_; }
Offset GetCheckpoint() const {
// The load instructions align down PC before adding the offset.
// The alignment is only needed for T32 as A32 instructions are always
// 4 byte aligned.
int32_t pc = GetLocation() + GetStatePCOffset();
return GetMaxForwardDistance() +
- ((IsUsingT32() && !IsBranch()) ? AlignDown(pc, 4) : pc);
+ ((op_.IsUsingT32() && !IsBranch()) ? AlignDown(pc, 4) : pc);
}
private:
int32_t location_;
- const LabelEmitOperator& op_;
- InstructionSet isa_;
+ const EmitOperator& op_;
bool is_branch_;
+ Location::Offset max_forward_;
};
typedef std::list<ForwardReference> ForwardRefList;
@@ -136,24 +135,20 @@ class Label {
}
public:
- Label()
+ Location()
: location_(kMaxOffset),
is_bound_(false),
referenced_(false),
- veneer_pool_manager_(NULL),
- is_near_(false),
checkpoint_(kMaxOffset) {}
- explicit Label(Offset location)
+ explicit Location(Offset location)
: location_(location),
is_bound_(true),
referenced_(false),
- veneer_pool_manager_(NULL),
- is_near_(false),
checkpoint_(kMaxOffset) {}
- ~Label() VIXL_THROW_IN_NEGATIVE_TESTING_MODE(std::runtime_error) {
+ ~Location() VIXL_THROW_IN_NEGATIVE_TESTING_MODE(std::runtime_error) {
#ifdef VIXL_DEBUG
if (referenced_ && !is_bound_) {
- VIXL_ABORT_WITH_MSG("Label used but not bound.\n");
+ VIXL_ABORT_WITH_MSG("Location, label or literal used but not bound.\n");
}
#endif
}
@@ -173,27 +168,16 @@ class Label {
}
void SetReferenced() { referenced_ = true; }
bool IsReferenced() const { return referenced_; }
- bool IsInVeneerPool() const { return veneer_pool_manager_ != NULL; }
- VeneerPoolManager* GetVeneerPoolManager() const {
- return veneer_pool_manager_;
- }
- void SetVeneerPoolManager(VeneerPoolManager* veneer_pool_manager,
- bool is_near) {
- veneer_pool_manager_ = veneer_pool_manager;
- is_near_ = is_near;
- }
- void ClearVeneerPoolManager() { veneer_pool_manager_ = NULL; }
- bool IsNear() const { return is_near_; }
void SetCheckpoint(Offset checkpoint) { checkpoint_ = checkpoint; }
Offset GetCheckpoint() const { return checkpoint_; }
Offset GetAlignedCheckpoint(int byte_align) const {
return AlignDown(GetCheckpoint(), byte_align);
}
void AddForwardRef(int32_t instr_location,
- InstructionSet isa,
- const LabelEmitOperator& op) {
+ const EmitOperator& op,
+ Offset max_offset) {
VIXL_ASSERT(referenced_);
- forward_.push_back(ForwardReference(instr_location, op, isa));
+ forward_.push_back(ForwardReference(instr_location, op, max_offset));
}
ForwardRefList::iterator GetFirstForwardRef() { return forward_.begin(); }
@@ -225,7 +209,7 @@ class Label {
}
VIXL_ASSERT((update_checkpoint == kNoUpdateNecessary) &&
((checkpoint_ == GetNextCheckpoint()) ||
- ((checkpoint_ == Label::kMaxOffset) && forward_.empty())));
+ ((checkpoint_ == Location::kMaxOffset) && forward_.empty())));
if (update_checkpoint == kRecomputeCheckpoint) {
checkpoint_ = GetNextCheckpoint();
}
@@ -245,10 +229,6 @@ class Label {
VIXL_ASSERT(GetNextCheckpoint() == checkpoint_);
}
- static bool CompareLabels(Label* a, Label* b) {
- return a->GetCheckpoint() < b->GetCheckpoint();
- }
-
private:
// Once bound, location of this label in the code buffer.
Offset location_;
@@ -256,22 +236,45 @@ class Label {
bool is_bound_;
// True if the label has been used at least once.
bool referenced_;
- // Not null if the label is currently inserted in the veneer pool.
- VeneerPoolManager* veneer_pool_manager_;
- // True if the label is inserted in the near_labels_ list.
- bool is_near_;
// Contains the references to the unbound label
ForwardRefList forward_;
// Max offset in the code buffer. Must be emitted before this checkpoint.
Offset checkpoint_;
};
+class Label : public Location {
+ public:
+ Label() : Location(), veneer_pool_manager_(NULL), is_near_(false) {}
+ explicit Label(Offset location)
+ : Location(location), veneer_pool_manager_(NULL), is_near_(false) {}
+ static bool CompareLabels(Label* a, Label* b) {
+ return a->GetCheckpoint() < b->GetCheckpoint();
+ }
+ bool IsInVeneerPool() const { return veneer_pool_manager_ != NULL; }
+ VeneerPoolManager* GetVeneerPoolManager() const {
+ return veneer_pool_manager_;
+ }
+ void SetVeneerPoolManager(VeneerPoolManager* veneer_pool_manager,
+ bool is_near) {
+ veneer_pool_manager_ = veneer_pool_manager;
+ is_near_ = is_near;
+ }
+ void ClearVeneerPoolManager() { veneer_pool_manager_ = NULL; }
+ bool IsNear() const { return is_near_; }
+
+ private:
+ // Not null if the label is currently in the veneer pool.
+ VeneerPoolManager* veneer_pool_manager_;
+ // True if the label is in the near_labels_ list.
+ bool is_near_;
+};
+
class VeneerPoolManager {
public:
explicit VeneerPoolManager(MacroAssembler* masm)
: masm_(masm),
- near_checkpoint_(Label::kMaxOffset),
- far_checkpoint_(Label::kMaxOffset),
+ near_checkpoint_(Location::kMaxOffset),
+ far_checkpoint_(Location::kMaxOffset),
max_near_checkpoint_(0),
near_checkpoint_margin_(0),
last_label_reference_offset_(0),
@@ -279,15 +282,15 @@ class VeneerPoolManager {
bool IsEmpty() const {
return (near_labels_.size() + far_labels_.size()) == 0;
}
- Label::Offset GetCheckpoint() const {
+ Location::Offset GetCheckpoint() const {
// For the far labels, we subtract the veneer size. This way avoids problems
// when two label have the same checkpoint. In the usual case, we lose some
// range but, as the minimum range for far labels is 1 mega byte, it's not
// very important.
size_t veneer_max_size = GetMaxSize();
VIXL_ASSERT(IsInt32(veneer_max_size));
- Label::Offset tmp =
- far_checkpoint_ - static_cast<Label::Offset>(veneer_max_size);
+ Location::Offset tmp =
+ far_checkpoint_ - static_cast<Location::Offset>(veneer_max_size);
// Make room for a branch over the pools.
return std::min(near_checkpoint_, tmp) - kMaxInstructionSizeInBytes -
near_checkpoint_margin_;
@@ -298,8 +301,8 @@ class VeneerPoolManager {
}
void AddLabel(Label* label);
void RemoveLabel(Label* label);
- void EmitLabel(Label* label, Label::Offset emitted_target);
- void Emit(Label::Offset target);
+ void EmitLabel(Label* label, Location::Offset emitted_target);
+ void Emit(Location::Offset target);
void Block() { monitor_++; }
void Release();
@@ -312,17 +315,17 @@ class VeneerPoolManager {
std::list<Label*> far_labels_;
// Offset in the code buffer after which the veneer needs to be emitted.
// It's the lowest checkpoint value in the associated list.
- // A default value of Label::kMaxOffset means that the checkpoint is
+ // A default value of Location::kMaxOffset means that the checkpoint is
// invalid (no entry in the list).
- Label::Offset near_checkpoint_;
- Label::Offset far_checkpoint_;
+ Location::Offset near_checkpoint_;
+ Location::Offset far_checkpoint_;
// Highest checkpoint value for the near list.
- Label::Offset max_near_checkpoint_;
+ Location::Offset max_near_checkpoint_;
// Margin we have to take to ensure that 16 bit branch instructions will be
// able to generate 32 bit veneers.
uint32_t near_checkpoint_margin_;
// Offset where the last reference to a label has been added to the pool.
- Label::Offset last_label_reference_offset_;
+ Location::Offset last_label_reference_offset_;
// Indicates whether the emission of this pool is blocked.
int monitor_;
};
diff --git a/src/aarch32/macro-assembler-aarch32.cc b/src/aarch32/macro-assembler-aarch32.cc
index d7492f8f..82947f87 100644
--- a/src/aarch32/macro-assembler-aarch32.cc
+++ b/src/aarch32/macro-assembler-aarch32.cc
@@ -313,7 +313,7 @@ void VeneerPoolManager::EmitLabel(Label* label, Label::Offset emitted_target) {
if (ref->IsBranch()) {
if (ref->GetCheckpoint() <= emitted_target) {
// Use the veneer.
- masm_->EncodeLabelFor(*ref, &veneer);
+ masm_->EncodeLocationFor(*ref, &veneer);
ref = label->Erase(ref);
} else {
// Don't use the veneer => update checkpoint.
@@ -1248,22 +1248,22 @@ void MacroAssembler::Delegate(InstructionType type,
Condition cond,
EncodingSize size,
Register rd,
- Label* label) {
+ Location* location) {
VIXL_ASSERT((type == kLdr) || (type == kAdr));
CONTEXT_SCOPE;
VIXL_ASSERT(size.IsBest());
- if ((type == kLdr) && label->IsBound()) {
+ if ((type == kLdr) && location->IsBound()) {
CodeBufferCheckScope scope(this, 5 * kMaxInstructionSizeInBytes);
UseScratchRegisterScope temps(this);
temps.Include(rd);
uint32_t mask = GetOffsetMask(type, Offset);
- ldr(rd, MemOperandComputationHelper(cond, temps.Acquire(), label, mask));
+ ldr(rd, MemOperandComputationHelper(cond, temps.Acquire(), location, mask));
return;
}
- Assembler::Delegate(type, instruction, cond, size, rd, label);
+ Assembler::Delegate(type, instruction, cond, size, rd, location);
}
@@ -1506,7 +1506,7 @@ void MacroAssembler::Delegate(InstructionType type,
void MacroAssembler::Delegate(InstructionType type,
InstructionRL instruction,
Register rn,
- Label* label) {
+ Location* location) {
VIXL_ASSERT((type == kCbz) || (type == kCbnz));
CONTEXT_SCOPE;
@@ -1522,14 +1522,14 @@ void MacroAssembler::Delegate(InstructionType type,
case kCbnz: {
Label done;
cbz(rn, &done);
- b(label);
+ b(location);
Bind(&done);
return;
}
case kCbz: {
Label done;
cbnz(rn, &done);
- b(label);
+ b(location);
Bind(&done);
return;
}
@@ -1537,7 +1537,7 @@ void MacroAssembler::Delegate(InstructionType type,
break;
}
}
- Assembler::Delegate(type, instruction, rn, label);
+ Assembler::Delegate(type, instruction, rn, location);
}
@@ -1931,13 +1931,13 @@ void MacroAssembler::Delegate(InstructionType type,
InstructionCondRL instruction,
Condition cond,
Register rt,
- Label* label) {
+ Location* location) {
VIXL_ASSERT((type == kLdrb) || (type == kLdrh) || (type == kLdrsb) ||
(type == kLdrsh));
CONTEXT_SCOPE;
- if (label->IsBound()) {
+ if (location->IsBound()) {
CodeBufferCheckScope scope(this, 5 * kMaxInstructionSizeInBytes);
UseScratchRegisterScope temps(this);
temps.Include(rt);
@@ -1945,16 +1945,16 @@ void MacroAssembler::Delegate(InstructionType type,
uint32_t mask = GetOffsetMask(type, Offset);
switch (type) {
case kLdrb:
- ldrb(rt, MemOperandComputationHelper(cond, scratch, label, mask));
+ ldrb(rt, MemOperandComputationHelper(cond, scratch, location, mask));
return;
case kLdrh:
- ldrh(rt, MemOperandComputationHelper(cond, scratch, label, mask));
+ ldrh(rt, MemOperandComputationHelper(cond, scratch, location, mask));
return;
case kLdrsb:
- ldrsb(rt, MemOperandComputationHelper(cond, scratch, label, mask));
+ ldrsb(rt, MemOperandComputationHelper(cond, scratch, location, mask));
return;
case kLdrsh:
- ldrsh(rt, MemOperandComputationHelper(cond, scratch, label, mask));
+ ldrsh(rt, MemOperandComputationHelper(cond, scratch, location, mask));
return;
default:
VIXL_UNREACHABLE();
@@ -1962,7 +1962,7 @@ void MacroAssembler::Delegate(InstructionType type,
return;
}
- Assembler::Delegate(type, instruction, cond, rt, label);
+ Assembler::Delegate(type, instruction, cond, rt, location);
}
@@ -1971,22 +1971,22 @@ void MacroAssembler::Delegate(InstructionType type,
Condition cond,
Register rt,
Register rt2,
- Label* label) {
+ Location* location) {
VIXL_ASSERT(type == kLdrd);
CONTEXT_SCOPE;
- if (label->IsBound()) {
+ if (location->IsBound()) {
CodeBufferCheckScope scope(this, 6 * kMaxInstructionSizeInBytes);
UseScratchRegisterScope temps(this);
temps.Include(rt, rt2);
Register scratch = temps.Acquire();
uint32_t mask = GetOffsetMask(type, Offset);
- ldrd(rt, rt2, MemOperandComputationHelper(cond, scratch, label, mask));
+ ldrd(rt, rt2, MemOperandComputationHelper(cond, scratch, location, mask));
return;
}
- Assembler::Delegate(type, instruction, cond, rt, rt2, label);
+ Assembler::Delegate(type, instruction, cond, rt, rt2, location);
}
@@ -2557,21 +2557,21 @@ void MacroAssembler::Delegate(InstructionType type,
Condition cond,
DataType dt,
DRegister rd,
- Label* label) {
+ Location* location) {
VIXL_ASSERT(type == kVldr);
CONTEXT_SCOPE;
- if (label->IsBound()) {
+ if (location->IsBound()) {
CodeBufferCheckScope scope(this, 5 * kMaxInstructionSizeInBytes);
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
uint32_t mask = GetOffsetMask(type, Offset);
- vldr(dt, rd, MemOperandComputationHelper(cond, scratch, label, mask));
+ vldr(dt, rd, MemOperandComputationHelper(cond, scratch, location, mask));
return;
}
- Assembler::Delegate(type, instruction, cond, dt, rd, label);
+ Assembler::Delegate(type, instruction, cond, dt, rd, location);
}
@@ -2580,21 +2580,21 @@ void MacroAssembler::Delegate(InstructionType type,
Condition cond,
DataType dt,
SRegister rd,
- Label* label) {
+ Location* location) {
VIXL_ASSERT(type == kVldr);
CONTEXT_SCOPE;
- if (label->IsBound()) {
+ if (location->IsBound()) {
CodeBufferCheckScope scope(this, 5 * kMaxInstructionSizeInBytes);
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
uint32_t mask = GetOffsetMask(type, Offset);
- vldr(dt, rd, MemOperandComputationHelper(cond, scratch, label, mask));
+ vldr(dt, rd, MemOperandComputationHelper(cond, scratch, location, mask));
return;
}
- Assembler::Delegate(type, instruction, cond, dt, rd, label);
+ Assembler::Delegate(type, instruction, cond, dt, rd, location);
}
diff --git a/src/aarch32/macro-assembler-aarch32.h b/src/aarch32/macro-assembler-aarch32.h
index 5a1c2bf6..a30c4a83 100644
--- a/src/aarch32/macro-assembler-aarch32.h
+++ b/src/aarch32/macro-assembler-aarch32.h
@@ -581,13 +581,13 @@ class MacroAssembler : public Assembler, public MacroAssemblerInterface {
}
MemOperand MemOperandComputationHelper(Condition cond,
Register scratch,
- Label* label,
+ Location* location,
uint32_t extra_offset_mask = 0) {
// Check for buffer space _before_ calculating the offset, in case we
// generate a pool that affects the offset calculation.
CodeBufferCheckScope scope(this, 4 * kMaxInstructionSizeInBytes);
Label::Offset offset =
- label->GetLocation() -
+ location->GetLocation() -
AlignDown(GetCursorOffset() + GetArchitectureStatePCOffset(), 4);
return MemOperandComputationHelper(cond,
scratch,
@@ -596,9 +596,12 @@ class MacroAssembler : public Assembler, public MacroAssemblerInterface {
extra_offset_mask);
}
MemOperand MemOperandComputationHelper(Register scratch,
- Label* label,
+ Location* location,
uint32_t extra_offset_mask = 0) {
- return MemOperandComputationHelper(al, scratch, label, extra_offset_mask);
+ return MemOperandComputationHelper(al,
+ scratch,
+ location,
+ extra_offset_mask);
}
// Determine the appropriate mask to pass into MemOperandComputationHelper.
@@ -990,7 +993,7 @@ class MacroAssembler : public Assembler, public MacroAssemblerInterface {
Condition cond,
EncodingSize size,
Register rd,
- Label* label) VIXL_OVERRIDE;
+ Location* location) VIXL_OVERRIDE;
bool GenerateSplitInstruction(InstructionCondSizeRROp instruction,
Condition cond,
Register rd,
@@ -1008,7 +1011,7 @@ class MacroAssembler : public Assembler, public MacroAssemblerInterface {
virtual void Delegate(InstructionType type,
InstructionRL instruction,
Register rn,
- Label* label) VIXL_OVERRIDE;
+ Location* location) VIXL_OVERRIDE;
// VMOV
virtual void Delegate(InstructionType type,
InstructionCondDtSSop instruction,
@@ -1042,13 +1045,13 @@ class MacroAssembler : public Assembler, public MacroAssemblerInterface {
InstructionCondRL instruction,
Condition cond,
Register rt,
- Label* label) VIXL_OVERRIDE;
+ Location* location) VIXL_OVERRIDE;
virtual void Delegate(InstructionType type,
InstructionCondRRL instruction,
Condition cond,
Register rt,
Register rt2,
- Label* label) VIXL_OVERRIDE;
+ Location* location) VIXL_OVERRIDE;
virtual void Delegate(InstructionType type,
InstructionCondRRMop instruction,
Condition cond,
@@ -1080,13 +1083,13 @@ class MacroAssembler : public Assembler, public MacroAssemblerInterface {
Condition cond,
DataType dt,
DRegister rd,
- Label* label) VIXL_OVERRIDE;
+ Location* location) VIXL_OVERRIDE;
virtual void Delegate(InstructionType type,
InstructionCondDtSL instruction,
Condition cond,
DataType dt,
SRegister rd,
- Label* label) VIXL_OVERRIDE;
+ Location* location) VIXL_OVERRIDE;
// Start of generated code.
diff --git a/test/aarch32/test-disasm-a32.cc b/test/aarch32/test-disasm-a32.cc
index 855fc087..6a454623 100644
--- a/test/aarch32/test-disasm-a32.cc
+++ b/test/aarch32/test-disasm-a32.cc
@@ -3311,22 +3311,22 @@ TEST(unbound_label) {
MUST_FAIL_TEST_BOTH_BLOCK({
Label label;
masm.B(&label);
- }, "Label used but not bound.\n")
+ }, "Location, label or literal used but not bound.\n")
MUST_FAIL_TEST_BOTH_BLOCK({
Label label;
masm.B(eq, &label);
- }, "Label used but not bound.\n")
+ }, "Location, label or literal used but not bound.\n")
MUST_FAIL_TEST_T32_BLOCK({
Label label;
masm.Cbz(r0, &label);
- }, "Label used but not bound.\n")
+ }, "Location, label or literal used but not bound.\n")
MUST_FAIL_TEST_T32_BLOCK({
Label label;
masm.Cbnz(r1, &label);
- }, "Label used but not bound.\n")
+ }, "Location, label or literal used but not bound.\n")
#endif
CLEANUP();