summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/asmjit/src/asmjit/core/emithelper_p.h
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/asmjit/src/asmjit/core/emithelper_p.h')
-rw-r--r--3rdparty/asmjit/src/asmjit/core/emithelper_p.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/3rdparty/asmjit/src/asmjit/core/emithelper_p.h b/3rdparty/asmjit/src/asmjit/core/emithelper_p.h
new file mode 100644
index 00000000000..0f4a2f3ece4
--- /dev/null
+++ b/3rdparty/asmjit/src/asmjit/core/emithelper_p.h
@@ -0,0 +1,58 @@
+// This file is part of AsmJit project <https://asmjit.com>
+//
+// See asmjit.h or LICENSE.md for license and copyright information
+// SPDX-License-Identifier: Zlib
+
+#ifndef ASMJIT_CORE_EMITHELPER_P_H_INCLUDED
+#define ASMJIT_CORE_EMITHELPER_P_H_INCLUDED
+
+#include "../core/emitter.h"
+#include "../core/operand.h"
+#include "../core/type.h"
+
+ASMJIT_BEGIN_NAMESPACE
+
+//! \cond INTERNAL
+//! \addtogroup asmjit_core
+//! \{
+
+//! Helper class that provides utilities for each supported architecture.
+class BaseEmitHelper {
+public:
+ BaseEmitter* _emitter;
+
+ ASMJIT_INLINE_NODEBUG explicit BaseEmitHelper(BaseEmitter* emitter = nullptr) noexcept
+ : _emitter(emitter) {}
+
+ ASMJIT_INLINE_NODEBUG BaseEmitter* emitter() const noexcept { return _emitter; }
+ ASMJIT_INLINE_NODEBUG void setEmitter(BaseEmitter* emitter) noexcept { _emitter = emitter; }
+
+ //! Emits a pure move operation between two registers or the same type or between a register and its home
+ //! slot. This function does not handle register conversion.
+ virtual Error emitRegMove(
+ const Operand_& dst_,
+ const Operand_& src_, TypeId typeId, const char* comment = nullptr);
+
+ //! Emits swap between two registers.
+ virtual Error emitRegSwap(
+ const BaseReg& a,
+ const BaseReg& b, const char* comment = nullptr);
+
+ //! Emits move from a function argument (either register or stack) to a register.
+ //!
+ //! This function can handle the necessary conversion from one argument to another, and from one register type
+ //! to another, if it's possible. Any attempt of conversion that requires third register of a different group
+ //! (for example conversion from K to MMX on X86/X64) will fail.
+ virtual Error emitArgMove(
+ const BaseReg& dst_, TypeId dstTypeId,
+ const Operand_& src_, TypeId srcTypeId, const char* comment = nullptr);
+
+ Error emitArgsAssignment(const FuncFrame& frame, const FuncArgsAssignment& args);
+};
+
+//! \}
+//! \endcond
+
+ASMJIT_END_NAMESPACE
+
+#endif // ASMJIT_CORE_EMITHELPER_P_H_INCLUDED