Re: [hatari-devel] Possible bug in 060 exception stack frames

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


On Sonntag, 17. Januar 2021 13:55:26 CET Thorsten Otto wrote:

> But have you ever run the test program there? I think using -(a7) or (a7)+

> in conjunction with mulu.l is rather unusual.

 

If you want do that, it should be rather easy.

 

Source for the program that i'm using on Atari can be found at https://github.com/th-otto/fpsp/blob/master/fpsp060/fpsptst.s

 

All it does it:

 

- provide the needed startup code for Atari

 

- call the test functions:

https://github.com/th-otto/fpsp/blob/03e2253370f9c8dce928c241c1e37936f623de33/fpsp060/fpsptst.s#L32

 

- provide callbacks to print a string and number (these have to be adjusted for Amiga)

 

 

- provide the callout sections for the actual test program. This can be taken verbatim from https://github.com/th-otto/fpsp/blob/03e2253370f9c8dce928c241c1e37936f623de33/fpsp060/fpsptst.s#L131 and onward. The itest.sa and ftest.sa are part of the original package.

 

 

The entry point for the unimplemented integer instruction can for example be found here: https://github.com/torvalds/linux/blob/0da0a8a0a0e1845f495431c3d8d733d2bbf9e9e5/arch/m68k/ifpsp060/src/isp.S#L397

 

It copies all the registers to a consecutive area on the stack, in order to access them later for ea calculation. What happens for the crash though, is that the opcode of the instruction causing the exception is read as zero, which causes the calc_ea function to run into nowhere-land.

 

 

PS.: the floating point tests currently also fail (but dont crash):

 

Testing 68060 FPSP started:

Unimplemented <ea>...2 failed

Unimplemented data type/format...1 failed

Non-maskable overflow...1 failed

Non-maskable underflow...1 failed

Testing 68060 FPSP unimplemented instruction started:

Unimplemented FP instructions...2 failed

Testing 68060 FPSP exception enabled started:

Enabled SNAN...1 failed

Enabled OPERR...1 failed

Enabled overflow...1 failed

Enabled underflow...1 failed

Enabled DZ...1 failed

Enabled inexact...1 failed

 

I'm currenlty checking, why.



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/