Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

destructive immediate bitfield insert #143

Open
jnk0le opened this issue Sep 9, 2022 · 1 comment
Open

destructive immediate bitfield insert #143

jnk0le opened this issue Sep 9, 2022 · 1 comment

Comments

@jnk0le
Copy link

jnk0le commented Sep 9, 2022

"place n bits from rs1 into [m+n-1 : m] of rd"

  • deprecates insb instruction
  • same thing as PULP p.insert
  • requires 2 * 5 bits of imm for RV32 and 2 * 6 for RV64
  • as P ext is already sourcing 3rd arg from rd (including INSB), it shouldn't be that big of a deal
@jnk0le
Copy link
Author

jnk0le commented Sep 21, 2022

Note that the eqivalent bfp from 0.94 bitmanip is a 3 instruction sequence, 1 of them being loop invariant in equivalent use case.

bitfield inserts are also usefull for uC register acces

// switch PLL (0b10) to HSE (0b01)
RCC->CFGR = (RCC->CFGR & ~RCC_CFGR_SW_Msk) | (RCC_CFGR_SW_HSE);

in this sample 0.94 bfp gives no advantage - andn + or + extra load of RCC_CFGR_SW_Msk solves it in 3 instructions

@jnk0le jnk0le changed the title destructive bitfield insert destructive immediate bitfield insert Oct 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant