mirror of
https://github.com/pound-emu/pound.git
synced 2025-12-11 07:36:57 +00:00
jit/ir: Add IR types
Signed-off-by: Ronald Caesar <github43132@proton.me>
This commit is contained in:
parent
ac950250a8
commit
a25e4ccbe0
2 changed files with 43 additions and 0 deletions
13
src/jit/CMakeLists.txt
Normal file
13
src/jit/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
add_library(jit STATIC)
|
||||
|
||||
target_sources(jit PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/decoder/arm32.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ir/type.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(jit PRIVATE common host)
|
||||
|
||||
target_include_directories(jit PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
)
|
||||
30
src/jit/ir/type.cpp
Normal file
30
src/jit/ir/type.cpp
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#include "common/passert.h"
|
||||
|
||||
namespace pound::jit::decoder {
|
||||
typedef enum
|
||||
{
|
||||
IR_TYPE_VOID = 0,
|
||||
IR_TYPE_U1 = 1 << 0,
|
||||
IR_TYPE_U8 = 1 << 1,
|
||||
IR_TYPE_U16 = 1 << 2,
|
||||
IR_TYPE_U32 = 1 << 3,
|
||||
IR_TYPE_U64 = 1 << 4,
|
||||
IR_TYPE_U128 = 1 << 5,
|
||||
IR_TYPE_A32_REG = 1 << 6, // ARM32 GPR R0-R14
|
||||
IR_TYPE_A32_EXT_REG = 1 << 7, // ARM32 Extended Registers (e.g., for
|
||||
// VFP/NEON, or just R15 if treated specially)
|
||||
IR_TYPE_A32_CPSR = 1 << 8, // ARM32 CPSR/SPSR
|
||||
IR_TYPE_COND = 1 << 9, // Condition codes
|
||||
IR_TYPE_ACC_TYPE = 1 << 10, // Memory access type
|
||||
IR_TYPE_OPAQUE
|
||||
= 1 << 11, // Represents a value defined by another IR instruction
|
||||
} ir_type_t;
|
||||
|
||||
bool
|
||||
ir_are_types_compatible (const ir_type_t t1, const ir_type_t t2)
|
||||
{
|
||||
const bool is_compatible
|
||||
= (t1 == t2) || (IR_TYPE_OPAQUE == t1) || (IR_TYPE_OPAQUE == t2);
|
||||
return is_compatible;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue