diff options
Diffstat (limited to 'erts/emulator/asmjit/core/emitter.h')
-rw-r--r-- | erts/emulator/asmjit/core/emitter.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/erts/emulator/asmjit/core/emitter.h b/erts/emulator/asmjit/core/emitter.h index b8afd6b8e0..6499c071bd 100644 --- a/erts/emulator/asmjit/core/emitter.h +++ b/erts/emulator/asmjit/core/emitter.h @@ -233,6 +233,13 @@ public: //! Native GP register signature and signature related information. OperandSignature _gpSignature {}; + //! Emitter state that can be used to specify options and inline comment of a next node or instruction. + struct State { + InstOptions options; + RegOnly extraReg; + const char* comment; + }; + //! Next instruction options (affects the next instruction). InstOptions _instOptions = InstOptions::kNone; //! Extra register (op-mask {k} on AVX-512) (affects the next instruction). @@ -530,6 +537,23 @@ public: //! \} + //! \name Emitter State + //! \{ + + inline void resetState() noexcept { + resetInstOptions(); + resetExtraReg(); + resetInlineComment(); + } + + inline State _grabState() noexcept { + State s{_instOptions | _forcedInstOptions, _extraReg, _inlineComment}; + resetState(); + return s; + } + + //! \} + //! \name Sections //! \{ |