diff -ru a/src/cpu/gencpu.c b/src/cpu/gencpu.c
--- a/src/cpu/gencpu.c 2024-05-04 20:10:03
+++ b/src/cpu/gencpu.c 2025-01-06 14:04:13
@@ -9224,7 +9224,7 @@
if (curi->dmode == Dreg) {
out("uae_u32 tmp = m68k_dreg(regs, dstreg);\n");
out("offset &= 0x1f;\n");
- out("tmp = (tmp << offset) | (tmp >> (32 - offset));\n");
+ out("tmp = (offset > 0 && offset < 32) ? ((tmp << offset) | (tmp >> (32 - offset))) : tmp;\n");
offset is restricted to 0x1f, so it is always < 32, i.e. it should be
sufficient to check for "offset != 0" in above condition. I'd maybe also
rather write it like this:
out("tmp = (tmp << offset)\n");
out("if (offset) tmp |= (tmp >> (32 - offset));\n");
?
Thomas