lenticularis39 / axpbox

AXPbox Alpha emulator
GNU General Public License v2.0
165 stars 16 forks source link

BUG(?) with math code #41

Open TheFausap opened 3 years ago

TheFausap commented 3 years ago

Hello all,

I'm using the latest snapshot compiled under Mac OS X 10.13 and clang. I am using OpenVMS 8.4.2L1 Everything is ok. I noticed some weird output on the console when I am compiling some math code under C.

SUBL_V 0000000000000000x - 18446744071562067968x = 18446744071562067968x + TRAP
[repeated several times]

The build is ok. So I don't know if this is a real bug or not.

regards, Fausto

RaymiiOrg commented 3 years ago

If it's possible, could you please post the code you're trying to compile and the steps you take to compile it?

TheFausap commented 3 years ago

Sorry for being vague, here is more context. I was trying to build the reflisp package (a lisp interpreter). The build seems ok, even if I got those messages on the axpbox console.

I compiled with the default options of CC command, i.e. CC/VERBOSE MATH.C

reflisp-bug.zip

TheFausap commented 3 years ago

Just as an example... 9 seconds to calculate 2^300 and print it

$ run lisp
; reading init.lsp 
It's nearly a quarter past six . 

2241> (load "times.lsp")
t reading times.lsp 
2479> (load "bignum.lsp")
t reading bignum.lsp 
3037> (time:perf (b-power-of-2 300))
2 to the power 300 is: 2111184054019605320843855217622375819155724851118195321145199981676251345946484577202763776
9
3052>

it seems the math code is quite ok, anyway.

fsword7 commented 3 years ago

I think that they need AXE tools and QVET tools to diagnose CPU processor and test instructions. QVET tools are available in ftp.hp.com (/pub/alphaserver/... ) I have some same problems as well. When I tried to list BCK files on DKA disk images, I got some CRC errors, etc. but was able list them from same BCK file on CDROM emulation with out any errors. etc..

TheFausap commented 3 years ago

I suppose this is not a sort of fatal error, maybe there could be some problem with some particular floating-point operation, but I suppose it will be quite difficult to debug. I am not familiar with QVET tool, I am sorry, but this only happens during the building, not at run-time, so I suppose this is also trickier to analyse.

lenticularis39 commented 3 years ago

I don't think the CRC errors are related to the CPU behavior - based on the state of most peripherals' code I would rather suspect the bug being there. Also es40 was initially written single-threaded, only later it was rewritten to be multi-threaded, introducing both known bugs and potentially yet unknown bugs into the code.

lenticularis39 commented 3 years ago

I don't know very much about hardware, though, so I might be wrong.