| Home | Table of Contents | Please view with Internet Explorer (version 5.00 or higher) and enable scripting. For reasons, see Browsing This Web Site. |
Recent versions of Windows, at least from Windows XP Service Pack 1a, require the 8-byte compare-exchange instruction.
If reading only Intel’s literature, one might think that testing for the CMPXCHG8B instruction is a simple matter of executing the CPUID instruction with 1 in EAX and testing for the CX8 bit (0x0100) in the feature flags that are returned in EDX. However, the Windows kernel makes special cases for other vendors whose processors may implement the CMPXCHG8B instruction without showing the CX8 bit in the feature flags.
This article describes the provisions as actually made by the Windows Vista kernel, and is in no way concerned with how well the implementation corresponds with documentation by the vendors. Some variations are noted for Windows XP (based on inspection of Service Pack 1a). None of these cases are supported by the original Windows 2000.
For a “GenuineTMx86” processor with family ≥ 5 and either
if the CMPXCHG8B instruction is not indicated in the CPUID feature flags, it is enabled by setting the 0x0100 bit in the machine-specific register 0x80860004.
If the CPUID feature flags for a “CentaurHauls” processor do not show support for CMPXCHG8B, then the support is enabled by slightly different methods depending on the family:
The Windows XP kernel knows both these Centaur cases but does not clear the 0x01 bit.
Windows Vista (but not Windows XP) treats all “RiseRiseRise” processors as supporting CMPXCHG8B, even without the CX8 bit in the CPUID feature flags.