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,9 +295,8 @@ void Decoder::PrintSs3(Instruction* instr) {
// Print the integer value of dinsm size from the msbminus32 and lsb fields.
void Decoder::PrintSs4(Instruction* instr) {
int msbminus32 = instr->RdValue();
int lsb = instr->S_buffer_pos_ +=
base::SNPrintF(out_buffer_ + out_buffer_pos_, "%d",
int lsb = instr->SaValue();
out_buffer_pos_ += base::SNPrintF(out_buffer_ + out_buffer_pos_, "%d",
msbminus32 + 32 - lsb + 1);
}
......@@ -316,7 +315,7 @@ void Decoder::PrintBc(Instruction* instr) {
// Print the integer value of the cc field for the FP compare instructions.
void Decoder::PrintCc(Instruction* instr) {
int cc = instr->FC ccValue();
int cc = instr->FCccValue();
out_buffer_pos_ +=
base::SNPrintF(out_buffer_ + out_buffer_pos_, "cc(%d)", cc);
}
......@@ -358,7 +357,7 @@ void Decoder::PrintXImm16(Instruction* instr) {
void Decoder::PrintPCImm16(Instruction* instr, int delta_pc, int n_bits) {
int16_t offset = instr->Imm16Value();
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) +
delta_pc + (offset << n_bits)));
}
......@@ -415,7 +414,7 @@ void Decoder::PrintPCImm21(Instruction* instr, int delta_pc, int n_bits) {
imm21 <<= (32 - kImm21Bits);
imm21 >>= (32 - kImm21Bits);
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) +
delta_pc + (imm21 << n_bits)));
}
......@@ -447,7 +446,7 @@ void Decoder::PrintPCImm26(Instruction* instr, int delta_pc, int n_bits) {
imm26 <<= (32 - kImm26Bits);
imm26 >>= (32 - kImm26Bits);
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) +
delta_pc + (imm26 << n_bits)));
}
......@@ -460,7 +459,7 @@ void Decoder::PrintPCImm26(Instruction* instr) {
uint64_t pc_mask = ~0xFFFFFFF;
uint64_t pc = ((uint64_t)(instr + 1) & pc_mask) | (imm26 << 2);
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))));
}
......@@ -480,10 +479,9 @@ void Decoder::PrintCode(Instruction* instr) {
return; // Not a break or trap instruction.
switch (instr->FunctionFieldRaw()) {
case BREAK: {
int32_t code = ins_buffer_pos_ +=
base::SNPrintF(out_buffer_ + out_buffer_pos_, "0x%05x (%d)", code,
code);
int32_t code = instr->Bits(25, 6);
out_buffer_pos_ += base::SNPrintF(out_buffer_ + out_buffer_pos_,
"0x%05x (%d)", code, code);
break;
}
case TGE:
......@@ -544,9 +542,10 @@ void Decoder::PrintMsaImmElm(Instruction* instr) {
void Decoder::PrintMsaCopy(Instruction* instr) {
int32_t rd = instr->WdValue();
int32_t ws = instr->WsValue();
int32_t n = instr - buffer_pos_ +=
rintF(out_buffer_ + out_buffer_po _, "%s, %s[%u]",
converter_.NameOfCPURegister(rd), MSARegisters::Name(ws), n);
int32_t n = instr->MsaElmNValue();
out_buffer_pos_ += base::SNPrintF(out_buffer_ + out_buffer_pos_, "%s, %s[%u]",
converter_.NameOfCPURegister(rd),
MSARegisters::Name(ws), n);
}
void Decoder::PrintFormat(Instruction* instr) {
......@@ -2976,7 +2975,7 @@ int Decoder::InstructionDecode(byte* instr_ptr) {
namespace disasm {
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();
}
......
......@@ -36,6 +36,7 @@ T Nabs(T a) {
// Running with a simulator.
#include "src/base/hashmap.h"
#include "src/base/strings.h"
#include "src/codegen/assembler.h"
#include "src/codegen/mips/constants-mips.h"
#include "src/execution/simulator-base.h"
......@@ -548,7 +549,7 @@ class Simulator : public SimulatorBase {
instr->OpcodeValue());
}
InstructionDecode(instr);
SNPrintF(trace_buf_, " ");
base::SNPrintF(trace_buf_, " ");
}
// ICache.
......
This diff is collapsed.
......@@ -36,6 +36,7 @@ T Nabs(T a) {
// Running with a simulator.
#include "src/base/hashmap.h"
#include "src/base/strings.h"
#include "src/codegen/assembler.h"
#include "src/codegen/mips64/constants-mips64.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