overdrivenpotato / rust-psp

Rust on PSP. Panic and allocation support. Access PSP system libraries.
Other
638 stars 33 forks source link

Add support for missing libm functions #105

Closed overdrivenpotato closed 2 years ago

overdrivenpotato commented 3 years ago

The following code will not compile due to a link error, as fmodf is missing:

fn psp_main() {
    psp::dprintln!("{}", 10f32 % core::hint::black_box(2.0));
}

This can likely be resolved by linking in the libm crate, which has an implementation of fmodf. This should fix any additional missing functions.

Alternatively it may be possible to somehow natively compile this, if the PSP can support such an instruction (perhaps even through VFPU). This would result in much faster code.

overdrivenpotato commented 3 years ago

Initially discovered in #102

sajattack commented 3 years ago

I don't think vfpu has any instructions for modulus.

sajattack commented 2 years ago

fminf/fmaxf as well (used by fontdue)

Lucky4Luuk commented 2 years ago

How is this coming along? Like sajattack, a library I would like to use, uses fminf/fmaxf :p