diff --git a/Jenkinsfile b/Jenkinsfile index ed6cd76..c54953e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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" } } } diff --git a/src/asm/mod.rs b/src/asm/mod.rs index 67fb735..778cd76 100644 --- a/src/asm/mod.rs +++ b/src/asm/mod.rs @@ -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 diff --git a/src/asm/write_asm.rs b/src/asm/write_asm.rs index 4e97fde..73c4e22 100644 --- a/src/asm/write_asm.rs +++ b/src/asm/write_asm.rs @@ -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) }