pub struct RegInfo { /* private fields */ }Expand description
One physical register: its name, its class, and its hardware number.
§Examples
use backend_lang::x86_64::{self, GPR, R12};
let r12 = x86_64::TARGET.reg(R12);
assert_eq!(r12.name(), "r12");
assert_eq!(r12.class(), GPR);
assert_eq!(r12.hw(), 12);Implementations§
Source§impl RegInfo
impl RegInfo
Sourcepub const fn new(name: &'static str, class: RegClass, hw: u8) -> RegInfo
pub const fn new(name: &'static str, class: RegClass, hw: u8) -> RegInfo
Describes a register named name in class, encoded as hw (the
number the ISA’s instruction fields carry).
§Examples
use backend_lang::RegClass;
use backend_lang::target::RegInfo;
let r = RegInfo::new("r0", RegClass::new(0), 0);
assert_eq!(r.name(), "r0");Sourcepub const fn name(&self) -> &'static str
pub const fn name(&self) -> &'static str
The register’s assembly name.
§Examples
use backend_lang::x86_64::{self, XMM3};
assert_eq!(x86_64::TARGET.reg(XMM3).name(), "xmm3");Trait Implementations§
impl Copy for RegInfo
impl Eq for RegInfo
impl StructuralPartialEq for RegInfo
Auto Trait Implementations§
impl Freeze for RegInfo
impl RefUnwindSafe for RegInfo
impl Send for RegInfo
impl Sync for RegInfo
impl Unpin for RegInfo
impl UnsafeUnpin for RegInfo
impl UnwindSafe for RegInfo
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