Re: [hatari-devel] Basic cpu testsuite |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Basic cpu testsuite
- From: Thomas Huth <th.huth@xxxxxxxxx>
- Date: Tue, 1 May 2018 08:34:32 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1525156473; bh=QEX0ZrmaY7N7OmnrNa1rJ1kRh1JDDeyDFy8tNle+Pxo=; h=Date:From:To:Subject:From; b=BBPQ04mEWZOgNw3SVcSCz9UwxSd404A5zM3+2kJpRXp09/EiPx4OGAcEq8Q0huuz+ h8PKMK1ALic5ILyUqazS+bohuCK2rnGXHEdpcx6EvXjtFAkijfH2zus9j+SEOYdqDT FCbQ8qr8LD4IrbDiq2qp9ODxUcbTiijic88gX6O649SZvvIQmq05aiBzlCkcYMe7EB 6nDX1QLmNKPKgpp55XS/ZiRqX410WuxlRaa67+YdtzWgSRtnK0moZZ49cdPOF59jdz L2MwggefeDDZYlvCi7YrfZbA+3vjj6V5heiXRko+4W9kWsiLhNpDPJM2rG5ReWUqOq 3OJBDoZHZFT6w==
Hi,
Am Sun, 29 Apr 2018 16:41:37 +0300
schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:
>
> On 04/28/2018 11:33 AM, Thomas Huth wrote:
> > Am Sat, 28 Apr 2018 09:20:20 +0200
> > schrieb Thorsten Otto <admin@xxxxxxxxxxx>:
[...]
> >> The archive now also contains the whole tests/cpu directory. The
> >> patch is in a separate attachment. The only difference is that the
> >> patch also has 2 small changes, to .hgignore and
> >> tests/CMakeLists.txt.
> >
> > Ok, that's a big patch ... give me some time to digest it, please.
> >
> > Some quick questions after having a first glance:
> >
> > - Did you write all the code on your own? Or does this include some
> > third party code? Can all be licensed under the terms of the GPL?
> >
> > - In case we decide to put the corresponding binaries into the
> > repository (since not everybody has the cross compiler
> > installed),
>
> IMHO the CMake changes for compiling the binaries could be skipped.
>
> Rest of the tests aren't built as part of Hatari build process either.
> There's just source code & make files for building them separately
> (I'm building them "natively" under Hatari or Aranym).
I really like the idea of being able to compile all the stuff with a
cross-compiler... however, after having a closer look at Thorsten's
patch and especially at libcmini, I came to the conclusion that I do
not want to add this libcmini dependencies to Hatari: If we decide to
add code that compiles with m68k-atari-mint-gcc, we have to ship our own
version of libcmini, too (since the mintlib is really a no-go for the
--tos none mode). I really would like to avoid that, I don't want to
maintain a libc implementation in the Hatari repository. So I also
spent quite some time yesterday to see whether I could make it work
with the official libcmini from github, so that we could tell people to
put that libcmini.a in the lib directory of their cross-compiler
installation, but I only ran from one problem into the other while
trying to make that work in the "--tos none" mode.
After some hours, I stopped that experiment, and tried to convert one
of Thorsten's test to the "inline" assembly of AHCC instead, and got
that working pretty fast, including printf:
#include "testdriver.h"
int numtests;
int status;
char fail;
int errno;
/* test that ADDX does clears Z only if result is nonzero */
void __asm__ test_nonzero(void)
{
clr.l d0
move.l #1,d1
addx d0,d0
seq fail
rts
}
int main(void)
{
long d0, d1;
status = 0;
fail = 0;
printf("hello world\n");
++numtests;
test_nonzero();
CHECK(fail);
return status;
}
The compiled binary is also only ca. 75% of the size of a binary
created with gcc + libcmini ... so I currently think we rather should
continue to recommend AHCC for creating testing binaries insted. Sorry,
Thorsten. When I got some spare time, I might convert some of your
tests to AHCC and add these to the Hatari repository, if that's ok for
you.
Thomas