POV-Ray : Newsgroups : povray.programming : Parametric object issues : Re: Parametric object issues Server Time
12 May 2024 13:10:34 EDT (-0400)
  Re: Parametric object issues  
From: Thorsten Froehlich
Date: 30 Aug 2002 14:01:35
Message: <3d6fb2ff@news.povray.org>
In article <3D6F7E14.AF371036@attglobal.net> , "William F. Pokorny" 
<pok### [at] attglobalnet> wrote:

> I have looked over the POVFPU_RunDefault code and I find it both impressive
> and intimidating. I just don't understand it well enough to help. I do wonder
> how well the compilers are optimizing that huge case statement.  10 years ago
> case statements of that size were trouble for a compiler and breaking them up
> with conditionals was recommended. But, I do not know if this holds for the
> compilers of today or even if it would be possible to break this case
> statement up....

Well, modern compilers will do a good job if they don't crash optimising it
:-)

No, seriously, by design this thing is a dense switch statement which every
compiler (even really bad ones) will manage to use a branch table.  BTW, the
macros are not to intimidate people but but make the implementation easier
because there generate a real lot of code.

In any case, after lots of analysis I had to conclude that on x86 compilers
do not do a good enough job distributing the eight VM registers into the
eight stack slots, so if anybody would want to tweak it such that it uses
SSE2 registers (would limit its use, I know), at least people witha P4 would
gain a bit.

But i would recommend to not spend too much time with this code.  It is my
first VM and the "next" one for a future POV-Ray is already in development.
It will in particular deal with vectors, ints and strings, plus include all
lectures learned from implementing this VM.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.