Line data Source code
1 : #ifdef __PLUMED_HAS_ASMJIT 2 : // This file is part of AsmJit project <https://asmjit.com> 3 : // 4 : // See asmjit.h or LICENSE.md for license and copyright information 5 : // SPDX-License-Identifier: Zlib 6 : 7 : #ifndef ASMJIT_X86_X86EMITHELPER_P_H_INCLUDED 8 : #define ASMJIT_X86_X86EMITHELPER_P_H_INCLUDED 9 : 10 : #include "api-config.h" 11 : 12 : #include "emithelper_p.h" 13 : #include "func.h" 14 : #include "x86emitter.h" 15 : #include "x86operand.h" 16 : 17 : ASMJIT_BEGIN_SUB_NAMESPACE(x86) 18 : 19 : //! \cond INTERNAL 20 : //! \addtogroup asmjit_x86 21 : //! \{ 22 : 23 9685 : static inline RegType vecTypeIdToRegType(TypeId typeId) noexcept { 24 9685 : return uint32_t(typeId) <= uint32_t(TypeId::_kVec128End) ? RegType::kX86_Xmm : 25 0 : uint32_t(typeId) <= uint32_t(TypeId::_kVec256End) ? RegType::kX86_Ymm : RegType::kX86_Zmm; 26 : } 27 : 28 : class EmitHelper : public BaseEmitHelper { 29 : public: 30 : bool _avxEnabled; 31 : bool _avx512Enabled; 32 : 33 : inline explicit EmitHelper(BaseEmitter* emitter = nullptr, bool avxEnabled = false, bool avx512Enabled = false) noexcept 34 82476 : : BaseEmitHelper(emitter), 35 82476 : _avxEnabled(avxEnabled || avx512Enabled), 36 82476 : _avx512Enabled(avx512Enabled) {} 37 : 38 : Error emitRegMove( 39 : const Operand_& dst_, 40 : const Operand_& src_, TypeId typeId, const char* comment = nullptr) override; 41 : 42 : Error emitArgMove( 43 : const BaseReg& dst_, TypeId dstTypeId, 44 : const Operand_& src_, TypeId srcTypeId, const char* comment = nullptr) override; 45 : 46 : Error emitRegSwap( 47 : const BaseReg& a, 48 : const BaseReg& b, const char* comment = nullptr) override; 49 : 50 : Error emitProlog(const FuncFrame& frame); 51 : Error emitEpilog(const FuncFrame& frame); 52 : }; 53 : 54 : void assignEmitterFuncs(BaseEmitter* emitter); 55 : 56 : //! \} 57 : //! \endcond 58 : 59 : ASMJIT_END_SUB_NAMESPACE 60 : 61 : #endif // ASMJIT_X86_X86EMITHELPER_P_H_INCLUDED 62 : 63 : #endif // __PLUMED_HAS_ASMJIT