MIPS 32-bit: Single perc. floating point constants in .rodata?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am in the process of rewriting some old code from ~1998 that was
originally built with GCC (don't know the exact version number). The
goal of the rewrite was to produce faster and more compact code, which
has been an easy task so far considering how well GCC's optimization
ability has progressed since then. Unexpectedly, my new program was
larger than the original, and it turns out that this was due to 32-bit
floating point constants being thrown into '.rodata', loaded from
there, and then stored at their target. So,
    lui     v0,0x809c
    lwc1    $f0,8192(v0)
    swc1    $f0,424(s0)
Was being generated, whereas the original 1998 code had this:
    lui     at,0x3f00
    mtc1    at,$f4
    swc1    $f4,424(s0)
It's also important to note that the above could be simplified down to:
    lui     at,0x3f00
    sw      at,424(s0)

Is there a switch that controls this behavior? If not, when did GCC
stop behaving this (1998) way, and why? Potential 4-byte instruction
overhead and 4-byte data overhead seems like a big waste to me!

Regards,
Marshall

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux