[PATCH, i386]: Committed: Switch K8 processors to PTA_NO_SAHF

Uros Bizjak ubizjak@gmail.com
Fri Mar 16 12:44:00 GMT 2007


Hello!

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:

--cut here--
110 SAHF/LAHF Extended Feature Flag Defaults to Incorrect Value

Description

The Extended Feature Flag bit defined for SAHF and LAHF instruction
support in 64-bit mode is ECX[0]. 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.

Suggested Workaround

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[0] to be set.

Fix Planned

Yes
--cut here--

2007-03-16  Uros Bizjak  <ubizjak@gmail.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.

Uros.

Uros.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: i386-amd-no-sahf.diff
Type: application/octet-stream
Size: 1595 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070316/0df673b7/attachment.obj>


More information about the Gcc-patches mailing list