Commit c941c4d9 authored by Dan Elphick's avatar Dan Elphick Committed by V8 LUCI CQ

Fix mips build after adding base/strings.h

Bug: v8:11879
Change-Id: I8f307490ca253e6d458db14cc5bf771d6fe1db57
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2979593
Auto-Submit: Dan Elphick <delphick@chromium.org>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Reviewed-by: 's avatarZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#75315}
parent 3c25c398
This diff is collapsed.
...@@ -295,10 +295,9 @@ void Decoder::PrintSs3(Instruction* instr) { ...@@ -295,10 +295,9 @@ void Decoder::PrintSs3(Instruction* instr) {
// Print the integer value of dinsm size from the msbminus32 and lsb fields. // Print the integer value of dinsm size from the msbminus32 and lsb fields.
void Decoder::PrintSs4(Instruction* instr) { void Decoder::PrintSs4(Instruction* instr) {
int msbminus32 = instr->RdValue(); int msbminus32 = instr->RdValue();
int lsb = instr->S_buffer_pos_ += int lsb = instr->SaValue();
out_buffer_pos_ += base::SNPrintF(out_buffer_ + out_buffer_pos_, "%d",
base::SNPrintF(out_buffer_ + out_buffer_pos_, "%d", msbminus32 + 32 - lsb + 1);
msbminus32 + 32 - lsb + 1);
} }
// Print the integer value of dextu/dinsu pos from the lsbminus32 field. // Print the integer value of dextu/dinsu pos from the lsbminus32 field.
...@@ -316,7 +315,7 @@ void Decoder::PrintBc(Instruction* instr) { ...@@ -316,7 +315,7 @@ void Decoder::PrintBc(Instruction* instr) {
// Print the integer value of the cc field for the FP compare instructions. // Print the integer value of the cc field for the FP compare instructions.
void Decoder::PrintCc(Instruction* instr) { void Decoder::PrintCc(Instruction* instr) {
int cc = instr->FC ccValue(); int cc = instr->FCccValue();
out_buffer_pos_ += out_buffer_pos_ +=
base::SNPrintF(out_buffer_ + out_buffer_pos_, "cc(%d)", cc); base::SNPrintF(out_buffer_ + out_buffer_pos_, "cc(%d)", cc);
} }
...@@ -358,9 +357,9 @@ void Decoder::PrintXImm16(Instruction* instr) { ...@@ -358,9 +357,9 @@ void Decoder::PrintXImm16(Instruction* instr) {
void Decoder::PrintPCImm16(Instruction* instr, int delta_pc, int n_bits) { void Decoder::PrintPCImm16(Instruction* instr, int delta_pc, int n_bits) {
int16_t offset = instr->Imm16Value(); int16_t offset = instr->Imm16Value();
out_buffer_pos_ += out_buffer_pos_ +=
base::SNP rintF(out_buffer_ + out_buffer_pos_, "%s", base::SNPrintF(out_buffer_ + out_buffer_pos_, "%s",
converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + converter_.NameOfAddress(reinterpret_cast<byte*>(instr) +
delta_pc + (offset << n_bits))); delta_pc + (offset << n_bits)));
} }
// Print 18-bit signed immediate value. // Print 18-bit signed immediate value.
...@@ -415,9 +414,9 @@ void Decoder::PrintPCImm21(Instruction* instr, int delta_pc, int n_bits) { ...@@ -415,9 +414,9 @@ void Decoder::PrintPCImm21(Instruction* instr, int delta_pc, int n_bits) {
imm21 <<= (32 - kImm21Bits); imm21 <<= (32 - kImm21Bits);
imm21 >>= (32 - kImm21Bits); imm21 >>= (32 - kImm21Bits);
out_buffer_pos_ += out_buffer_pos_ +=
base::SNP rintF(out_buffer_ + out_buffer_pos_, "%s", base::SNPrintF(out_buffer_ + out_buffer_pos_, "%s",
converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + converter_.NameOfAddress(reinterpret_cast<byte*>(instr) +
delta_pc + (imm21 << n_bits))); delta_pc + (imm21 << n_bits)));
} }
// Print 26-bit hex immediate value. // Print 26-bit hex immediate value.
...@@ -447,9 +446,9 @@ void Decoder::PrintPCImm26(Instruction* instr, int delta_pc, int n_bits) { ...@@ -447,9 +446,9 @@ void Decoder::PrintPCImm26(Instruction* instr, int delta_pc, int n_bits) {
imm26 <<= (32 - kImm26Bits); imm26 <<= (32 - kImm26Bits);
imm26 >>= (32 - kImm26Bits); imm26 >>= (32 - kImm26Bits);
out_buffer_pos_ += out_buffer_pos_ +=
base::SNP rintF(out_buffer_ + out_buffer_pos_, "%s", base::SNPrintF(out_buffer_ + out_buffer_pos_, "%s",
converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + converter_.NameOfAddress(reinterpret_cast<byte*>(instr) +
delta_pc + (imm26 << n_bits))); delta_pc + (imm26 << n_bits)));
} }
// Print absoulte address for 26-bit offset or immediate value. // Print absoulte address for 26-bit offset or immediate value.
...@@ -460,8 +459,8 @@ void Decoder::PrintPCImm26(Instruction* instr) { ...@@ -460,8 +459,8 @@ void Decoder::PrintPCImm26(Instruction* instr) {
uint64_t pc_mask = ~0xFFFFFFF; uint64_t pc_mask = ~0xFFFFFFF;
uint64_t pc = ((uint64_t)(instr + 1) & pc_mask) | (imm26 << 2); uint64_t pc = ((uint64_t)(instr + 1) & pc_mask) | (imm26 << 2);
out_buffer_pos_ += out_buffer_pos_ +=
base::SNP rintF(out_buffer_ + out_buffer_pos_, "%s", base::SNPrintF(out_buffer_ + out_buffer_pos_, "%s",
converter_.NameOfAddress((reinterpret_cast<byte*>(pc)))); converter_.NameOfAddress((reinterpret_cast<byte*>(pc))));
} }
void Decoder::PrintBp2(Instruction* instr) { void Decoder::PrintBp2(Instruction* instr) {
...@@ -480,10 +479,9 @@ void Decoder::PrintCode(Instruction* instr) { ...@@ -480,10 +479,9 @@ void Decoder::PrintCode(Instruction* instr) {
return; // Not a break or trap instruction. return; // Not a break or trap instruction.
switch (instr->FunctionFieldRaw()) { switch (instr->FunctionFieldRaw()) {
case BREAK: { case BREAK: {
int32_t code = ins_buffer_pos_ += int32_t code = instr->Bits(25, 6);
out_buffer_pos_ += base::SNPrintF(out_buffer_ + out_buffer_pos_,
base::SNPrintF(out_buffer_ + out_buffer_pos_, "0x%05x (%d)", code, "0x%05x (%d)", code, code);
code);
break; break;
} }
case TGE: case TGE:
...@@ -544,9 +542,10 @@ void Decoder::PrintMsaImmElm(Instruction* instr) { ...@@ -544,9 +542,10 @@ void Decoder::PrintMsaImmElm(Instruction* instr) {
void Decoder::PrintMsaCopy(Instruction* instr) { void Decoder::PrintMsaCopy(Instruction* instr) {
int32_t rd = instr->WdValue(); int32_t rd = instr->WdValue();
int32_t ws = instr->WsValue(); int32_t ws = instr->WsValue();
int32_t n = instr - buffer_pos_ += int32_t n = instr->MsaElmNValue();
rintF(out_buffer_ + out_buffer_po _, "%s, %s[%u]", out_buffer_pos_ += base::SNPrintF(out_buffer_ + out_buffer_pos_, "%s, %s[%u]",
converter_.NameOfCPURegister(rd), MSARegisters::Name(ws), n); converter_.NameOfCPURegister(rd),
MSARegisters::Name(ws), n);
} }
void Decoder::PrintFormat(Instruction* instr) { void Decoder::PrintFormat(Instruction* instr) {
...@@ -2976,7 +2975,7 @@ int Decoder::InstructionDecode(byte* instr_ptr) { ...@@ -2976,7 +2975,7 @@ int Decoder::InstructionDecode(byte* instr_ptr) {
namespace disasm { namespace disasm {
const char* NameConverter::NameOfAddress(byte* addr) const { const char* NameConverter::NameOfAddress(byte* addr) const {
v8::internal::base::SNPrintF(tmp_buffer_, "%p", static_cast<void*>(addr)); v8::base::SNPrintF(tmp_buffer_, "%p", static_cast<void*>(addr));
return tmp_buffer_.begin(); return tmp_buffer_.begin();
} }
......
...@@ -36,6 +36,7 @@ T Nabs(T a) { ...@@ -36,6 +36,7 @@ T Nabs(T a) {
// Running with a simulator. // Running with a simulator.
#include "src/base/hashmap.h" #include "src/base/hashmap.h"
#include "src/base/strings.h"
#include "src/codegen/assembler.h" #include "src/codegen/assembler.h"
#include "src/codegen/mips/constants-mips.h" #include "src/codegen/mips/constants-mips.h"
#include "src/execution/simulator-base.h" #include "src/execution/simulator-base.h"
...@@ -548,7 +549,7 @@ class Simulator : public SimulatorBase { ...@@ -548,7 +549,7 @@ class Simulator : public SimulatorBase {
instr->OpcodeValue()); instr->OpcodeValue());
} }
InstructionDecode(instr); InstructionDecode(instr);
SNPrintF(trace_buf_, " "); base::SNPrintF(trace_buf_, " ");
} }
// ICache. // ICache.
......
This diff is collapsed.
...@@ -36,6 +36,7 @@ T Nabs(T a) { ...@@ -36,6 +36,7 @@ T Nabs(T a) {
// Running with a simulator. // Running with a simulator.
#include "src/base/hashmap.h" #include "src/base/hashmap.h"
#include "src/base/strings.h"
#include "src/codegen/assembler.h" #include "src/codegen/assembler.h"
#include "src/codegen/mips64/constants-mips64.h" #include "src/codegen/mips64/constants-mips64.h"
#include "src/execution/simulator-base.h" #include "src/execution/simulator-base.h"
......
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