temporarily do not provide our own aeabi divisions

This commit is contained in:
Lokathor 2022-09-27 11:20:05 -06:00
parent 9d06d92067
commit e31f796375
2 changed files with 9 additions and 5 deletions

View file

@ -11,6 +11,9 @@ fn panic_handler(_: &core::panic::PanicInfo) -> ! {
static KEYS: GbaCell<KeyInput> = GbaCell::new(KeyInput::new());
#[link_section = ".ewram"]
static VALUE: GbaCell<u16> = GbaCell::new(0);
extern "C" fn irq_handler(_: u16) {
// just as a demo, we'll read the keys during vblank.
KEYS.write(KEYINPUT.read());
@ -29,6 +32,7 @@ extern "C" fn main() -> ! {
VBlankIntrWait();
let k = KEYS.read();
VALUE.write((k.to_u16() + 3) / k.to_u16()); // force a runtime division
BACKDROP_COLOR.write(Color(k.to_u16()));
}
}

View file

@ -314,7 +314,7 @@ unsafe extern "C" fn runtime_irq_handler() {
///
/// [aeabi-division-by-zero]: https://github.com/ARM-software/abi-aa/blob/main/rtabi32/rtabi32.rst#division-by-zero
#[naked]
#[no_mangle]
//#[no_mangle]
#[instruction_set(arm::a32)]
// this should literally never get called for real, so we leave it in ROM
extern "C" fn __aeabi_idiv0(numerator: i32) -> i32 {
@ -339,7 +339,7 @@ extern "C" fn __aeabi_idiv0(numerator: i32) -> i32 {
/// [aeabi-integer-32-32-division]:
/// https://github.com/ARM-software/abi-aa/blob/main/rtabi32/rtabi32.rst#integer-32-32-32-division-functions
#[naked]
#[no_mangle]
//#[no_mangle]
#[instruction_set(arm::a32)]
#[link_section = ".iwram.aeabi.uidiv"]
extern "C" fn __aeabi_uidiv(numerator: u32, denominator: u32) -> u32 {
@ -383,7 +383,7 @@ extern "C" fn __aeabi_uidiv(numerator: u32, denominator: u32) -> u32 {
/// [aeabi-integer-32-32-division]:
/// https://github.com/ARM-software/abi-aa/blob/main/rtabi32/rtabi32.rst#integer-32-32-32-division-functions
#[naked]
#[no_mangle]
//#[no_mangle]
#[instruction_set(arm::a32)]
#[link_section = ".iwram.aeabi.idiv"]
extern "C" fn __aeabi_idiv(numerator: i32, denominator: i32) -> u32 {
@ -421,7 +421,7 @@ extern "C" fn __aeabi_idiv(numerator: i32, denominator: i32) -> u32 {
/// [aeabi-integer-32-32-division]:
/// https://github.com/ARM-software/abi-aa/blob/main/rtabi32/rtabi32.rst#integer-32-32-32-division-functions
#[naked]
#[no_mangle]
//#[no_mangle]
#[instruction_set(arm::a32)]
#[link_section = ".iwram.aeabi.uidivmod"]
extern "C" fn __aeabi_uidivmod(numerator: u32, denominator: u32) -> u64 {
@ -457,7 +457,7 @@ extern "C" fn __aeabi_uidivmod(numerator: u32, denominator: u32) -> u64 {
/// [aeabi-integer-32-32-division]:
/// https://github.com/ARM-software/abi-aa/blob/main/rtabi32/rtabi32.rst#integer-32-32-32-division-functions
#[naked]
#[no_mangle]
//#[no_mangle]
#[instruction_set(arm::a32)]
#[link_section = ".iwram.aeabi.idivmod"]
extern "C" fn __aeabi_idivmod(numerator: i32, denominator: i32) -> u64 {