Monte Carlo Method and pi

Paul Rubin http
Tue Jul 13 00:40:40 EDT 2004


Tim Hochberg <tim.hochberg at ieee.org> writes:
> > If someone volunteers, that would be great.  I don't know anything
> > about x86 floating point;  is it a real mess?
> 
>  From what I understand yes, but I haven't looked at assembly, let
> alone machine code for many, many years and I was never particularly
> adept at doing anything with it.

x86 floating point is a simple stack-based instruction set (like an HP
calculator), plus some hacks that let you improve efficiency by
shuffling the elements of the stack around in parallel with doing
other operations (requiring careful instruction scheduling to use
effectively), plus several completely different and incompatible
vector-register oriented instruction sets (SSE2, 3DNow!) that are only
on some processor models and are sort of a bag on the side of the x86.
So x86 floating point is a mess in the sense that generating really
optimal code on every cpu model requires understanding all this crap.
But if you just use the basic stack-based stuff, it's pretty simple to
generate code for, and that code will certainly outperform interpreted
code by a wide margin.



More information about the Python-list mailing list