1 /*===--------------- x86gprintrin.h - X86 GPR intrinsics ------------------===
3 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 * See https://llvm.org/LICENSE.txt for license information.
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 *===-----------------------------------------------------------------------===
10 #ifndef __X86GPRINTRIN_H
11 #define __X86GPRINTRIN_H
13 #if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
15 #include <hresetintrin.h>
18 #if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
20 #include <uintrintrin.h>
23 #if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
25 #include <crc32intrin.h>
28 #if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
30 #include <prfchiintrin.h>
33 #if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
35 #include <raointintrin.h>
38 #if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
39 defined(__CMPCCXADD__)
40 #include <cmpccxaddintrin.h>
44 #define __SAVE_GPRBX "mov {%%ebx, %%eax |eax, ebx};"
45 #define __RESTORE_GPRBX "mov {%%eax, %%ebx |ebx, eax};"
46 #define __TMPGPR "eax"
48 // When in 64-bit target, the 32-bit operands generate a 32-bit result,
49 // zero-extended to a 64-bit result in the destination general-purpose,
50 // It means "mov x %ebx" will clobber the higher 32 bits of rbx, so we
51 // should preserve the 64-bit register rbx.
52 #define __SAVE_GPRBX "mov {%%rbx, %%rax |rax, rbx};"
53 #define __RESTORE_GPRBX "mov {%%rax, %%rbx |rbx, rax};"
54 #define __TMPGPR "rax"
57 #define __SSC_MARK(__Tag) \
58 __asm__ __volatile__( __SAVE_GPRBX \
59 "mov {%0, %%ebx|ebx, %0}; " \
60 ".byte 0x64, 0x67, 0x90; " \
65 #endif /* __X86GPRINTRIN_H */