POV-Ray : Newsgroups : povray.programming : optimizing / 3dnow : optimizing / 3dnow Server Time
28 Jul 2024 12:35:36 EDT (-0400)
  optimizing / 3dnow  
From: josh
Date: 16 May 2001 03:27:43
Message: <3B022C14.C6D41740@smileyface.com>
Hi there.

I've been playing with the POV source for two weeks or so, looking for
happy things I could do with 3dnow.  Judging by some horribly calculated
benchmarks and a few passes through CodeAnalyst:

I think you might be able to get about a 4% speed increase by using
3dnow for color operations.  Not everywhere mind you, a small chunk of
3dnow in the middle of floating point code is a bad thing.

There seems to be a similar increase from simply aligning COLOURs to 8
bytes by padding them to 6 elements rather than 5.  This would of course
backfire on large scenes that don't fit in memory.  (If it's not just a
hallucination :)

Some parts of the BBox code might benefit from 3dnow.  Check_And_Encode
seems to be used a lot (iirc, around 10% cpu time in my tests), and
afaict isn't hurt by using single precision.  'Course I can't say I
really understand it, so what do I know? ;)

I was also puzzled by the following from the area light code:
            New_v1 = (int)ceil  ((v1 + v2)/2.0);
            New_u2 = (int)floor ((u1 + u2)/2.0);
I'm having a hard time seeing why floating point functions were even
considered here.  All the variables involved are ints.  Is there some
condition where this is diffeent from this?:
            New_v1 = ((v1 + v2 + 1) / 2);
            New_u2 = ((u1 + u2) / 2);
I don't think it makes much of a difference time-wise, but it just seems
very strange to me.

Some other things from my early, naive attempts: with all single prec
math (DBL = float) it can't even parse scenes properly, and with all
VECTORs as single prec, x and y are not perpendicular.  (could probly be
fixed by changing some #defines, but in retrospect, I doubt it would be
a good idea)

Just thought someone might find this interesting.

-josh


Post a reply to this message

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