// Copyright 2023 Dolphin Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once #include #include #include "Common/Assembler/AssemblerShared.h" #include "Common/Assembler/GekkoLexer.h" #include "Common/CommonTypes.h" namespace Common::GekkoAssembler::detail { struct GekkoInstruction { // Combination of a mnemonic index and variant: // ( << 2) | () size_t mnemonic_index = 0; // Below refers to GekkoParseResult::operand_pool Interval op_interval = Interval{0, 0}; // Literal text of this instruction std::string_view raw_text; size_t line_number = 0; bool is_extended = false; }; using InstChunk = std::vector; using ByteChunk = std::vector; using PadChunk = size_t; using ChunkVariant = std::variant; struct IRBlock { explicit IRBlock(u32 address) : block_address(address) {} u32 BlockEndAddress() const; std::vector chunks; u32 block_address; }; struct GekkoIR { std::vector blocks; std::vector> operand_pool; }; FailureOr ParseToIR(std::string_view assembly, u32 base_virtual_address); } // namespace Common::GekkoAssembler::detail