From fnaumann@mail.cs.uni-magdeburg.de Wed Jan 28 05:50:40 2004 Subject: [MiNT] Strange FPU Stuff From: Mark Duckworth To: mint@fishpool.com Content-Type: text/plain Message-Id: <1075265178.5064.6.camel@pikachu.atari-source.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Tue, 27 Jan 2004 23:46:18 -0500 Content-Transfer-Encoding: 7bit Delivered-To: mint@fishpool.com Delivered-To: mint@lists.fishpool.fi X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: mduckworth@atari-source.com Precedence: bulk List-help: List-unsubscribe: List-ID: X-List-ID: Hello guys, I am trying to determine if my fpu problems are hardware or software (fpu emulator of ct60) related. Here's a post with a sample program: http://gcc.gnu.org/ml/gcc-bugs/1999-03n/msg00897.html Here is some interesting results similar to the bug he described: root@washi:/root/fputest>gcc -m68020-60 -m68881 -msoft-float -o fptest fptest.c root@washi:/root/fputest>./fptest rounding is double, result = 0x640005, expected result = 0x640005 rounding is float, result = 0x640005, expected result = 0x640005 root@washi:/root/fputest>gcc -m68020-60 -m68881 -o fptest fptest.c root@washi:/root/fputest>./fptest rounding is double, result = 0x640006, expected result = 0x640005 rounding is float, result = 0x640006, expected result = 0x640005 root@washi:/root/fputest>gcc -m68060 -o fptest fptest.c root@washi:/root/fputest>./fptest rounding is double, result = 0x640005, expected result = 0x640005 rounding is float, result = 0x640005, expected result = 0x640005 root@washi:/root/fputest>gcc -m68060 -m68881 -o fptest fptest.c root@washi:/root/fputest>./fptest rounding is double, result = 0x640005, expected result = 0x640005 rounding is float, result = 0x640005, expected result = 0x640005 root@washi:/root/fputest>gcc -m68000 -m68881 -o fptest fptest.c root@washi:/root/fputest>./fptest rounding is double, result = 0x640006, expected result = 0x640005 rounding is float, result = 0x640006, expected result = 0x640005 root@washi:/root/fputest> Can anyone make sense of these results? Note the sample code and read the post it describes a possible 060 bug so this may not be relevant as to whether or not my 060 is okay. But check this out. This is an fpu test program. root@washi:/root/fputest>gcc -DACCURACY -DINTRIG -o fputest fputest.c fputest.c:554: warning: `transit_surface' was declared implicitly `extern' and later `static' fputest.c:509: warning: previous declaration of `transit_surface' root@washi:/root/fputest>./fputest Beginning execution of floating point accuracy test... Pass 100. Pass 200. root@washi:/root/fputest> This is the only way this fpu test program works at all, the -DINTRIG uses internal routines for all floating point functions (defined in the .c). Compiling with -msoft-float gives this: root@washi:/root/fputest>gcc -DACCURACY -m68020-60 -msoft-float -o fputest fputest.c fputest.c:554: warning: `transit_surface' was declared implicitly `extern' and later `static' fputest.c:509: warning: previous declaration of `transit_surface' fputest.c: In function `sin': /usr/include/bits/math-68881.h:79: inconsistent operand constraints in an `asm' fputest.c: In function `cos': /usr/include/bits/math-68881.h:92: inconsistent operand constraints in an `asm' fputest.c: In function `tan': /usr/include/bits/math-68881.h:105: inconsistent operand constraints in an `asm'fputest.c: In function `asin': /usr/include/bits/math-68881.h:118: inconsistent operand constraints in an `asm'root@washi:/root/fputest> Mint soft-float bug? Compiling any other way that I can think of works but gives failed tests, such as with -m68020-60 -m68881 or -m68020-60 (-m68881 defined implicitly I believe). Without -m68881 defined explicitly (68000) or implicitly (68020 and above) the compile fails because of missing math functions. So I thought I'd post this here first before the mintlist because If I can't compile the test progs then who cares ;-) Thanks, Mark