Hello, I have an issue with GCC where it for some reason generates FPU instructions for 64 bit math when building for i686.
Example:
Code:
c0171197: df 2d 70 21 1a c0 fild QWORD PTR ds:0xc01a2170
c017119d: df 7d e0 fistp QWORD PTR [ebp-0x20]
This is the piece of code generated when calling my sleep function.
Code:
inline void for_seconds(u64 time)
{
until(Timer::nanoseconds_since_boot() + (time * Time::nanoseconds_in_second));
}
When i tried adding -mgeneral-regs-only the linker generated a bunch of undefined references to __atomic_load_8.
Why does this happen?
....
I think I got it. Unfortunately i was trying to use a 64 bit atomic counter in my kernel and i think on 32 bit GCC implements
it via FPU QWORD load and store
... Is that true? Can anyone link any resources that talk about this?