Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 7/13/2023
Public
Document Table of Contents

_xtest

Queries whether the processor is executing in a transactional region identified by restricted transactional memory (RTM) or hardware lock elision (HLE). The corresponding Intel® AVX2 instruction is XTEST.

Syntax

unsigned char _xtest(void);

Arguments

None.

Description

Queries the RTM or HLE execution status. If the xtest function is called inside an RTM or an active HLE region, then the ZF flag is cleared, else it is set.

NOTE:

A processor supports the xtest instruction if it supports either HLE or RTM. An application must check either of these feature flags before using the xtest instruction. While the HLE prefixes are ignored on processors that do not support HLE, this instruction will generate a #UD exception when used on a processor that does not support either HLE or RTM.

Returns

Result of the query.