Commit 8af3c3a1 authored by jacob.bramley's avatar jacob.bramley Committed by Commit bot

ARM64: Fix some signed-unsigned comparisons from cdc43bc5 (r28412).

These trigger warnings on cross-builds under GCC.

BUG=

Review URL: https://codereview.chromium.org/1151463002

Cr-Commit-Position: refs/heads/master@{#28509}
parent f2f8001f
......@@ -867,8 +867,8 @@ bool RelocInfo::IsPatchedReturnSequence() {
// See arm64/debug-arm64.cc BreakLocation::SetDebugBreakAtReturn().
Instruction* i1 = reinterpret_cast<Instruction*>(pc_);
Instruction* i2 = i1->following();
return i1->IsLdrLiteralX() && (i1->Rt() == ip0.code()) &&
i2->IsBranchAndLinkToRegister() && (i2->Rn() == ip0.code());
return i1->IsLdrLiteralX() && (i1->Rt() == kIp0Code) &&
i2->IsBranchAndLinkToRegister() && (i2->Rn() == kIp0Code);
}
......
......@@ -891,12 +891,12 @@ bool Assembler::IsConstantPoolAt(Instruction* instr) {
// The constant pool marker is made of two instructions. These instructions
// will never be emitted by the JIT, so checking for the first one is enough:
// 0: ldr xzr, #<size of pool>
bool result = instr->IsLdrLiteralX() && (instr->Rt() == xzr.code());
bool result = instr->IsLdrLiteralX() && (instr->Rt() == kZeroRegCode);
// It is still worth asserting the marker is complete.
// 4: blr xzr
DCHECK(!result || (instr->following()->IsBranchAndLinkToRegister() &&
instr->following()->Rn() == xzr.code()));
instr->following()->Rn() == kZeroRegCode));
return result;
}
......
......@@ -84,6 +84,8 @@ const int64_t kXMaxInt = 0x7fffffffffffffffL;
const int64_t kXMinInt = 0x8000000000000000L;
const int32_t kWMaxInt = 0x7fffffff;
const int32_t kWMinInt = 0x80000000;
const unsigned kIp0Code = 16;
const unsigned kIp1Code = 17;
const unsigned kFramePointerRegCode = 29;
const unsigned kLinkRegCode = 30;
const unsigned kZeroRegCode = 31;
......
......@@ -319,7 +319,7 @@ void Instruction::SetImmLLiteral(Instruction* source) {
bool InstructionSequence::IsInlineData() const {
// Inline data is encoded as a single movz instruction which writes to xzr
// (x31).
return IsMovz() && SixtyFourBits() && (Rd() == xzr.code());
return IsMovz() && SixtyFourBits() && (Rd() == kZeroRegCode);
// TODO(all): If we extend ::InlineData() to support bigger data, we need
// to update this method too.
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment