Port-amd64 archive

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

Re: cpuflags (optimal compiler flags for building)



On Fri, 5 Dec 2008, Thomas E. Spanjaard wrote:

Thomas E. Spanjaard wrote:
It recommends '-march=pentium3' on a NetBSD/amd64 5.99.01 box (GCC
4.1.3), with an Intel Core 2 Quad CPU at 3GHz (Kentsfield core). The
best fit for GCC 4.1.3 would be '-march=nocona', and less so
'-march=pentium-m'. Newer GCC versions support keywords for the Core 2,
but I haven't checked whether your script checks the GCC version and
keeps a list of supported options.

I just read the source, and I see that you use '-march=pentium3' as
fallback for '-march=core2' for older GCC versions; I'd suggest using
'-march=nocona' instead, because it flags the target as supporting SSE2
and SSE3. Instruction reordering by the compiler would theoretically
benefit most from '-march=pentium-m' on older GCCs, but that lacks SSE3
and x86-64. One snag could be that when using any of the Netburst types
makes the compiler avoid things like ro{r,l}, but I have no clue as to
how GCC really behaves with these flags.

        From cpuflags-1.22 it should automatically set -msse3 based
        on the features flags reported by cpuctl or from dmesg, so
        the fallback should be based on scheduling rather than SSE
        support?

        Based on that core2 should probably fall back to pentium-m first,
        and then pentium-m to pentium3 - I'll adjust the logic - thanks

--
                David/absolute       -- www.NetBSD.org: No hype required --


Home | Main Index | Thread Index | Old Index