Parse `rd, csr` for `csrr` (pseudo: csrrs rd, csr, x0).
(operands: &str)
| 597 | // expanding to the spec's `bge`/`blt` form against x0. |
| 598 | fn parse_branch_vs_zero(mnemonic: &str, operands: &str) -> Option<AsmToken> { |
| 599 | let comma = operands.find(',')?; |
| 600 | let rs = parse_int_reg(operands[..comma].trim())?; |
| 601 | let target = operands[comma + 1..].trim().to_owned(); |
| 602 | if target.is_empty() { |
| 603 | return None; |
| 604 | } |
| 605 | let (kind, rs1, rs2) = match mnemonic { |
| 606 | "blez" => (BranchKind::Bge, 0, rs), // rs <= 0 == 0 >= rs |
| 607 | "bgez" => (BranchKind::Bge, rs, 0), |
| 608 | "bltz" => (BranchKind::Blt, rs, 0), |
| 609 | "bgtz" => (BranchKind::Blt, 0, rs), // rs > 0 == 0 < rs |
no test coverage detected