Skip to content

Implement LLVM intrinsics for Div and Mod so that / and % work "normally" on the GBA #8

@Lokathor

Description

@Lokathor

So, if we implement the correct special function, then we can make code like

let a = x / y;

Will suddenly magically work on the GBA.

#[no_mangle] extern "aapcs" fn __aeabi_uidiv(num: u32: denom: u32) -> u32
#[no_mangle] extern "aapcs" fn __aeabi_idiv(num: i32: denom: i32) -> u32

Question

Do we want division to magically work like that?

Personally, I think that division is so damn costly on the GBA that I want it to be called as a special function or even as a macro (which makes it look a little weird) just so that people remember that they're doing a weird and costly operation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions