diff options
Diffstat (limited to 'src/devices/cpu/rsp/rspcp2.h')
-rw-r--r-- | src/devices/cpu/rsp/rspcp2.h | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/src/devices/cpu/rsp/rspcp2.h b/src/devices/cpu/rsp/rspcp2.h index 9eb0bb37fdc..5f477963940 100644 --- a/src/devices/cpu/rsp/rspcp2.h +++ b/src/devices/cpu/rsp/rspcp2.h @@ -56,10 +56,10 @@ typedef __m128i rsp_vec_t; union VECTOR_REG { - UINT64 d[2]; - UINT32 l[4]; - UINT16 s[8]; - UINT8 b[16]; + uint64_t d[2]; + uint32_t l[4]; + uint16_t s[8]; + uint8_t b[16]; #if USE_SIMD rsp_vec_t v; #endif @@ -67,9 +67,9 @@ union VECTOR_REG union ACCUMULATOR_REG { - UINT64 q; - UINT32 l[2]; - UINT16 w[4]; + uint64_t q; + uint32_t l[2]; + uint16_t w[4]; }; struct compiler_state; @@ -163,29 +163,29 @@ public: virtual void mtc2(); virtual void ctc2(); - virtual void handle_cop2(UINT32 op); + virtual void handle_cop2(uint32_t op); void log_instruction_execution(); virtual void cfunc_unimplemented_opcode() { } - void dump(UINT32 op); + void dump(uint32_t op); void dump_dmem(); protected: virtual int generate_vector_opcode(drcuml_block *block, rsp_device::compiler_state *compiler, const opcode_desc *desc) { return TRUE; } - UINT16 SATURATE_ACCUM(int accum, int slice, UINT16 negative, UINT16 positive); + uint16_t SATURATE_ACCUM(int accum, int slice, uint16_t negative, uint16_t positive); // Data that needs to be stored close to the generated DRC code struct internal_rspcop2_state { - UINT32 op; + uint32_t op; }; internal_rspcop2_state *m_rspcop2_state; rsp_device& m_rsp; running_machine& m_machine; - UINT32 m_vres[8]; /* used for temporary vector results */ + uint32_t m_vres[8]; /* used for temporary vector results */ #if USE_SIMD __align16 VECTOR_REG m_v[32]; @@ -193,11 +193,11 @@ protected: VECTOR_REG m_v[32]; #endif ACCUMULATOR_REG m_accum[8]; - UINT16 m_vflag[6][8]; + uint16_t m_vflag[6][8]; - INT32 m_reciprocal_res; - UINT32 m_reciprocal_high; - INT32 m_dp_allowed; + int32_t m_reciprocal_res; + uint32_t m_reciprocal_high; + int32_t m_dp_allowed; #if USE_SIMD enum rsp_flags_t { @@ -226,60 +226,60 @@ protected: union aligned_rsp_1vect_t { rsp_vec_t __align; - UINT16 s[8]; + uint16_t s[8]; }; union aligned_rsp_2vect_t { rsp_vec_t __align[2]; - UINT16 s[16]; + uint16_t s[16]; }; union aligned_rsp_3vect_t { rsp_vec_t __align[3]; - UINT16 s[24]; + uint16_t s[24]; }; __align16 aligned_rsp_1vect_t m_vdqm; __align16 aligned_rsp_2vect_t m_flags[3]; __align16 aligned_rsp_3vect_t m_acc; - UINT32 m_dp_flag; + uint32_t m_dp_flag; typedef struct { rsp_vec_t dummy_for_alignment; - const UINT16 logic_mask[2][8]; - const UINT16 vrsq_mask_table[8][8]; - const UINT16 shuffle_keys[16][8]; - const UINT16 sll_b2l_keys[16][8]; - const UINT16 sll_l2b_keys[16][8]; - const UINT16 srl_b2l_keys[16][8]; - const UINT16 ror_b2l_keys[16][8]; - const UINT16 rol_l2b_keys[16][8]; - const UINT16 ror_l2b_keys[16][8]; - const UINT16 qr_lut[16][8]; - const UINT16 bdls_lut[4][4]; - const UINT16 word_reverse[8]; + const uint16_t logic_mask[2][8]; + const uint16_t vrsq_mask_table[8][8]; + const uint16_t shuffle_keys[16][8]; + const uint16_t sll_b2l_keys[16][8]; + const uint16_t sll_l2b_keys[16][8]; + const uint16_t srl_b2l_keys[16][8]; + const uint16_t ror_b2l_keys[16][8]; + const uint16_t rol_l2b_keys[16][8]; + const uint16_t ror_l2b_keys[16][8]; + const uint16_t qr_lut[16][8]; + const uint16_t bdls_lut[4][4]; + const uint16_t word_reverse[8]; } vec_helpers_t; static const vec_helpers_t m_vec_helpers; - rsp_vec_t vec_load_and_shuffle_operand(const UINT16* src, UINT32 element); - static inline UINT32 sign_extend_6(INT32 i) { + rsp_vec_t vec_load_and_shuffle_operand(const uint16_t* src, uint32_t element); + static inline uint32_t sign_extend_6(int32_t i) { return ((i << (32 - 7)) >> (32 - 7)) & 0xfff; } static inline rsp_vec_t vec_load_unshuffled_operand(const void* src) { return _mm_load_si128((rsp_vec_t*) src); } - static inline void vec_write_operand(UINT16* dest, rsp_vec_t src) + static inline void vec_write_operand(uint16_t* dest, rsp_vec_t src) { _mm_store_si128((rsp_vec_t*) dest, src); } - static inline rsp_vec_t read_acc_lo(const UINT16* acc) + static inline rsp_vec_t read_acc_lo(const uint16_t* acc) { return vec_load_unshuffled_operand(acc + sizeof(rsp_vec_t)); } - static inline rsp_vec_t read_acc_mid(const UINT16* acc) + static inline rsp_vec_t read_acc_mid(const uint16_t* acc) { return vec_load_unshuffled_operand(acc + (sizeof(rsp_vec_t) >> 1)); } @@ -287,60 +287,60 @@ protected: { return vec_load_unshuffled_operand(acc); } - static inline rsp_vec_t read_vcc_lo(const UINT16 *vcc) + static inline rsp_vec_t read_vcc_lo(const uint16_t *vcc) { return vec_load_unshuffled_operand(vcc + (sizeof(rsp_vec_t) >> 1)); } - static inline rsp_vec_t read_vcc_hi(const UINT16 *vcc) + static inline rsp_vec_t read_vcc_hi(const uint16_t *vcc) { return vec_load_unshuffled_operand(vcc); } - static inline rsp_vec_t read_vco_lo(const UINT16 *vco) + static inline rsp_vec_t read_vco_lo(const uint16_t *vco) { return vec_load_unshuffled_operand(vco + (sizeof(rsp_vec_t) >> 1)); } - static inline rsp_vec_t read_vco_hi(const UINT16 *vco) + static inline rsp_vec_t read_vco_hi(const uint16_t *vco) { return vec_load_unshuffled_operand(vco); } - static inline rsp_vec_t read_vce(const UINT16 *vce) + static inline rsp_vec_t read_vce(const uint16_t *vce) { return vec_load_unshuffled_operand(vce + (sizeof(rsp_vec_t) >> 1)); } - static inline void write_acc_lo(UINT16 *acc, rsp_vec_t acc_lo) + static inline void write_acc_lo(uint16_t *acc, rsp_vec_t acc_lo) { return vec_write_operand(acc + sizeof(rsp_vec_t), acc_lo); } - static inline void write_acc_mid(UINT16 *acc, rsp_vec_t acc_mid) + static inline void write_acc_mid(uint16_t *acc, rsp_vec_t acc_mid) { return vec_write_operand(acc + (sizeof(rsp_vec_t) >> 1), acc_mid); } - static inline void write_acc_hi(UINT16 *acc, rsp_vec_t acc_hi) + static inline void write_acc_hi(uint16_t *acc, rsp_vec_t acc_hi) { return vec_write_operand(acc, acc_hi); } - static inline void write_vcc_lo(UINT16 *vcc, rsp_vec_t vcc_lo) + static inline void write_vcc_lo(uint16_t *vcc, rsp_vec_t vcc_lo) { return vec_write_operand(vcc + (sizeof(rsp_vec_t) >> 1), vcc_lo); } - static inline void write_vcc_hi(UINT16 *vcc, rsp_vec_t vcc_hi) + static inline void write_vcc_hi(uint16_t *vcc, rsp_vec_t vcc_hi) { return vec_write_operand(vcc, vcc_hi); } - static inline void write_vco_lo(UINT16 *vcc, rsp_vec_t vco_lo) + static inline void write_vco_lo(uint16_t *vcc, rsp_vec_t vco_lo) { return vec_write_operand(vcc + (sizeof(rsp_vec_t) >> 1), vco_lo); } - static inline void write_vco_hi(UINT16 *vcc, rsp_vec_t vco_hi) + static inline void write_vco_hi(uint16_t *vcc, rsp_vec_t vco_hi) { return vec_write_operand(vcc, vco_hi); } - static inline void write_vce(UINT16 *vce, rsp_vec_t vce_r) + static inline void write_vce(uint16_t *vce, rsp_vec_t vce_r) { return vec_write_operand(vce + (sizeof(rsp_vec_t) >> 1), vce_r); } - static inline INT16 get_flags(const UINT16 *flags) + static inline int16_t get_flags(const uint16_t *flags) { return _mm_movemask_epi8(_mm_packs_epi16(_mm_load_si128((rsp_vec_t*) (flags + (sizeof(rsp_vec_t) >> 1))), _mm_load_si128((rsp_vec_t*) flags))); } @@ -350,12 +350,12 @@ protected: return _mm_setzero_si128(); } - void vec_load_group1(UINT32 addr, UINT32 element, UINT16* regp, rsp_vec_t reg, rsp_vec_t dqm); - void vec_load_group2(UINT32 addr, UINT32 element, UINT16* regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type); - void vec_load_group4(UINT32 addr, UINT32 element, UINT16* regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type); - void vec_store_group1(UINT32 addr, UINT32 element, UINT16* regp, rsp_vec_t reg, rsp_vec_t dqm); - void vec_store_group2(UINT32 addr, UINT32 element, UINT16* regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type); - void vec_store_group4(UINT32 addr, UINT32 element, UINT16* regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type); + void vec_load_group1(uint32_t addr, uint32_t element, uint16_t* regp, rsp_vec_t reg, rsp_vec_t dqm); + void vec_load_group2(uint32_t addr, uint32_t element, uint16_t* regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type); + void vec_load_group4(uint32_t addr, uint32_t element, uint16_t* regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type); + void vec_store_group1(uint32_t addr, uint32_t element, uint16_t* regp, rsp_vec_t reg, rsp_vec_t dqm); + void vec_store_group2(uint32_t addr, uint32_t element, uint16_t* regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type); + void vec_store_group4(uint32_t addr, uint32_t element, uint16_t* regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type); #include "clamp.h" #include "vabs.h" @@ -385,12 +385,12 @@ protected: #endif private: - void handle_lwc2(UINT32 op); - void handle_swc2(UINT32 op); - void handle_vector_ops(UINT32 op); + void handle_lwc2(uint32_t op); + void handle_swc2(uint32_t op); + void handle_vector_ops(uint32_t op); - UINT32 m_div_in; - UINT32 m_div_out; + uint32_t m_div_in; + uint32_t m_div_out; }; #endif /* __RSPCP2_H__ */ |