feat(asm): encode indirect JMP and CALL on all four architectures
Assisted-by: GLM 5.3 Flash
This commit is contained in:
+10
-3
@@ -93,12 +93,19 @@ func riscvIsLeaf(t *ast.Text) bool {
|
||||
return false
|
||||
}
|
||||
case "JALR":
|
||||
// JALR rs1, rd, a call when rd is X1; JALR offset(rs1) always
|
||||
// links to X1.
|
||||
// JALR rd, offset(rs1) links when the destination register (the
|
||||
// first operand) is X1; JALR rs1, rd links when the second
|
||||
// register is X1; JALR offset(rs1) always links to X1.
|
||||
if len(in.Operands) == 1 {
|
||||
return false
|
||||
}
|
||||
if len(in.Operands) >= 2 && regFromOperand(in.Operands[1]) == 1 {
|
||||
if isMemOperand(in.Operands[1]) {
|
||||
if regFromOperand(in.Operands[0]) == 1 {
|
||||
return false
|
||||
}
|
||||
continue
|
||||
}
|
||||
if regFromOperand(in.Operands[1]) == 1 {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user