Skip to content

m68k: 68030 (?): fmove.p doesn't work (6888[1|2] emulation isn't implemented??)

Description of problem

The following code should be executing a move to the fpu and then a move from it and then branching.

        ff813590 f2 10 4f 00     fmove.p    (A0),FP6
        ff813594 f2 11 6f 7f     fmove.p    FP6,(A1) {#0x7f}
        ff813598 61 00 fe 52     bsr.w      SUB_ff8133ec

However, hitting the instruction at 0xff813590 causes the PC to go off into the weeds and then the emulation gets stuck and never proceeds.

Before executing the instruction the CPU state looks like this

(qemu) info registers

CPU#0
D0 = ffffffff   A0 = ff813584   F0 = c004 cc00000000000000  (         -51)
D1 = 0000ffff   A1 = 0000335e   F1 = c00d a866000000000000  (      -21555)
D2 = 00000002   A2 = ff8138a2   F2 = 401b 91a2b3c000000000  (  3.0542e+08)
D3 = 00000003   A3 = ff824008   F3 = 3fb4 ab3c4d0000000000  ( 3.54107e-23)
D4 = 00000004   A4 = ff81dbb6   F4 = 3d12 919a22ab33bc4000  (3.84141e-226)
D5 = 00000000   A5 = 00000400   F5 = 1020 8060708090a0b0c0  (           0)
D6 = 0000000c   A6 = 00003790   F6 = 7fff ffffffffffffffff  (         nan)
D7 = 00000000   A7 = 0000316e   F7 = 7fff ffffffffffffffff  (         nan)
PC = ff813590   SR = 2708 T:0 I:7 SI -N---
FPSR = 00000000 ---- 
                                FPCR =     0000 X RN 
  A7(MSP) = 00000000   A7(USP) = 80000000 ->A7(ISP) = 00003796
VBR = 0x0000338e
SFC = 3 DFC 0
SSW 00000000 TCR 00000000 URP 00000000 SRP 00000000
DTTR0/1: 00000000/00000000 ITTR0/1: 00000000/00000000
MMUSR 00000000, fault at 00000000

After single stepping:

(qemu) info registers

CPU#0
D0 = ffffffff   A0 = ff813584   F0 = c004 cc00000000000000  (         -51)
D1 = 0000ffff   A1 = 0000335e   F1 = c00d a866000000000000  (      -21555)
D2 = 00000002   A2 = ff8138a2   F2 = 401b 91a2b3c000000000  (  3.0542e+08)
D3 = 00000003   A3 = ff824008   F3 = 3fb4 ab3c4d0000000000  ( 3.54107e-23)
D4 = 00000004   A4 = ff81dbb6   F4 = 3d12 919a22ab33bc4000  (3.84141e-226)
D5 = 00000000   A5 = 00000400   F5 = 1020 8060708090a0b0c0  (           0)
D6 = 0000000c   A6 = 00003790   F6 = 7fff ffffffffffffffff  (         nan)
D7 = 00000000   A7 = 00003166   F7 = 7fff ffffffffffffffff  (         nan)
PC = ff8138a2   SR = 2708 T:0 I:7 SI -N---
FPSR = 00000000 ---- 
                                FPCR =     0000 X RN 
  A7(MSP) = 00000000   A7(USP) = 80000000 ->A7(ISP) = 0000316e
VBR = 0x0000338e
SFC = 3 DFC 0
SSW 00000000 TCR 00000000 URP 00000000 SRP 00000000
DTTR0/1: 00000000/00000000 ITTR0/1: 00000000/00000000
MMUSR 00000000, fault at 00000000

With this code the VBR doesn't point at an actual vector table from what I can tell and it is pointing at some memory that contains 0xff8138a2 so I guess it hits the instruction, the FPU isn't implemented so it tries to do an F-line exception instead but the vector table doesn't actually contain a handler and it's trying to execute garbage that causes the lock up.

Basically, I guess I need to implement the 6888[1|2] for this code to work.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information