FPU Emulation Revival for i486SX on NetBSD This retro-computing project restores support for x87 floating-point unit (FPU) emulation in the NetBSD kernel, targeting legacy 486SX-class processors without hardware FPUs. It brings back the original MATH_EMULATE option into NetBSD 10.x and beyond, as well as reverts and reworks the changes introduced in commit dfe83e0, which removed FPU emulation support from the kernel. Disclaimer This project is a work in progress and may contain bugs or incomplete functionality. Use at your own risk. The author is not responsible for any issues caused by its use. Notes fyl2x seems to work properly on FPU, but when executed from libc , log functions bring incorrect results seems to work properly on FPU, but when executed from , functions bring incorrect results Some operations have hard-to-detect issues with precision x87 FPU Emulated Instructions ๐ง Control & Initialization Instruction Status Description Opcode Example fninit โ OK Initialize FPU 9B DB E3 fninit ๐ค Load to FPU Stack Instruction Status Description Opcode Example fld โ OK Load floating-point value D9 /0 fld st(1) fldt โ OK Load 80-bit extended precision DB /5 fldt [mem] filds โ OK Load integer (short) DB /0 filds [mem] fildl โ OK Load long integer DB /A fildl [mem] ๐ค Store from FPU Stack Instruction Status Description Opcode Example fstps โ OK Store and pop single precision D9 /3 fstps [mem] fstpt โ OK Store 80-bit extended precision & pop DB /7 fstpt [mem] โโโ๏ธโ Arithmetic Operations Instruction Status Description Opcode Example fadd โ OK Add floating-point values D8 /0 fadd st(1), st faddl โ OK Add long double from memory DA /0 faddl [mem] fsub โ OK Subtract floating-point values D8 /4 fsub st(1), st fsubp โ OK Subtract with pop DE /5 fsubp st(1), st(0) fmul โ OK Multiply floating-point values D8 /1 fmul st(1), st fdiv โ OK Divide floating-point values D8 /6 fdiv st(1), st fdivp โ OK Divide with pop DE /7 fdivp st(1), st(0) fscale โ OK Scale ST(0) by ST(1) D9 FD fscale ...
First seen: 2025-04-27 22:17
Last seen: 2025-04-28 16:20