mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-14 22:38:46 +00:00
Update skeleton
This commit is contained in:
4
Jenkinsfile
vendored
4
Jenkinsfile
vendored
@@ -40,8 +40,8 @@ pipeline {
|
||||
// can cause `stack-overflow` error when testing stack-intensive code.
|
||||
// For this reason, we need to increase the default size of stack to `8 MiB`.
|
||||
// TODO: delete `--skip test_examples_asmgen`
|
||||
sh "RUST_MIN_STACK=8388608 cargo test -- --skip test_examples_asmgen --skip test_examples_end_to_end"
|
||||
sh "RUST_MIN_STACK=8388608 cargo test --release -- --skip test_examples_asmgen --skip test_examples_end_to_end"
|
||||
sh "RUST_MIN_STACK=8388608 cargo test -- --skip test_examples_asmgen"
|
||||
sh "RUST_MIN_STACK=8388608 cargo test --release -- --skip test_examples_asmgen"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,6 +79,8 @@ impl Block {
|
||||
/// https://github.com/rv8-io/rv8-io.github.io/blob/master/asm.md#assembler-directives
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum Directive {
|
||||
/// .align integer
|
||||
Align(usize),
|
||||
/// .globl symbol
|
||||
Globl(Label),
|
||||
/// .section section_type
|
||||
|
||||
@@ -77,6 +77,7 @@ impl WriteLine for Block {
|
||||
impl WriteString for Directive {
|
||||
fn write_string(&self) -> String {
|
||||
match self {
|
||||
Self::Align(value) => format!(".align\t{}", value),
|
||||
Self::Globl(label) => format!(".globl\t{}", label.0),
|
||||
Self::Type(symbol, symbol_type) => {
|
||||
format!(".type\t{}, {}", symbol.0, symbol_type.write_string())
|
||||
@@ -381,7 +382,7 @@ impl WriteString for UType {
|
||||
impl WriteString for Pseudo {
|
||||
fn write_string(&self) -> String {
|
||||
match self {
|
||||
Self::Li { rd, imm } => format!("li\t{},{:#x?}", rd.write_string(), imm),
|
||||
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::Neg { data_size, rd, rs } => format!(
|
||||
"neg{}\t{},{}",
|
||||
@@ -412,7 +413,7 @@ impl WriteString for Pseudo {
|
||||
impl WriteString for Immediate {
|
||||
fn write_string(&self) -> String {
|
||||
match self {
|
||||
Self::Value(value) => format!("{:#x?}", value),
|
||||
Self::Value(value) => format!("{}", *value as i64),
|
||||
Self::Relocation { relocation, symbol } => {
|
||||
format!("{}({})", relocation.write_string(), symbol.0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user