pub struct Extensions(/* private fields */);Expand description
A set of Extensions.
Adding an extension also adds the extensions it implies (D implies F), and removing one also removes the extensions that imply it (removing F removes D).
use disc_v::{Extension, Extensions};
let exts = Extensions::GC.with(Extension::Zba).without(Extension::D);
assert!(exts.contains(Extension::F));
assert!(!exts.contains(Extension::Q));Implementations§
Source§impl Extensions
impl Extensions
Sourcepub const EMPTY: Extensions
pub const EMPTY: Extensions
No extensions: only the base integer ISA.
Sourcepub const DEFAULT: Extensions
pub const DEFAULT: Extensions
Every supported standard extension that does not conflict with
another. Vendor extensions are left out: they use the custom opcode
spaces, which each vendor’s cores use differently. This is what
decode and the other free functions use.
Sourcepub const GC: Extensions
pub const GC: Extensions
G and C: IMAFD, Zicsr, Zifencei and C, as in RV32GC and RV64GC.
Sourcepub const RVA23U64: Extensions
pub const RVA23U64: Extensions
The extensions of the RVA23U64 profile that define instructions.
Sourcepub const RVA23S64: Extensions
pub const RVA23S64: Extensions
The extensions of the RVA23S64 profile that define instructions: RVA23U64, Zifencei, Svinval and H.
Sourcepub const XTHEAD: Extensions
pub const XTHEAD: Extensions
Every T-Head vendor extension (XThead*), as in T-Head’s C9xx cores.
Sourcepub const XCV: Extensions
pub const XCV: Extensions
Every CORE-V vendor extension (XCV*), as in the OpenHW Group’s CV32E40P core.
Sourcepub const fn of(exts: &[Extension]) -> Extensions
pub const fn of(exts: &[Extension]) -> Extensions
The extensions in exts, and the extensions they imply.
Sourcepub const fn with(self, ext: Extension) -> Extensions
pub const fn with(self, ext: Extension) -> Extensions
The set with ext and the extensions it implies added.
Sourcepub const fn without(self, ext: Extension) -> Extensions
pub const fn without(self, ext: Extension) -> Extensions
The set with ext and the extensions that imply it removed.
C is a bundle of Zca and (with F and D) Zcf and Zcd: removing C removes every compressed instruction, and removing Zcf or Zcd removes C but keeps Zca.
Sourcepub const fn union(self, other: Extensions) -> Extensions
pub const fn union(self, other: Extensions) -> Extensions
The extensions in either set (and the extensions they imply together, such as Zcd for C and D).
Trait Implementations§
Source§impl BitOr for Extensions
impl BitOr for Extensions
Source§type Output = Extensions
type Output = Extensions
| operator.Source§fn bitor(self, other: Extensions) -> Extensions
fn bitor(self, other: Extensions) -> Extensions
| operation. Read more