Commit ccece727 authored by Liu Yu's avatar Liu Yu Committed by V8 LUCI CQ

[mips] Do not use SimInstructionBase's implicit copy constructor

Change-Id: I99351dd92dacf4d8d9160b2e33213b830657516e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3131952Reviewed-by: 's avatarZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Auto-Submit: Liu yu <liuyu@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#76595}
parent a9062f88
......@@ -6865,14 +6865,16 @@ void Simulator::DecodeTypeImmediate() {
// Type 3: instructions using a 26 bytes immediate. (e.g. j, jal).
void Simulator::DecodeTypeJump() {
SimInstruction simInstr = instr_;
// instr_ will be overwritten by BranchDelayInstructionDecode(), so we save
// the result of IsLinkingInstruction now.
bool isLinkingInstr = instr_.IsLinkingInstruction();
// Get current pc.
int32_t current_pc = get_pc();
// Get unchanged bits of pc.
int32_t pc_high_bits = current_pc & 0xF0000000;
// Next pc.
int32_t next_pc = pc_high_bits | (simInstr.Imm26Value() << 2);
int32_t next_pc = pc_high_bits | (instr_.Imm26Value() << 2);
// Execute branch delay slot.
// We don't check for end_sim_pc. First it should not be met as the current pc
......@@ -6883,7 +6885,7 @@ void Simulator::DecodeTypeJump() {
// Update pc and ra if necessary.
// Do this after the branch delay execution.
if (simInstr.IsLinkingInstruction()) {
if (isLinkingInstr) {
set_register(31, current_pc + 2 * kInstrSize);
}
set_pc(next_pc);
......
......@@ -7285,13 +7285,15 @@ void Simulator::DecodeTypeImmediate() {
// Type 3: instructions using a 26 bytes immediate. (e.g. j, jal).
void Simulator::DecodeTypeJump() {
SimInstruction simInstr = instr_;
// instr_ will be overwritten by BranchDelayInstructionDecode(), so we save
// the result of IsLinkingInstruction now.
bool isLinkingInstr = instr_.IsLinkingInstruction();
// Get current pc.
int64_t current_pc = get_pc();
// Get unchanged bits of pc.
int64_t pc_high_bits = current_pc & 0xFFFFFFFFF0000000;
// Next pc.
int64_t next_pc = pc_high_bits | (simInstr.Imm26Value() << 2);
int64_t next_pc = pc_high_bits | (instr_.Imm26Value() << 2);
// Execute branch delay slot.
// We don't check for end_sim_pc. First it should not be met as the current pc
......@@ -7302,7 +7304,7 @@ void Simulator::DecodeTypeJump() {
// Update pc and ra if necessary.
// Do this after the branch delay execution.
if (simInstr.IsLinkingInstruction()) {
if (isLinkingInstr) {
set_register(31, current_pc + 2 * kInstrSize);
}
set_pc(next_pc);
......
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