Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

[32bit] branch on single bit #170

@jnk0le

Description

@jnk0le

very common construct in peripheral/IO bound uC code

if (USART1->ISR & (1 << USART_ISR_RXNE_Pos)) { }

Normally the status bit needs to be extracted by andi or bexti followed by beqz/bnez

we could fuse the bexti + branch at quite low decoding cost

  • addres offset stays the same
  • shamt in place of rs2/imm5 as in beqi/bnei as well as bexti

only downsides are that the BRANCH major op can't fit another 2 branch instructions, and encoding is problematic on RV64.

On RV32E with peripherals mapped to upper GPRs we gain something like AVR8 SBIS/SBIC instruction

Metadata

Metadata

Assignees

No one assigned

    Labels

    future ideaSomething for a future version of the spec

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions