Kernel/userspace: rework floating point math

SSE is now unconditionally enabled any where and most of math.h is now
actually implemented. using __builtin_<func> lead to many hangs where
the builtin function would just call itself.
This commit is contained in:
2024-11-03 20:25:35 +02:00
parent ed19bb11fe
commit f4be37700f
18 changed files with 827 additions and 210 deletions

View File

@@ -182,9 +182,7 @@ namespace Kernel
if (tid)
{
auto& thread = Thread::current();
#if __enable_sse
thread.save_sse();
#endif
if (isr == ISR::PageFault && Thread::current().is_userspace())
{
@@ -318,12 +316,8 @@ namespace Kernel
ASSERT(Thread::current().state() != Thread::State::Terminated);
done:
#if __enable_sse
done:
Thread::current().load_sse();
#else
return;
#endif
}
extern "C" void cpp_yield_handler(InterruptStack* interrupt_stack, InterruptRegisters* interrupt_registers)
@@ -376,9 +370,7 @@ done:
asm volatile("cli; 1: hlt; jmp 1b");
}
#if __enable_sse
Thread::current().save_sse();
#endif
if (!InterruptController::get().is_in_service(irq))
dprintln("spurious irq 0x{2H}", irq);
@@ -399,9 +391,7 @@ done:
ASSERT(Thread::current().state() != Thread::State::Terminated);
#if __enable_sse
Thread::current().load_sse();
#endif
}
void IDT::register_interrupt_handler(uint8_t index, void (*handler)())