From 5dc22ca8fd325315c5d24b6ed6a037cc38e86527 Mon Sep 17 00:00:00 2001 From: AJR Date: Sun, 25 Sep 2022 22:28:50 -0400 Subject: eminline.h: Additions - Add mul_16x16 inline function to perform a signed 16x16-bit multiplication with 32-bit result. This was moved from cpu/e132xs to unite it with the analogous 32x32 operations. - Add rotl_32, rotr_32, rotl_64 and rotr_64 inline functions to perform 32-bit and 64-bit circular shifts in either direction by the specified number of places, modulo 32 or 64. It is anticipated that these will eventually be replaced by standard functions in C++20's header, and so they have been given similar signatures and semantics (which are also validity-checked). - Remove LSL, LSR, ROL and ROR macros from cpu/arm and cpu/arm7 to ameliorate unnecessary obfuscation. --- src/devices/cpu/e132xs/e132xsop.hxx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/devices/cpu/e132xs') diff --git a/src/devices/cpu/e132xs/e132xsop.hxx b/src/devices/cpu/e132xs/e132xsop.hxx index e99f86d3ec3..953e82f4150 100644 --- a/src/devices/cpu/e132xs/e132xsop.hxx +++ b/src/devices/cpu/e132xs/e132xsop.hxx @@ -1513,8 +1513,7 @@ void hyperstone_device::hyperstone_rol() const uint32_t mask = (uint32_t)(0xffffffff00000000ULL >> n); #endif - if (n) - val = (val << n) | (val >> (32 - n)); + val = rotl_32(val, n); #ifdef MISSIONCRAFT_FLAGS SR &= ~(V_MASK | Z_MASK | C_MASK | N_MASK); @@ -2213,11 +2212,6 @@ void hyperstone_device::hyperstone_mul() m_core->icount -= 3 << m_core->clck_scale; } -static inline int32_t mul_16x16(int16_t halfd, int16_t halfs) -{ - return (int32_t)halfd * (int32_t)halfs; -} - void hyperstone_device::hyperstone_extend() { m_instruction_length = (2<<19); -- cgit v1.2.3-70-g09d2