RtGetEnabledXStateFeature

RtGetEnabledXStateFeature obtains the highest feature for a specified XState feature set supported on the running processor and enabled by RTX64.

Syntax

BOOL RtGetEnabledXStateFeature(
    XSTATE_BIT XStateBit,
    PENABLED_HIGHEST_FEATURE HighestFeature
);

Parameters

XStateBit

The XState feature set to obtain:

Values Description
XStateFPU MMX registers support
XStateSSE SSE registers supported
XStateAVX AVX registers supported
XStateMPX MPX registers supported
XStatePT PT registers supported

HighestFeature

A pointer to an ENABLED_HIGHEST_FEATURE structure which will be filled in with the highest version supported by the XState feature queried.

Return Value

Non-zero if the function completes successfully. Otherwise, the return value is zero.

Remarks

An RTSS application should call this function to determine what features are present and enabled on RTX64 before using an XState processor feature:

XState Values Description
All states NotSupported Floating point is not supported
XStateFPU x87FPU Floating point is supported
XStateSSE SSE SSE is supported
  SSE2 SSE/SSE2 is supported
  SSE3 SSE/SSE2/SSE3 is supported
  SSE4_1 SSE/SSE2/SSE3/SSE4.1 is supported
  SSE4_2 SSE/SSE2/SSE3/SSE4.2 is supported
XStateAVX AVX AVX is supported
  AVX2 AVX/AVX2 is supported
  AVX512 AVX/AVX2/AVX512 is supported
XStateMPX MPX MPX is supported
XStatePT PT PT is supported
typedef enum _XSTATE_BIT {
	XStateUndefined = -1,    // -1
	XStateFPU,               // 0 - x87 FPU
	XStateSSE,               // 1 - SSE
	XStateAVX,               // 2 - AVX
	XStateMPX,               // 3 - MPX
	XStatePT,                // 4 - PT
	XStateMaximum            // Invalid
} XSTATE_BIT, *PXSTATE_BIT;

PENABLED_HIGHEST_FEATURE is defined as follows:

typedef enum _ENABLED_HIGHEST_FEATURE {
	NotSupported = -1,
	x87FPU,
	SSE,
	SSE2,
	SSE3,
	SSSE3,
	SSE4_1,
	SSE4_2,
	AVX,
	AVX2,
	AVX512,
	MPX,
	PT
} ENABLED_HIGHEST_FEATURE, *PENABLED_HIGHEST_FEATURE;

For XState feature set XStateFPU, there is only one feature: x87FPU.

For XState feature set XStateSSE, the function returns the highest of the following six features: SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2.

For XState feature set XStateAVX, the function returns the highest of the following three features: AVX, AVX2, AVX512.

For XState feature set XStateMPX, there is only one feature: MPX.

For XState feature set XStatePT, there is only one feature: PT.

NOTE: Not all features supported by a processor may be enabled on the system. Using a feature which is not enabled may result in exceptions or undefined behavior.

Requirements

Minimum Supported Version RTX64 2014
Header RtssApi.h
Library Rtx_Rtss.lib