mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-16 15:38:48 +00:00
Update
This commit is contained in:
@@ -5,7 +5,7 @@ use crate::ir;
|
||||
use core::convert::TryFrom;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct TODO {}
|
||||
pub struct Todo {}
|
||||
|
||||
/// TODO
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
@@ -616,9 +616,9 @@ impl Immediate {
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum RelocationFunction {
|
||||
/// %hi
|
||||
HI20,
|
||||
Hi20,
|
||||
/// %lo
|
||||
LO12,
|
||||
Lo12,
|
||||
}
|
||||
|
||||
/// `Label` is used as branch, unconditional jump targets and symbol offsets.
|
||||
@@ -676,17 +676,11 @@ impl TryFrom<ir::Dtype> for DataSize {
|
||||
|
||||
impl DataSize {
|
||||
pub fn is_integer(&self) -> bool {
|
||||
match self {
|
||||
Self::Byte | Self::Half | Self::Word | Self::Double => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(self, Self::Byte | Self::Half | Self::Word | Self::Double)
|
||||
}
|
||||
|
||||
pub fn is_floating_point(&self) -> bool {
|
||||
match self {
|
||||
Self::SinglePrecision | Self::DoublePrecision => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(self, Self::SinglePrecision | Self::DoublePrecision)
|
||||
}
|
||||
|
||||
fn word(self) -> Option<Self> {
|
||||
|
||||
@@ -434,8 +434,8 @@ impl WriteString for Immediate {
|
||||
impl WriteString for RelocationFunction {
|
||||
fn write_string(&self) -> String {
|
||||
match self {
|
||||
Self::HI20 => "%hi",
|
||||
Self::LO12 => "%lo",
|
||||
Self::Hi20 => "%hi",
|
||||
Self::Lo12 => "%lo",
|
||||
}
|
||||
.to_string()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user