 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> Microsoft provides an MSVC++ 6 processor pack for 3DNow:
> http://msdn.microsoft.com/vstudio/downloads/ppack/download.asp
The MSVC++ 6.0 processor pack works and now I use it.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 2001-02-01 10:18, Warp <war### [at] tag povray org> wrote:
>Peter J. Holzer <hjp### [at] sikitu wsr ac at> wrote:
>: a dll with the time critical routines
>
> What do you mean "a dll"?
> How do you use dll's with *STANDARD* C (or C++)?
You don't have to for two reasons:
1) Creating and using a DLL is normally done with special options to the
linker. No change to the source code is necessary, unless you need
to decide at run time which DLL you want to load, which isn't
necessary in this case. The compilation and linking process is
system dependent anyway, so an additional flag for the linker won't
hurt.
2) The optimizations Daniel are talking about are extremely system
dependent anyway. If you start replacing major parts of the source
code with inline assembly which will only compile with a certain
compiler and run on a certain platform, adding a bit of code which
handles loading a shared library on that platform (should it really
be necessary. which I doubt) is the least of your worries.
> Don't forget that povray has to be compiled for several platforms. Also
>for Linux (I don't think that Linux supports Windows DLL's),
No, it hasn't windows EXE files either, so why should it have Windows
DLLs? It has its own scheme for shared libraries.
In fact I am using povray on Linux (and sometimes HP-UX and Solaris),
not Windows.
hp
--
_ | Peter J. Holzer | All Linux applications run on Solaris,
|_|_) | Sysadmin WSR | which is our implementation of Linux.
| | | hjp### [at] wsr ac at |
__/ | http://www.hjp.at/ | -- Scott McNealy, Dec. 2000
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Windows you have the LoadLibrary/GetProcAddress/FreeLibrary calls. On
Linux you have almost identical calls (dlopen and friends). I have no
experience of other OSes, but I think things cannot be much different. In a
future version of my open source C++ library (CXL, you can find it on my
site) I plan to create a wrapper for these things making them transparent to
handle either on Windows and on Linux
Just as an example, if you look at CXL-3patch1 sources, you will find that I
have a HiResTimer class which is implemented in two completely different
ways on Windows and on Linux, but when use it you write EXACTLY the same
code (and you have almost exactly the same results).
Creating a DLL requires some macro support for code (EXPORTS etc. you can
even make the source capable of being compiled into an app/lib or dll
TRANSPARENTLY) some linker options and a runtime loading mechanism (provided
by any modern OS, EVEN Windows has it!!!).
Alessandro Coppo
a.c### [at] iol it
www.geocities.com/alexcoppo
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I think the discussion was not helpful. There are a some things which can be
optimized without any quality lost. The general things are platform
independent, the processor independent things can be put in separate source
files. PovRay would check the processor and the supported instructions (MMX,
3D!Now, SSE etc.) and the required instructions are not available PovRay
shows a message and show you where you can get the right version for your
processor. Here are a short list of things which can be optimized :
single precision which can be optimized using 3D!Now or SSE
1) Lightning
2) Mesh
general things which can be optimized
1) loops
2) float divisions (replace mutiple divisions with one division and
multiplications)
3) if then / ? :
4) integer multiplications and divisions (replace them with shift or
additions)
5) multiple integer calculations
integer arithmetic which can be otimized using MMX
1) every time multiple integers are calculate
other things which can be optimized using 3D!Now, MMX, SSE etc.
1) mathematical functions, e.g. sin, cos, tan, exp, sqr, sqrt, division etc.
2) ? :
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Daniel Jungmann wrote:
>
> general things which can be optimized
>
> 3) if then / ? :
Apart from "looking cooler", is there any benefit to using the ternary
operator? Is it really faster than an "if then else" statement? I was
under the impression that most compilers would produce identical code
underneath.
--
Francois Labreque | The surest sign of the existence of extra-
flabreque | terrestrial intelligence is that they never
@ | bothered to come down here and visit us!
videotron.ca - Calvin
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3a7d3569@news.povray.org> , "Daniel Jungmann" <DSJ### [at] gmx net>
wrote:
> general things which can be optimized
>
> 1) loops
> 2) float divisions (replace mutiple divisions with one division and
> multiplications)
> 3) if then / ? :
> 4) integer multiplications and divisions (replace them with shift or
> additions)
> 5) multiple integer calculations
It is a complete waste of time to optimize these by hand. Every compiler
can do a much better job on these and the code stays readable on your site!
If you want to seriously speed up POV-Ray, look into the intersection
algorithms and find ways how to reduce the number of intersections further.
Bounding boxes are a start, but maybe there are additional algorithms?
Thorsten
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I don't know, I just mean "if then" and "? :", not replace "if then" with "?
:".
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> It is a complete waste of time to optimize these by hand. Every compiler
> can do a much better job on these and the code stays readable on your
site!
>
> If you want to seriously speed up POV-Ray, look into the intersection
> algorithms and find ways how to reduce the number of intersections
further.
> Bounding boxes are a start, but maybe there are additional algorithms?
>
>
> Thorsten
Which compiler does these things?
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Daniel Jungmann wrote:
>
> > It is a complete waste of time to optimize these by hand. Every compiler
> > can do a much better job on these and the code stays readable on your
> site!
> >
> > If you want to seriously speed up POV-Ray, look into the intersection
> > algorithms and find ways how to reduce the number of intersections
> further.
> > Bounding boxes are a start, but maybe there are additional algorithms?
> >
> >
> > Thorsten
>
> Which compiler does these things?
Compilers do not do these things. Programmers do.
--
Ken Tyler
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Sun, 04 Feb 2001 08:10:19 -0800, Ken wrote:
>Compilers do not do these things. Programmers do.
I think he meant "which compiler [optimizes integer multiplications etc.]"
and the answer is, every one I've seen since I started writing C ten years
ago.
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |