-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Open
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.FixPendingIssues that have a fix which has not yet been reviewed or submitted.Issues that have a fix which has not yet been reviewed or submitted.arch-riscvIssues solely affecting the riscv64 architecture.Issues solely affecting the riscv64 architecture.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Milestone
Description
Based on The RISC-V Instruction Set Manual, not only X0 register but also X5 register can be used to be a link register. As described in Chapter 2.5.1, when two different link registers (x1 and x5) are given as rs1 and rd, the Return-address prediction stacks(RAS) will pop then push.
The Go runtime’s handwritten assembly and the code generated by the Go compiler incorrectly emit JALR X1, X5 instruction. When a function call uses x5 as the source register for JALR, it causes unintended RAS behavior. Although functionally correct, these instructions make the RAS perform a pop-then-push instead of a normal push, breaking call/return pairing and significantly degrading front-end branch prediction performance.
wangpc-pp
Metadata
Metadata
Assignees
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.FixPendingIssues that have a fix which has not yet been reviewed or submitted.Issues that have a fix which has not yet been reviewed or submitted.arch-riscvIssues solely affecting the riscv64 architecture.Issues solely affecting the riscv64 architecture.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Type
Projects
Status
In Progress