Skip to contentSkip to conversation

broken floating point on mips32

Qemu-devel Vince Weaver 1 participant 1 message Apr 24, 2008

lore
Share & tools
lore
#0 lore raw

Hello

so I spent an entire day trying to figure out why floating point programs run with mips-linux-user were losing the top halves of their values, thus giving wrong results.

In the end it turns out to be because even when running 32-bit binaries on the 32-bit Mips emulation, the "FR" (ie, 64-bit FPU support) bit is being set in the CP0 status register by default. This means programs compiled for 32-bit MIPS are breaking because they assume the old-style hybrid 64/32 floating point register layout.

Quoted 1 line

From reading manuals, it seems like the FR bit should not be set by

default for 32-bit MIPS processors. Is this a bug in the emulation that should be fixed?

For the time being I have a patch that adds a new machine type with the FR bit turned off and things work properly. I was wondering if any MIPS experts out there could tell me what the proper fix is.

Thanks,

Vince