summaryrefslogtreecommitdiffstats
path: root/src/devices/cpu/uml.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/uml.h')
-rw-r--r--src/devices/cpu/uml.h88
1 files changed, 44 insertions, 44 deletions
diff --git a/src/devices/cpu/uml.h b/src/devices/cpu/uml.h
index 9c2b9a4c80e..a86f8eee82b 100644
--- a/src/devices/cpu/uml.h
+++ b/src/devices/cpu/uml.h
@@ -51,11 +51,11 @@ namespace uml
const int MAPVAR_END = MAPVAR_M0 + MAPVAR_COUNT;
// flag definitions
- const UINT8 FLAG_C = 0x01; // carry flag
- const UINT8 FLAG_V = 0x02; // overflow flag (defined for integer only)
- const UINT8 FLAG_Z = 0x04; // zero flag
- const UINT8 FLAG_S = 0x08; // sign flag (defined for integer only)
- const UINT8 FLAG_U = 0x10; // unordered flag (defined for FP only)
+ const uint8_t FLAG_C = 0x01; // carry flag
+ const uint8_t FLAG_V = 0x02; // overflow flag (defined for integer only)
+ const uint8_t FLAG_Z = 0x04; // zero flag
+ const uint8_t FLAG_S = 0x08; // sign flag (defined for integer only)
+ const uint8_t FLAG_U = 0x10; // unordered flag (defined for FP only)
// testable conditions; note that these are defined such that (condition ^ 1) is
// always the opposite
@@ -260,18 +260,18 @@ namespace uml
{
public:
// construction
- code_label(UINT32 label = 0) : m_label(label) { }
+ code_label(uint32_t label = 0) : m_label(label) { }
// operators
- operator UINT32 &() { return m_label; }
+ operator uint32_t &() { return m_label; }
bool operator==(const code_label &rhs) const { return (m_label == rhs.m_label); }
bool operator!=(const code_label &rhs) const { return (m_label != rhs.m_label); }
// getters
- UINT32 label() const { return m_label; }
+ uint32_t label() const { return m_label; }
private:
- UINT32 m_label;
+ uint32_t m_label;
};
// a parameter for a UML instructon is encoded like this
@@ -300,12 +300,12 @@ namespace uml
};
// represents the value of an opcode parameter
- typedef UINT64 parameter_value;
+ typedef uint64_t parameter_value;
// construction
parameter() : m_type(PTYPE_NONE), m_value(0) { }
parameter(const parameter &param) : m_type(param.m_type), m_value(param.m_value) { }
- parameter(UINT64 val) : m_type(PTYPE_IMMEDIATE), m_value(val) { }
+ parameter(uint64_t val) : m_type(PTYPE_IMMEDIATE), m_value(val) { }
parameter(operand_size size, memory_scale scale) : m_type(PTYPE_SIZE_SCALE), m_value((scale << 4) | size) { assert(size >= SIZE_BYTE && size <= SIZE_DQWORD); assert(scale >= SCALE_x1 && scale <= SCALE_x8); }
parameter(operand_size size, memory_space space) : m_type(PTYPE_SIZE_SPACE), m_value((space << 4) | size) { assert(size >= SIZE_BYTE && size <= SIZE_DQWORD); assert(space >= SPACE_PROGRAM && space <= SPACE_IO); }
parameter(code_handle &handle) : m_type(PTYPE_CODE_HANDLE), m_value(reinterpret_cast<parameter_value>(&handle)) { }
@@ -329,7 +329,7 @@ namespace uml
// getters
parameter_type type() const { return m_type; }
- UINT64 immediate() const { assert(m_type == PTYPE_IMMEDIATE); return m_value; }
+ uint64_t immediate() const { assert(m_type == PTYPE_IMMEDIATE); return m_value; }
int ireg() const { assert(m_type == PTYPE_INT_REGISTER); assert(m_value >= REG_I0 && m_value < REG_I_END); return m_value; }
int freg() const { assert(m_type == PTYPE_FLOAT_REGISTER); assert(m_value >= REG_F0 && m_value < REG_F_END); return m_value; }
int vreg() const { assert(m_type == PTYPE_VECTOR_REGISTER); assert(m_value >= REG_V0 && m_value < REG_V_END); return m_value; }
@@ -361,7 +361,7 @@ namespace uml
bool is_string() const { return (m_type == PTYPE_STRING); }
// other queries
- bool is_immediate_value(UINT64 value) const { return (m_type == PTYPE_IMMEDIATE && m_value == value); }
+ bool is_immediate_value(uint64_t value) const { return (m_type == PTYPE_IMMEDIATE && m_value == value); }
private:
// private constructor
@@ -377,18 +377,18 @@ namespace uml
{
struct parameter_info
{
- UINT8 output; // input or output?
- UINT8 size; // size of the parameter
- UINT16 typemask; // types allowed
+ uint8_t output; // input or output?
+ uint8_t size; // size of the parameter
+ uint16_t typemask; // types allowed
};
opcode_t opcode; // the opcode itself
const char * mnemonic; // mnemonic string
- UINT8 sizes; // allowed sizes
+ uint8_t sizes; // allowed sizes
bool condition; // conditions allowed?
- UINT8 inflags; // input flags
- UINT8 outflags; // output flags
- UINT8 modflags; // modified flags
+ uint8_t inflags; // input flags
+ uint8_t outflags; // output flags
+ uint8_t modflags; // modified flags
parameter_info param[4]; // information about parameters
};
@@ -402,32 +402,32 @@ namespace uml
// getters
opcode_t opcode() const { return m_opcode; }
condition_t condition() const { return m_condition; }
- UINT8 flags() const { return m_flags; }
- UINT8 size() const { return m_size; }
- UINT8 numparams() const { return m_numparams; }
+ uint8_t flags() const { return m_flags; }
+ uint8_t size() const { return m_size; }
+ uint8_t numparams() const { return m_numparams; }
const parameter &param(int index) const { assert(index < m_numparams); return m_param[index]; }
// setters
- void set_flags(UINT8 flags) { m_flags = flags; }
- void set_mapvar(int paramnum, UINT32 value) { assert(paramnum < m_numparams); assert(m_param[paramnum].is_mapvar()); m_param[paramnum] = value; }
+ void set_flags(uint8_t flags) { m_flags = flags; }
+ void set_mapvar(int paramnum, uint32_t value) { assert(paramnum < m_numparams); assert(m_param[paramnum].is_mapvar()); m_param[paramnum] = value; }
// misc
std::string disasm(drcuml_state *drcuml = nullptr) const;
- UINT8 input_flags() const;
- UINT8 output_flags() const;
- UINT8 modified_flags() const;
+ uint8_t input_flags() const;
+ uint8_t output_flags() const;
+ uint8_t modified_flags() const;
void simplify();
// compile-time opcodes
void handle(code_handle &hand) { configure(OP_HANDLE, 4, hand); }
- void hash(UINT32 mode, UINT32 pc) { configure(OP_HASH, 4, mode, pc); }
+ void hash(uint32_t mode, uint32_t pc) { configure(OP_HASH, 4, mode, pc); }
void label(code_label lab) { configure(OP_LABEL, 4, lab); }
void comment(const char *string) { configure(OP_COMMENT, 4, parameter::make_string(string)); }
- void mapvar(parameter mapvar, UINT32 value) { assert(mapvar.is_mapvar()); configure(OP_MAPVAR, 4, mapvar, value); }
+ void mapvar(parameter mapvar, uint32_t value) { assert(mapvar.is_mapvar()); configure(OP_MAPVAR, 4, mapvar, value); }
// control flow operations
void nop() { configure(OP_NOP, 4); }
- void debug(UINT32 pc) { configure(OP_DEBUG, 4, pc); }
+ void debug(uint32_t pc) { configure(OP_DEBUG, 4, pc); }
void exit(parameter param) { configure(OP_EXIT, 4, param); }
void exit(condition_t cond, parameter param) { configure(OP_EXIT, 4, param, cond); }
void hashjmp(parameter mode, parameter pc, code_handle &handle) { configure(OP_HASHJMP, 4, mode, pc, handle); }
@@ -447,7 +447,7 @@ namespace uml
void setfmod(parameter mode) { configure(OP_SETFMOD, 4, mode); }
void getfmod(parameter dst) { configure(OP_GETFMOD, 4, dst); }
void getexp(parameter dst) { configure(OP_GETEXP, 4, dst); }
- void getflgs(parameter dst, UINT32 flags) { configure(OP_GETFLGS, 4, dst, flags); }
+ void getflgs(parameter dst, uint32_t flags) { configure(OP_GETFLGS, 4, dst, flags); }
void save(drcuml_machine_state *dst) { configure(OP_SAVE, 4, parameter::make_memory(dst)); }
void restore(drcuml_machine_state *src) { configure(OP_RESTORE, 4, parameter::make_memory(src)); }
@@ -581,23 +581,23 @@ namespace uml
private:
// internal configuration
- void configure(opcode_t op, UINT8 size, condition_t cond = COND_ALWAYS);
- void configure(opcode_t op, UINT8 size, parameter p0, condition_t cond = COND_ALWAYS);
- void configure(opcode_t op, UINT8 size, parameter p0, parameter p1, condition_t cond = COND_ALWAYS);
- void configure(opcode_t op, UINT8 size, parameter p0, parameter p1, parameter p2, condition_t cond = COND_ALWAYS);
- void configure(opcode_t op, UINT8 size, parameter p0, parameter p1, parameter p2, parameter p3, condition_t cond = COND_ALWAYS);
+ void configure(opcode_t op, uint8_t size, condition_t cond = COND_ALWAYS);
+ void configure(opcode_t op, uint8_t size, parameter p0, condition_t cond = COND_ALWAYS);
+ void configure(opcode_t op, uint8_t size, parameter p0, parameter p1, condition_t cond = COND_ALWAYS);
+ void configure(opcode_t op, uint8_t size, parameter p0, parameter p1, parameter p2, condition_t cond = COND_ALWAYS);
+ void configure(opcode_t op, uint8_t size, parameter p0, parameter p1, parameter p2, parameter p3, condition_t cond = COND_ALWAYS);
// opcode validation and simplification
void validate();
- void convert_to_mov_immediate(UINT64 immediate) { m_opcode = OP_MOV; m_numparams = 2; m_param[1] = immediate; }
+ void convert_to_mov_immediate(uint64_t immediate) { m_opcode = OP_MOV; m_numparams = 2; m_param[1] = immediate; }
void convert_to_mov_param(int pnum) { m_opcode = OP_MOV; m_numparams = 2; m_param[1] = m_param[pnum]; }
// internal state
opcode_t m_opcode; // opcode
condition_t m_condition; // condition
- UINT8 m_flags; // flags
- UINT8 m_size; // operation size
- UINT8 m_numparams; // number of parameters
+ uint8_t m_flags; // flags
+ uint8_t m_size; // operation size
+ uint8_t m_numparams; // number of parameters
parameter m_param[MAX_PARAMS];// up to 4 parameters
static const opcode_info s_opcode_info_table[OP_MAX];
@@ -606,9 +606,9 @@ namespace uml
// structure describing rules for parameter encoding
struct parameter_info
{
- UINT8 output; // input or output?
- UINT8 size; // size of the parameter
- UINT16 typemask; // types allowed
+ uint8_t output; // input or output?
+ uint8_t size; // size of the parameter
+ uint16_t typemask; // types allowed
};
// global inline functions to specify a register parameter by index