arch-riscv: Fix the bug of vsetivli frequently flushing the pipeline (#1526)
This PR fix the bug of vsetivli frequently flushing the pipeline. Here are two pictures of the pipeline illustrate this phenomenon.   The vsetivli(0x00013334.0) instruction in the first picture flushes the pipeline every time it is executed. This is due to vsetivli being incorrectly flagged as a 'DirectControl' instruction. The branch predictor cannot predict it correctly. The second picture is the pipeline after fixing the bug. Change-Id: I5bede47919c06cea86fa23a81624b502fbdc1159
This commit is contained in:
@@ -202,6 +202,7 @@ def template VSetiVliBranchTarget {{
|
||||
rpc.vl(), requested_vl, vlmax, rd_bits, rs1_bits);
|
||||
|
||||
std::unique_ptr<PCState> npc(dynamic_cast<PCState*>(rpc.clone()));
|
||||
npc->set(rvSext(npc->pc() + 4));
|
||||
npc->vtype(new_vtype);
|
||||
npc->vl(new_vl);
|
||||
return npc;
|
||||
|
||||
Reference in New Issue
Block a user