Module riscv_shared

Source
Expand description

Shared RISC-V intrinsics

ยงMissing floating-point register instructions

We are deliberately not providing instructions that could change the floating-point rounding mode or exception behavior or read the accrued exceptions flags: frcsr, fscsr, fsrm, frflags, fsflags.

Rust makes no guarantees whatsoever about the contents of the accrued exceptions register: Rust floating-point operations may or may not result in this register getting updated with exception state, and the register can change between two invocations of this function even when no floating-point operations appear in the source code (since floating-point operations appearing earlier or later can be reordered).

Modifying the rounding mode leads to immediate Undefined Behavior: Rust assumes that the default rounding mode is always set and will optimize accordingly. This even applies when the rounding mode is altered and later reset to its original value without any floating-point operations appearing in the source code between those operations (since floating-point operations appearing earlier or later can be reordered).

If you need to perform some floating-point operations and check whether they raised an exception, use a single inline assembly block for the entire sequence of operations.

If you need to perform some floating-point operations under a differen rounding mode, use a single inline assembly block and make sure to restore the original rounding mode before the end of the block.

Re-exportsยง

pub use p::*;
pub use zb::*;
pub use zk::*;

Modulesยง

p ๐Ÿ”’
RISC-V Packed SIMD intrinsics; shared part.
zb ๐Ÿ”’
zk ๐Ÿ”’

Functionsยง

fence_iโš Experimental
Generates the FENCE.I instruction
frrmExperimental
Reads the floating-point rounding mode register frm
hfence_gvmaโš Experimental
Hypervisor memory management fence for guest physical address and virtual machine
hfence_gvma_allโš Experimental
Hypervisor memory management fence for all virtual machines and guest physical addresses
hfence_gvma_gaddrโš Experimental
Hypervisor memory management fence for guest physical address
hfence_gvma_vmidโš Experimental
Hypervisor memory management fence for given virtual machine
hfence_vvmaโš Experimental
Hypervisor memory management fence for given guest virtual address and guest address space
hfence_vvma_allโš Experimental
Hypervisor memory management fence for all guest address spaces and guest virtual addresses
hfence_vvma_asidโš Experimental
Hypervisor memory management fence for given guest address space
hfence_vvma_vaddrโš Experimental
Hypervisor memory management fence for given guest virtual address
hinval_gvmaโš Experimental
Invalidate hypervisor translation cache for guest physical address and virtual machine
hinval_gvma_allโš Experimental
Invalidate hypervisor translation cache for all virtual machines and guest physical addresses
hinval_gvma_gaddrโš Experimental
Invalidate hypervisor translation cache for guest physical address
hinval_gvma_vmidโš Experimental
Invalidate hypervisor translation cache for given virtual machine
hinval_vvmaโš Experimental
Invalidate hypervisor translation cache for given guest virtual address and guest address space
hinval_vvma_allโš Experimental
Invalidate hypervisor translation cache for all guest address spaces and guest virtual addresses
hinval_vvma_asidโš Experimental
Invalidate hypervisor translation cache for given guest address space
hinval_vvma_vaddrโš Experimental
Invalidate hypervisor translation cache for given guest virtual address
hlv_bโš Experimental
Loads virtual machine memory by signed byte integer
hlv_buโš Experimental
Loads virtual machine memory by unsigned byte integer
hlv_hโš Experimental
Loads virtual machine memory by signed half integer
hlv_huโš Experimental
Loads virtual machine memory by unsigned half integer
hlv_wโš Experimental
Loads virtual machine memory by signed word integer
hlvx_huโš Experimental
Accesses virtual machine instruction by unsigned half integer
hlvx_wuโš Experimental
Accesses virtual machine instruction by unsigned word integer
hsv_bโš Experimental
Stores virtual machine memory by byte integer
hsv_hโš Experimental
Stores virtual machine memory by half integer
hsv_wโš Experimental
Stores virtual machine memory by word integer
nopExperimental
Generates the NOP instruction
pauseExperimental
Generates the PAUSE instruction
sfence_inval_irโš Experimental
Generates the SFENCE.INVAL.IR instruction
sfence_vmaโš Experimental
Supervisor memory management fence for given virtual address and address space
sfence_vma_allโš Experimental
Supervisor memory management fence for all address spaces and virtual addresses
sfence_vma_asidโš Experimental
Supervisor memory management fence for given address space
sfence_vma_vaddrโš Experimental
Supervisor memory management fence for given virtual address
sfence_w_invalโš Experimental
Generates the SFENCE.W.INVAL instruction
sinval_vmaโš Experimental
Invalidate supervisor translation cache for given virtual address and address space
sinval_vma_allโš Experimental
Invalidate supervisor translation cache for all address spaces and virtual addresses
sinval_vma_asidโš Experimental
Invalidate supervisor translation cache for given address space
sinval_vma_vaddrโš Experimental
Invalidate supervisor translation cache for given virtual address
wfiโš Experimental
Generates the WFI instruction