[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [iiwusynth-devel] Bugs / optimization
From: |
Peter Hanappe |
Subject: |
Re: [iiwusynth-devel] Bugs / optimization |
Date: |
Tue, 29 Oct 2002 01:06:35 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020205 |
M. Nentwig wrote:
you can't use SSE to calculate the sum of four floats at once as in
sum(a0,a1,a2,a3).
Yes, I think you are right. Do you know how expensive an addition is,
compared to a multiplication? If it is about the same, we could process
four samples at a time and then do the respective additions in parallel
afterwards. Will require some comments, though :(
We could split the dsp loop into two parts, the length of the first part is a
multiple of four so we can calculate four samples at once, the second part is
the remainder (0 to 3 samples).
I have a suspicion, that calculating the phase is another minor
bottleneck. Maybe there are still some folks with old hardware out
there, but I'm tempted to use a 'long long' integer instead.
I did a quick test with 64 bits integers the other day but somehow messed up.
I think it would be good indeed. The current implementation was already a
fair speedup compare to using double float for the phase.
The current definition for the phase I use locally is:
typedef union {
struct {
sint32 index;
uint32 fract;
} s;
sint64 ll;
} iiwu_phase_t;
What I'd like to obtain is that we can use index and fract to get the
integer and fractional part (no bit shifting or masking) and use
the long long for phase increments. Machines without long longs
can still use the old macros.
In my code, I've also added a file, iiwu_types.h, that defines the integer
types. I've copy/pasted part of it below. I can commit it to CVS right
away I've you'd like to use it.
Cheers,
Peter
-----------------------------------------------------------------------
/** Real type */
typedef float iiwu_real_t;
/** Integer types */
#if defined(_WIN32)
/* Windows */
typedef signed __int8 sint8;
typedef unsigned __int8 uint8;
typedef signed __int16 sint16;
typedef unsigned __int16 uint16;
typedef signed __int32 sint32;
typedef unsigned __int32 uint32;
typedef signed __int64 sint64;
typedef unsigned __int64 uint64;
#elif defined(MACINTOSH)
/* Macintosh */
typedef signed char sint8;
typedef unsigned char uint8;
typedef signed short sint16;
typedef unsigned short uint16;
typedef signed int sint32;
typedef unsigned int uint32;
#error FIXME: define 64 bits types for macintosh (ppc)
typedef int64_t sint64;
typedef u_int64_t uint64;
#else
/* Linux */
typedef int8_t sint8;
typedef u_int8_t uint8;
typedef int16_t sint16;
typedef u_int16_t uint16;
typedef int32_t sint32;
typedef u_int32_t uint32;
typedef int64_t sint64;
typedef u_int64_t uint64;
#endif
-----------------------------------------------------------------------
Cheers
Markus
_______________________________________________
iiwusynth-devel mailing list
address@hidden
http://mail.nongnu.org/mailman/listinfo/iiwusynth-devel