-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [Please CC me, I'm not subscribed] Hello! I noticed that gcc mixes x87 with sse code on x86_64. Consider the following: - ------------------------------------------------------------------- $ gcc -v Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.2/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man - --infodir=/usr/share/info --enable-shared - Thread model: posix gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3) $ uname -a Linux amd64-linux1.sourceforge.net 2.6.9-1.667smp #1 SMP Tue Nov 2 15:09:11 EST 2004 x86_64 x86_64 x86_64 GNU/Linux $ cat test.cc void blub(double *out, double in) { float a, b; b = in; a = b+b; *out = a; } $ gcc -S -O2 -o test.S test.cc $ cat test.S .file "test.cc" .text .align 2 .p2align 4,,15 .globl _Z4blubPdd .type _Z4blubPdd, @function _Z4blubPdd: .LFB2: cvtsd2ss %xmm0, %xmm0 addss %xmm0, %xmm0 movss %xmm0, -12(%rsp) flds -12(%rsp) fstpl (%rdi) ret .LFE2: [..] - ------------------------------------------------------------------- IMHO the flds/fstpl pair could easily replaced by cvtsd2ss. Is this intentional or already fixed in later versions? Unfortunately I have no other gcc to try out than the sourceforge compile farm. (Additionally it looks rather odd that it's using a stack slot without allocating it, but I'm not that familiar with the x86_64 platform/ABI) Sebastian -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEVAwUBRCKyjv81M8QtvOSJAQIHmAgAjTqNBrxCx70r7/2sa5tP/zqOmWTsO5fx W/QLAori7tlhTuvtZXoQRuNvBavaIySv+qCyVYrfz6PwYCws2k132ED6CtyBTIZg Gm9/9O29tLxywZXoo2oYFIjClIe5flfGFE7g0PdpHOoHaKrB4kZuhS+fXWFLeNBY CkTK26BAzt4kk2pLS4hWHeXfsGNmWPSeY4grMP+3TlEhwaFyHeGv4Ylh/5Z2j2zq IxONCTBxSBjmd9g1T7SsQkDmonwzzcdV3zdaDZNEFtq1O3UBpvFxTcjPaHXlU7kJ /2uwc38mb45qe3wH+qcoWFv2mcQA9U7xz0VcrcMGhNL7ugnh8D0oHA== =1KRj -----END PGP SIGNATURE-----