Le 01/11/2016 à 22:29, Richard Henderson a écrit : > Here's the patch I almost wrote in the email, followed by > a cleanup that allows cmpm to be written "nicely". > > I can test this to some extent with the coldfire kernel, > but of course coldfire can't excersise any of the tricky > edge cases that m68000 can. > > I'm particularly interested in edge cases like > > mov.b a0@+, a0@+ > movea a0@+, a0 > movea a0, a0@- > > The first two are not really useful and likely not show up > in normal code. The third may well do so; I think our > current code gets it wrong, but this will get it right.
Checked on a real 68040: stack: .long 0x3456789a top: .text .globl _start _start: lea top,%a0 move.l %a0,-(%a0) The result is: %a0 = top - 4 and top is stored in place of "0x3456789a". [this is also what happens without your patches] If I try this with you patch, I have a core dump: m68k-linux-gnu-gcc -g -m68040 -nostartfiles -nodefaultlibs -nostdlib -o move move.S ./m68k-linux-user/qemu-m68k -singlestep -d in_asm,cpu -cpu m68040 ../qemu-m68k/tests/m68k/move ---------------- IN: 0x800000b8: lea 0x800020d0,%a0 D0 = 00000000 A0 = 00000000 F0 = 0000000000000000 ( 0) D1 = 00000000 A1 = 00000000 F1 = 0000000000000000 ( 0) D2 = 00000000 A2 = 00000000 F2 = 0000000000000000 ( 0) D3 = 00000000 A3 = 00000000 F3 = 0000000000000000 ( 0) D4 = 00000000 A4 = 00000000 F4 = 0000000000000000 ( 0) D5 = 00000000 A5 = 00000000 F5 = 0000000000000000 ( 0) D6 = 00000000 A6 = 00000000 F6 = 0000000000000000 ( 0) D7 = 00000000 A7 = f6fff0a0 F7 = 0000000000000000 ( 0) PC = 800000b8 SR = 0000 ----- FPRESULT = 0 ---------------- IN: 0x800000be: movel %a0,%a0@- D0 = 00000000 A0 = 800020d0 F0 = 0000000000000000 ( 0) D1 = 00000000 A1 = 00000000 F1 = 0000000000000000 ( 0) D2 = 00000000 A2 = 00000000 F2 = 0000000000000000 ( 0) D3 = 00000000 A3 = 00000000 F3 = 0000000000000000 ( 0) D4 = 00000000 A4 = 00000000 F4 = 0000000000000000 ( 0) D5 = 00000000 A5 = 00000000 F5 = 0000000000000000 ( 0) D6 = 00000000 A6 = 00000000 F6 = 0000000000000000 ( 0) D7 = 00000000 A7 = f6fff0a0 F7 = 0000000000000000 ( 0) PC = 800000be SR = 0000 ----- FPRESULT = 0 qemu-m68k: tcg/tcg.c:653: tcg_temp_free_internal: Assertion `idx >= s->nb_globals && idx < s->nb_temps' failed. qemu-m68k: translate-all.c:175: tb_lock: Assertion `!have_tb_lock' failed. Laurent