brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.8 KiB · afee6aa Raw
92 lines · c
1/*===---- fxsrintrin.h - FXSR intrinsic ------------------------------------===2 *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-exception6 *7 *===-----------------------------------------------------------------------===8 */9 10#ifndef __IMMINTRIN_H11#error "Never use <fxsrintrin.h> directly; include <immintrin.h> instead."12#endif13 14#ifndef __FXSRINTRIN_H15#define __FXSRINTRIN_H16 17#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__,  __target__("fxsr")))18 19/// Saves the XMM, MMX, MXCSR and x87 FPU registers into a 512-byte20///    memory region pointed to by the input parameter \a __p.21///22/// \headerfile <x86intrin.h>23///24/// This intrinsic corresponds to the <c> FXSAVE </c> instruction.25///26/// \param __p27///    A pointer to a 512-byte memory region. The beginning of this memory28///    region should be aligned on a 16-byte boundary.29static __inline__ void __DEFAULT_FN_ATTRS30_fxsave(void *__p)31{32  __builtin_ia32_fxsave(__p);33}34 35/// Restores the XMM, MMX, MXCSR and x87 FPU registers from the 512-byte36///    memory region pointed to by the input parameter \a __p. The contents of37///    this memory region should have been written to by a previous \c _fxsave38///    or \c _fxsave64 intrinsic.39///40/// \headerfile <x86intrin.h>41///42/// This intrinsic corresponds to the <c> FXRSTOR </c> instruction.43///44/// \param __p45///    A pointer to a 512-byte memory region. The beginning of this memory46///    region should be aligned on a 16-byte boundary.47static __inline__ void __DEFAULT_FN_ATTRS48_fxrstor(void *__p)49{50  __builtin_ia32_fxrstor(__p);51}52 53#ifdef __x86_64__54/// Saves the XMM, MMX, MXCSR and x87 FPU registers into a 512-byte55///    memory region pointed to by the input parameter \a __p.56///57/// \headerfile <x86intrin.h>58///59/// This intrinsic corresponds to the <c> FXSAVE64 </c> instruction.60///61/// \param __p62///    A pointer to a 512-byte memory region. The beginning of this memory63///    region should be aligned on a 16-byte boundary.64static __inline__ void __DEFAULT_FN_ATTRS65_fxsave64(void *__p)66{67  __builtin_ia32_fxsave64(__p);68}69 70/// Restores the XMM, MMX, MXCSR and x87 FPU registers from the 512-byte71///    memory region pointed to by the input parameter \a __p. The contents of72///    this memory region should have been written to by a previous \c _fxsave73///    or \c _fxsave64 intrinsic.74///75/// \headerfile <x86intrin.h>76///77/// This intrinsic corresponds to the <c> FXRSTOR64 </c> instruction.78///79/// \param __p80///    A pointer to a 512-byte memory region. The beginning of this memory81///    region should be aligned on a 16-byte boundary.82static __inline__ void __DEFAULT_FN_ATTRS83_fxrstor64(void *__p)84{85  __builtin_ia32_fxrstor64(__p);86}87#endif88 89#undef __DEFAULT_FN_ATTRS90 91#endif92