You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're currently using libm to implement the missing compiler builtins for f32 and f64 primitives. The libm crate implements these builtins in Rust. While it provides a very workable springboard to get started quickly, it leaves a lot to be desired with fast math.
The N64 CPU supports many of these operations natively through the floating point unit, COP1. Here's a table summarizing the builtin to FPU instruction relationships:
builtin
FPU instruction
fabs
abs.d
fabsf
abs.s
ceil
ceil.l.d, cvt.d.l
ceilf
ceil.w.s, cvt.s.w
floor
floor.l.d, cvt.d.l
floorf
floor.w.s, cvt.s.w
round
round.l.d, cvt.d.l
roundf
round.w.s, cvt.s.w
sqrt
sqrt.d
sqrtf
sqrt.s
trunc
trunc.l.d, cvt.d.l
truncf
trunc.w.s, cvt.s.w
Another alternative is using LLVM intrinsics from rustc. (How?)
We're currently using
libm
to implement the missing compiler builtins forf32
andf64
primitives. Thelibm
crate implements these builtins in Rust. While it provides a very workable springboard to get started quickly, it leaves a lot to be desired with fast math.The N64 CPU supports many of these operations natively through the floating point unit, COP1. Here's a table summarizing the builtin to FPU instruction relationships:
fabs
abs.d
fabsf
abs.s
ceil
ceil.l.d, cvt.d.l
ceilf
ceil.w.s, cvt.s.w
floor
floor.l.d, cvt.d.l
floorf
floor.w.s, cvt.s.w
round
round.l.d, cvt.d.l
roundf
round.w.s, cvt.s.w
sqrt
sqrt.d
sqrtf
sqrt.s
trunc
trunc.l.d, cvt.d.l
truncf
trunc.w.s, cvt.s.w
Another alternative is using LLVM intrinsics from rustc. (How?)
The text was updated successfully, but these errors were encountered: