pub struct RiscVTarget {
pub xlen: Xlen,
pub m: bool,
pub a: bool,
pub f: bool,
pub d: bool,
pub c: bool,
pub v: bool,
}Expand description
Base integer ISA plus the standard extensions the backend cares about.
Fields§
§xlen: Xlen§m: boolM: multiply and divide.
a: boolA: atomics.
f: boolF: single-precision float.
d: boolD: double-precision float, implies F.
c: boolC: compressed encodings.
v: boolImplementations§
Source§impl RiscVTarget
impl RiscVTarget
Sourcepub fn from_arch(arch: TargetArchitecture) -> Option<Self>
pub fn from_arch(arch: TargetArchitecture) -> Option<Self>
Default for a bare riscv32/riscv64 target.
G, matching what most toolchains assume, and what this backend already emitted before extensions were modelled at all.
Sourcepub fn word_bytes(self) -> i32
pub fn word_bytes(self) -> i32
Bytes in a general-purpose register.
Sourcepub fn store_word(self) -> &'static str
pub fn store_word(self) -> &'static str
Mnemonic for storing a whole register. sd has no rv32 encoding.
Sourcepub fn require_float(self, is_f32: bool) -> Result<(), String>
pub fn require_float(self, is_f32: bool) -> Result<(), String>
Check the float extension a width needs is present.
F covers f32, D covers f64. Emitting fadd.d on a target without D produces an
instruction the core traps on.
pub fn require_vector(self) -> Result<(), String>
pub fn require_i64(self) -> Result<(), String>
Trait Implementations§
Source§impl Clone for RiscVTarget
impl Clone for RiscVTarget
impl Copy for RiscVTarget
Source§impl Debug for RiscVTarget
impl Debug for RiscVTarget
impl Eq for RiscVTarget
Source§impl PartialEq for RiscVTarget
impl PartialEq for RiscVTarget
impl StructuralPartialEq for RiscVTarget
Auto Trait Implementations§
impl Freeze for RiscVTarget
impl RefUnwindSafe for RiscVTarget
impl Send for RiscVTarget
impl Sync for RiscVTarget
impl Unpin for RiscVTarget
impl UnsafeUnpin for RiscVTarget
impl UnwindSafe for RiscVTarget
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more