POV-Ray : Newsgroups : povray.unix : Pentium 3 optimized binary : Re: Pentium 3 optimized binary Server Time
28 Jul 2024 16:22:41 EDT (-0400)
  Re: Pentium 3 optimized binary  
From: Micha Riser
Date: 3 Aug 2002 14:27:03
Message: <3d4c2076@news.povray.org>
Christopher James Huff wrote:
> 
> You mean for helping the compiler detect something that can be
> vectorized and doing it automatically? It won't pick out the possibility
> in the one-line version?
> Would it get this version?
> DBL value = 0;
> value += sin(EPoint[0]);
> value += sin(EPoint[1]);
> value += sin(EPoint[2]);
> return Sqr(value/3.0);

No, unfortunately the Intel compiler (the only one that I have which does 
vectorisation) does not recoginze this. You explicitly have to use a loop. 
I have done rewriting vector.h in such a way. But I have no Pentium4 to 
test it :( 

> I'm not surprised the for loop wasn't used in the existing
> version...SIMD stuff wasn't even a factor, so of course the code wasn't
> designed for it, and compilers probably weren't good enough at
> optimizing to get rid of the for() loop.

Todays g++ 3.1 does a good job in loop-unrolling. But with my modified 
loop-using 'vector.h' it does still produce a slightly slower code (OK, 
maybe I have also made some mistakes in the converting..)

- Micha 

-- 
http://objects.povworld.org - the POV-Ray Objects Collection


Post a reply to this message

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