Re: long double data type
Re: long double data type
- Subject: Re: long double data type
- From: "Paul Sanders" <email@hidden>
- Date: Wed, 16 Jun 2010 16:29:48 +0100
Good question. I made this observation on Visual
C++. So I had a go on gcc / Intel / 32 bit and it's the other
way round - decidely so - and when I look at the code the compiler generates I
see that buf [i] = 0.0 is implemented as two 32 bit movl instructions.
Visual C does this in one shot using a scalar SSE instruction. Also, the
gcc memset is very fast so it might be using SSE 128 bit vector instructions in
the main loop.
All of which just goes to show there's no substitute for a
bit of experimentation, which is really what I was trying to say.
Regards,
Paul Sanders
----- Original Message -----
Sent: Wednesday, June 16, 2010 3:48 PM
Subject: Re: long double data type
On Wed, Jun 16, 2010 at 6:37 AM, Paul Sanders <email@hidden>
wrote:
> Bonus question: which is faster? (note that the two buffers
are actually the > same size): > > (a) char buf [8192]; memset
(buf, 0, 8192); > (b) double buf [1024]; for (int i = 0; i < 1024; ++i)
buf [i] = 0.0; > > In fact it is (b), because the code generated
uses 64 bit loads and stores. > Just goes to show there's no substitute
for a bit of experimentation.
how many compilers and C libraries have you
tested this with?
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden