On Fri, 2004-07-02 at 00:40, Erik de Castro Lopo wrote:
> > Eric what do you think ? can something like that be coded efficiently
> > using SSE/SSE2 ?
>
> Probably not. There are some algorithms which simply can't be vectorized.
SSE2 is usually significantly faster for non-vectorized code also.
On Thu, 1 Jul 2004 09:14:46 +0100
Steve Harris <[EMAIL PROTECTED]> wrote:
> On Wed, Jun 30, 2004 at 11:09:28 +0200, Tim Goetze wrote:
> > so if you want quick fractional sample lookups, the best option on x86
> > i see is to manually "fldcw" before and after your sample loop, and
> > use lrintf()
On tor, 2004-07-01 at 23:40, Erik de Castro Lopo wrote:
> On Thu, 01 Jul 2004 18:18:41 +0200
> Benno Senoner <[EMAIL PROTECTED]> wrote:
>
> > Eric what do you think ? can something like that be coded efficiently
> > using SSE/SSE2 ?
>
> Probably not. There are some algorithms which simply can't
On Thu, 1 Jul 2004 15:15:22 -0700 (PDT)
Dan Hollis <[EMAIL PROTECTED]> wrote:
> On Fri, 2 Jul 2004, Erik de Castro Lopo wrote:
> > On Thu, 01 Jul 2004 18:18:41 +0200
> > Benno Senoner <[EMAIL PROTECTED]> wrote:
> > > Eric what do you think ? can something like that be coded efficiently
> > > usin
On Fri, 2 Jul 2004, Erik de Castro Lopo wrote:
> On Thu, 01 Jul 2004 18:18:41 +0200
> Benno Senoner <[EMAIL PROTECTED]> wrote:
> > Eric what do you think ? can something like that be coded efficiently
> > using SSE/SSE2 ?
> Probably not. There are some algorithms which simply can't be vectorized.
On Thu, 01 Jul 2004 18:18:41 +0200
Benno Senoner <[EMAIL PROTECTED]> wrote:
> Eric what do you think ? can something like that be coded efficiently
> using SSE/SSE2 ?
Probably not. There are some algorithms which simply can't be vectorized.
Erik
--
+
Ruben van Royen wrote:
First of all, I was not yet talking about vectorizing your code which is often
hard, especially for a compiler. but SSE can be used on scalars as well (as
you probably know).
The fact is that the intel pentium 4 optimization guide says that SSE code is
generally as fast as
First of all, I was not yet talking about vectorizing your code which is often
hard, especially for a compiler. but SSE can be used on scalars as well (as
you probably know).
The fact is that the intel pentium 4 optimization guide says that SSE code is
generally as fast as or faster than regular
On Thursday 01 July 2004 14:41, Tim Goetze wrote:
> [Ruben van Royen]
>
> >please note that SSE2 has support for 64bit floats (doubles) and contains
> > an instruction that truncates to int, irregardless of controlwords. A new
> > enough gcc with (-march=pentium4 or -msse2) and -mfpmath=sse will
Jens M Andreasen wrote:
Why not just use modf?
double fullindex, increment, integer, fraction;
// int i;
fullindex += increment;
fraction = modf(fullindex, &integer);
// i = integer;
C99 have float and long double versions as well.
The problem of modf is that it is slow (it generates "cal
[Ruben van Royen]
>please note that SSE2 has support for 64bit floats (doubles) and contains an
>instruction that truncates to int, irregardless of controlwords. A new enough
>gcc with (-march=pentium4 or -msse2) and -mfpmath=sse will use sse instead of
>the old fp unit. This has more advantages, s
[Ruben van Royen]
>The problem is that the rounding mode affects all floating point operations,
>such as multiply and divide. And normally you must do rounding and not
>truncation. Thus changing the mode will change the results, and a compiler is
>not allowed to do that.
yes, and it is wise to ch
On Thu, 1 Jul 2004 10:25:51 +0200
Ruben van Royen <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> please note that SSE2 has support for 64bit floats (doubles) and contains an
> instruction that truncates to int, irregardless of controlwords. A new enough
> gcc with (-march=pentium4 or -msse2) and -mf
On Thu, Jul 01, 2004 at 10:25:51AM +0200, Ruben van Royen wrote:
> Hi all,
>
> please note that SSE2 has support for 64bit floats (doubles) and contains an
> instruction that truncates to int, irregardless of controlwords. A new enough
> gcc with (-march=pentium4 or -msse2) and -mfpmath=sse wil
The problem is that the rounding mode affects all floating point operations,
such as multiply and divide. And normally you must do rounding and not
truncation. Thus changing the mode will change the results, and a compiler is
not allowed to do that.
Only in very specific cases, such as a loop t
Hi all,
please note that SSE2 has support for 64bit floats (doubles) and contains an
instruction that truncates to int, irregardless of controlwords. A new enough
gcc with (-march=pentium4 or -msse2) and -mfpmath=sse will use sse instead of
the old fp unit. This has more advantages, since sse
On Wed, Jun 30, 2004 at 11:09:28 +0200, Tim Goetze wrote:
> so if you want quick fractional sample lookups, the best option on x86
> i see is to manually "fldcw" before and after your sample loop, and
> use lrintf() or "fistpl" directly to obtain integer indices inside
> the loop.
I wonder why gcc
[Jens M Andreasen]
>On tis, 2004-06-29 at 17:15, Steve Harris wrote:
>> >integer = lrintf(fullindex);
>> >fractional = fullindex - integer;
>>
>> I dont think this is right, fractional will be [-0.5, 0.5], rather than
>> [0,1] which is more noirmal as lrintf() rounds to the nearest.
>>
>>
On Wed, 30 Jun 2004 15:25:53 -0400
Pete Bessman <[EMAIL PROTECTED]> wrote:
> Ah. Now I get to find all the places in my code that can benefit from
> that. If you assign a float value into an int variable, is that an
> implicit cast?
Yes, see my paper here:
http://www.mega-nerd.com/FPcast/
At Wed, 30 Jun 2004 16:37:59 +0100 (BST),
Mike Rawes wrote:
>
> --- Pete Bessman <[EMAIL PROTECTED]> wrote:
> > At Mon, 28 Jun 2004 19:56:50 +1000,
> > Erik de Castro Lopo wrote:
> > >
> > > double fractional = 0.0, increment = 0.1;
> > > int integer = 0;
> > >
> > > for (;;)
> > >
On tis, 2004-06-29 at 17:15, Steve Harris wrote:
> On Tue, Jun 29, 2004 at 10:19:32AM +0200, Benno Senoner wrote:
> > for (;;)
> > {
> >/* Bunch of other code. */
> >
> >fullindex += increment;
> >integer = lrintf(fullindex);
> >fractional = fullindex - integer;
>
> I dont think
--- Pete Bessman <[EMAIL PROTECTED]> wrote:
> At Mon, 28 Jun 2004 19:56:50 +1000,
> Erik de Castro Lopo wrote:
> >
> > double fractional = 0.0, increment = 0.1;
> > int integer = 0;
> >
> > for (;;)
> > {
> > /* Bunch of other code. */
> >
> > fractional += increm
At Mon, 28 Jun 2004 19:56:50 +1000,
Erik de Castro Lopo wrote:
>
>
> People who play around with floating point code (especially on x86)
> quickly learn about the evils of comparing the equality of one floating
> point value with another.
I got my first lesson just a couple of days ago, in fact
Erik de Castro Lopo wrote:
On Tue, 29 Jun 2004 10:19:32 +0200
Benno Senoner <[EMAIL PROTECTED]> wrote:
In LinuxSampler we do
double increment;
double fullindex;
int integer;
double fractional;
for (;;)
{
/* Bunch of other code. */
fullindex += increment;
integer = lrintf(fullindex
On Tue, 29 Jun 2004 10:19:32 +0200
Benno Senoner <[EMAIL PROTECTED]> wrote:
> In LinuxSampler we do
>
> double increment;
> double fullindex;
> int integer;
> double fractional;
> for (;;)
> {
> /* Bunch of other code. */
>
> fullindex += increment;
> integer = lrintf(ful
On Tue, Jun 29, 2004 at 10:19:32AM +0200, Benno Senoner wrote:
> for (;;)
> {
>/* Bunch of other code. */
>
>fullindex += increment;
>integer = lrintf(fullindex);
>fractional = fullindex - integer;
I dont think this is right, fractional will be [-0.5, 0.5], rather than
[0,1] whi
Erik de Castro Lopo wrote:
The fix in this case was this:
for (;;)
{
/* Bunch of other code. */
fractional += increment ;
rem = fmod (fractional, 1.0); /* floating point modulus */
integer += lrint (round (fractional - rem));
fractional = rem;
On Mon, Jun 28, 2004 at 12:23:37 +0200, Maarten de Boer wrote:
> Hi Erik,
>
> Depending on the ranges of your increment, and the accuracy you
> want to obtain, you might consider doing this with integers only.
Yes, for this kind of accumulator thing I often use a hacked up
fixedpoint representati
Hi Erik,
Depending on the ranges of your increment, and the accuracy you
want to obtain, you might consider doing this with integers only.
Maarten
> The fix in this case was this:
>
> for (;;)
> {
> /* Bunch of other code. */
>
> fractional += increment ;
> rem
Hi all,
People who play around with floating point code (especially on x86)
quickly learn about the evils of comparing the equality of one floating
point value with another.
There are other related evils with floating point one of which I was
bitten by just recently and I thought I'd share it wi
30 matches
Mail list logo