RtGetEnabledXStateFeature

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

Syntax

Copy
BOOL RtGetEnabledXStateFeature(
    [in]    XSTATE_BIT XStateBit,
    [out]   PENABLED_HIGHEST_FEATURE HighestFeature
);

Parameters

[in] XStateBit

The XState feature set to obtain:

Value Description

XStateFPU

MMX registers support

XStateSSE

SSE registers supported

XStateAVX

AVX registers supported

XStateMPX

MPX registers supported

XStatePT

PT registers supported

[out] 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

If the function succeeds, it returns a non-zero value. If the function fails, it returns zero.

Remarks

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

XState Value 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

Copy
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:

Copy
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 Header Library

wRTOS 1.0 SDK

RtssApi.h

Startup.lib