SIMD benchmark

Manu turkeyman at gmail.com
Mon Jan 16 08:46:59 PST 2012


On 16 January 2012 18:17, Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org
> wrote:

> On 1/15/12 12:56 AM, Walter Bright wrote:
>
>> I get a 2 to 2.5 speedup with the vector instructions on 64 bit Linux.
>> Anyhow, it's good enough now to play around with. Consider it alpha
>> quality. Expect bugs - but make bug reports, as there's a serious lack
>> of source code to test it with.
>> -----------------------
>> import core.simd;
>>
>> void test1a(float[4] a) { }
>>
>> void test1()
>> {
>> float[4] a = 1.2;
>> a[] = a[] * 3 + 7;
>> test1a(a);
>> }
>>
>> void test2a(float4 a) { }
>>
>> void test2()
>> {
>> float4 a = 1.2;
>> a = a * 3 + 7;
>> test2a(a);
>> }
>>
>
> These two functions should have the same speed.


A function using float arrays and a function using hardware vectors should
certainly not be the same speed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120116/e3881a3a/attachment.html>


More information about the Digitalmars-d mailing list