make the inliner checker into a generic asm checker.

This commit is contained in:
Lokathor 2022-12-04 16:44:08 -07:00
parent 5de0f5e9f2
commit eb5995bf1d
4 changed files with 19 additions and 26 deletions

View file

@ -1,3 +1,3 @@
cargo build --examples --verbose
arm-none-eabi-objdump --headers --disassemble --demangle --architecture=armv4t --no-show-raw-insn -Mreg-names-std target/thumbv4t-none-eabi/debug/examples/hello >target/dump-hello.txt
arm-none-eabi-objdump --headers --disassemble --demangle --architecture=armv4t --no-show-raw-insn -Mreg-names-std target/thumbv4t-none-eabi/debug/examples/instruction_inline >target/dump-instruction_inline.txt
arm-none-eabi-objdump --headers --disassemble --demangle --architecture=armv4t --no-show-raw-insn -Mreg-names-std target/thumbv4t-none-eabi/debug/examples/asm_scratch >target/dump-asm_scratch.txt

View file

@ -1,4 +1,4 @@
#!/bin/sh
cargo build --examples --verbose
arm-none-eabi-objdump --headers --disassemble --demangle --architecture=armv4t --no-show-raw-insn -Mreg-names-std target/thumbv4t-none-eabi/debug/examples/hello >target/dump-hello.txt
arm-none-eabi-objdump --headers --disassemble --demangle --architecture=armv4t --no-show-raw-insn -Mreg-names-std target/thumbv4t-none-eabi/debug/examples/instruction_inline >target/dump-instruction_inline.txt
arm-none-eabi-objdump --headers --disassemble --demangle --architecture=armv4t --no-show-raw-insn -Mreg-names-std target/thumbv4t-none-eabi/debug/examples/asm_scratch >target/dump-asm_scratch.txt

17
examples/asm_scratch.rs Normal file
View file

@ -0,0 +1,17 @@
#![no_std]
#![no_main]
#![allow(unused_imports)]
//! Scratch space for checking the asm output of stuff.
use gba::prelude::*;
#[panic_handler]
fn panic_handler(_: &core::panic::PanicInfo) -> ! {
loop {}
}
#[no_mangle]
extern "C" fn main() -> ! {
loop {}
}

View file

@ -1,24 +0,0 @@
#![no_std]
#![no_main]
use gba::prelude::*;
#[panic_handler]
fn panic_handler(_: &core::panic::PanicInfo) -> ! {
loop {}
}
//#[inline(always)]
#[instruction_set(arm::a32)]
fn make_3rd_bg_pal_entry_black() {
let x: u16;
unsafe { core::arch::asm!("movs {}, #0", out(reg) x) };
BG_PALETTE.index(3).write(Color(x));
}
#[no_mangle]
#[instruction_set(arm::t32)]
extern "C" fn main() -> ! {
make_3rd_bg_pal_entry_black();
loop {}
}