mirror of
https://github.com/mamedev/mame.git
synced 2024-11-16 07:48:32 +01:00
e132xs: Cleanups
- Use count_leading_zeros_32 instead of loop for TESTLZ - Simplify overflow mask calculation for SHL(I)
This commit is contained in:
parent
00418d9406
commit
87d91cba68
1 changed files with 3 additions and 10 deletions
|
@ -1466,7 +1466,7 @@ void hyperstone_device::hyperstone_shl()
|
|||
|
||||
uint32_t n = m_core->local_regs[src_code & 0x3f] & 0x1f;
|
||||
uint32_t base = m_core->local_regs[dst_code & 0x3f]; /* registers offset by frame pointer */
|
||||
uint64_t mask = ((((uint64_t)1) << (32 - n)) - 1) ^ 0xffffffff;
|
||||
uint32_t mask = n ? 0xffffffff << (32 - n) : 0;
|
||||
|
||||
SR &= ~(C_MASK | V_MASK | Z_MASK | N_MASK);
|
||||
|
||||
|
@ -1491,14 +1491,7 @@ void hyperstone_device::hyperstone_testlz()
|
|||
|
||||
const uint32_t fp = GET_FP;
|
||||
const uint32_t sreg = m_core->local_regs[(SRC_CODE + fp) & 0x3f];
|
||||
uint32_t zeros = 0;
|
||||
for (uint32_t mask = 0x80000000; mask != 0; mask >>= 1 )
|
||||
{
|
||||
if (sreg & mask)
|
||||
break;
|
||||
else
|
||||
zeros++;
|
||||
}
|
||||
const uint32_t zeros = count_leading_zeros_32(sreg);
|
||||
|
||||
m_core->local_regs[(DST_CODE + fp) & 0x3f] = zeros;
|
||||
|
||||
|
@ -2076,7 +2069,7 @@ void hyperstone_device::hyperstone_shli()
|
|||
SR |= (val & (0x80000000 >> (n - 1))) ? 1 : 0;
|
||||
}
|
||||
|
||||
uint64_t mask = ((1U << (32 - n)) - 1) ^ 0xffffffff;
|
||||
uint32_t mask = n ? 0xffffffff << (32 - n) : 0;
|
||||
uint32_t val2 = val << n;
|
||||
|
||||
if (((val & mask) && (!(val2 & 0x80000000))) || (((val & mask) ^ mask) && (val2 & 0x80000000)))
|
||||
|
|
Loading…
Reference in a new issue