ab_riscv_interpreter/rv32/b/zbb/
rv32_zbb_helpers.rs1#[inline(always)]
4#[doc(hidden)]
5#[cfg_attr(feature = "no-panic", no_panic_const::no_panic)]
6pub fn orc_b(src: u32) -> u32 {
7 cfg_select! {
9 all(not(miri), target_arch = "riscv32", target_feature = "zbb") => {
10 unsafe { core::arch::riscv32::orc_b(src as usize) as u32 }
12 }
13 _ => {{
14 let mut bytes = src.to_le_bytes();
15 for byte in &mut bytes {
16 *byte = if *byte != 0 { 0xFF } else { 0 };
17 }
18 u32::from_le_bytes(bytes)
19 }}
20 }
21}