mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-16 15:38:48 +00:00
Update skeleton
This commit is contained in:
@@ -523,6 +523,8 @@ pub enum UType {
|
||||
/// https://riscv.org/specifications/isa-spec-pdf/ (139p)
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum Pseudo {
|
||||
/// la rd, symbol
|
||||
La { rd: Register, symbol: Label },
|
||||
/// li rd, immediate
|
||||
Li {
|
||||
rd: Register,
|
||||
|
||||
@@ -384,6 +384,7 @@ impl WriteString for UType {
|
||||
impl WriteString for Pseudo {
|
||||
fn write_string(&self) -> String {
|
||||
match self {
|
||||
Self::La { rd, symbol } => format!("la\t{},{}", rd.write_string(), symbol.0),
|
||||
Self::Li { rd, imm } => format!("li\t{},{}", rd.write_string(), *imm as i64),
|
||||
Self::Mv { rd, rs } => format!("mv\t{},{}", rd.write_string(), rs.write_string()),
|
||||
Self::Fmv { data_size, rd, rs } => format!(
|
||||
|
||||
Reference in New Issue
Block a user