Hacker News new | ask | show | jobs
by IAmLiterallyAB 1626 days ago
I've been working on speeding up floating point calculations for the RISC-V emulator used by this mod. The trouble is Java doesn't have full IEEE 754 support, specifically features like rounding rules and exceptions. So to support these in the emulator, floating point calculations are done in software.
1 comments

With OPenComputer on 1.7.10 we call out to a compiler .so library for the Lua interpreter which I assume could do floating poin correctly.
Ah yes that could work. Was a little weary about packaging native code, but if other mod developers are doing it it might be a good path.

I'm currently working on calling the C fenv API using the new Java Foreign Function & Memory API, all from pure Java.

To be clear, I'm not the dev behind OC2, just messing with it as a hobbie.