Open jnk0le opened 2 years ago
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
"place n bits from rs1 into [m+n-1 : m] of rd"
insb
instructionp.insert