mirror of
https://github.com/holub/mame
synced 2025-07-05 09:57:47 +03:00
validity check: test all 32 results from count_leading_zeros() & count_leading_ones() [smf]
This commit is contained in:
parent
418bc70cfa
commit
0883f01e66
@ -511,16 +511,18 @@ void validity_checker::validate_inlines()
|
|||||||
if (fabsf(recip_approx(100.0f) - 0.01f) > 0.0001f)
|
if (fabsf(recip_approx(100.0f) - 0.01f) > 0.0001f)
|
||||||
osd_printf_error("Error testing recip_approx\n");
|
osd_printf_error("Error testing recip_approx\n");
|
||||||
|
|
||||||
testi32a = (testi32a & 0x0000ffff) | 0x400000;
|
for (int i = 0; i <= 32; i++)
|
||||||
if (count_leading_zeros(testi32a) != 9)
|
{
|
||||||
osd_printf_error("Error testing count_leading_zeros\n");
|
u32 t = i < 32 ? (1 << (31 - i) | testu32a >> i) : 0;
|
||||||
if (count_leading_zeros(0) != 32)
|
u8 resultu8 = count_leading_zeros(t);
|
||||||
osd_printf_error("Error testing count_leading_zeros\n");
|
if (resultu8 != i)
|
||||||
testi32a = (testi32a | 0xffff0000) & ~0x400000;
|
osd_printf_error("Error testing count_leading_zeros %08x=%02x (expected %02x)\n", t, resultu8, i);
|
||||||
if (count_leading_ones(testi32a) != 9)
|
|
||||||
osd_printf_error("Error testing count_leading_ones\n");
|
t ^= 0xffffffff;
|
||||||
if (count_leading_ones(0xffffffff) != 32)
|
resultu8 = count_leading_ones(t);
|
||||||
osd_printf_error("Error testing count_leading_ones\n");
|
if (resultu8 != i)
|
||||||
|
osd_printf_error("Error testing count_leading_ones %08x=%02x (expected %02x)\n", t, resultu8, i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user