[Simh] simh and jump tables
Villy Madsen
Villy.Madsen at shaw.ca
Sun Apr 9 12:12:26 EDT 2006
Well
the end result of 10 - 12 hours of intensive coding is the discovery that
switch statements in C (well GCC) at least are coded as computed jumps - a
fact that I might have realized if I didn't have
this long standing hate relationship with C.
After my recoding and recompiling using mingw, i brought up NetBSD (still
waiting for my VMS distribution) and ran a math stress test call STREAM.
the good news was that it ran about 2.5x faster with my modified VAX.EXE
than the distributed exe did (both with Ethernet Support).
the bad news was that it ran marginally slower than a VAX.EXE compiled from
the original source by mingw. The only explanation that I could think of
was that GCC must generate jump tables - and once I discover that a switch
- case construction only works with integers - everything fell into
perspective. As I mentioned in a previous posting, the distributed exe is
also ~twice the size of the GCC version.
The big question now is - which compiler was used to generate the
distribution.
Interesting exercise - if somewhat futile.
Villy
Villy Madsen
www.members.shaw.ca/villy.madsen
More information about the Simh
mailing list