Turbo Pascal 3 port of the smallpt C++ 99-line global illumination renderer
iwasdeportedandalligotwasthislousydomain.co.uk
iwasdeportedandalligotwasthislousydomain.co.uk
First of all, the source defines a "FloatType", which is set to "Real". But the real type is a 6-byte float type optimised for software floating point routines! I'd like to see the results when using the "Single" and "Double" types.
Also, it's easy to forget that x87 code generation in TP3 is an option that defaults to "don't".
I used TURBO-87.COM to compile the code with floating point
support (no doubles, just single precision) to SMALLPT.COM
(There's also a subroutine in the .com file which starts with an fninit instruction. :)Really, the difference of speed and performance is abysmal.
Also, as this is highly parallelisable problem, autovectorisation with SIMD instructions will produce huge performance boosts.
I even still have the source (keep in mind this was written ~20 years ago):