[PATCH, i386]: Committed: Switch K8 processors to PTA_NO_SAHF
Fri Mar 16 12:44:00 GMT 2007
We learned the hard way that some K8 processors also lack SAHF
instruction. All K8 processors have to be switched to PTA_NO_SAHF, but
the support can still be detected with -march=native.
BTW: There is an AMD errata in this area:
110 SAHF/LAHF Extended Feature Flag Defaults to Incorrect Value
The Extended Feature Flag bit defined for SAHF and LAHF instruction
support in 64-bit mode is ECX. However some processors that support
the feature incorrectly return it as zero.
Potential Effect on System
The operating system will not see the feature flag and therefore the
extended feature will not be used.
For processors which support the feature (as determined by the
processor revision ID), BIOS should write a one to:
• MSR C001_100Dh, bit 32 for revision D silicon.
• MSR C001_1005h, bit 32 for revision E and later silicon.
This will cause the extended feature flag in ECX to be set.
2007-03-16 Uros Bizjak <email@example.com>
* config/i386/i386.c (override_options): Add PTA_NO_SAHF to k8,
opteron, athlon-64 and athlon-fx processor_alias_table entries.
Patch is bootstrapped on i686-pc-linux-gnu, commited to SVN mainline.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1595 bytes
Desc: not available
More information about the Gcc-patches