help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Data types (was: Re: Access the neighbors of an element)


From: Paul Kienzle
Subject: Re: Data types (was: Re: Access the neighbors of an element)
Date: Sat, 12 Feb 2005 15:38:28 -0500

Some more details:

On MIPS it is faster to convert to double and perform the multiplication
than to convert to a wider integer and do it.

On X86 the gains from using integer operations are much bigger than for
MIPS or PPC.

Even bigger gains for X86 32-bit architectures and LONGLONG double multiplication are possible by casting the address of the value as
a pointer to two long integers:

# elif defined(LONGLONG)
#if defined(LITTLEENDIAN_32)
  unsigned long *px = &x, *py = &y;
  if ( (px[1] && (py[1] || px[1]*y > LO)) || (py[1] && (py[1]*x > LO)) )
#else
if ((x > LO && (y > LO || (x>>HALF)*y > LO)) || (y>LO && (y>>HALF)*x > LO))
#endif
    z = MX;
  else z = x * y;


- Paul



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]