Very simple SIMD programming

Don Clugston dac at nospam.com
Wed Oct 24 07:03:54 PDT 2012


On 24/10/12 11:33, Timon Gehr wrote:
> On 10/24/2012 11:24 AM, Don Clugston wrote:
>> On 24/10/12 04:41, bearophile wrote:
>>> I have found a nice paper, "Extending a C-like Language for Portable
>>> SIMD Programming", (2012), by Roland L., Sebastian Hack and Ingo Wald:
>>>
>>> http://www.cdl.uni-saarland.de/projects/vecimp/vecimp_tr.pdf
>>>
>>
>>> They present a simple scalar program in C:
>>>
>>> struct data_t {
>>>      int key;
>>>      int other;
>>> };
>>>
>>> int search(data_t* data , int N) {
>>>      for (int i = 0; i < N; i++) {
>>>          int x = data[i].key;
>>>          if (4 < x & x <= 8) return x;
>>>      }
>>>      return -1;
>>> }
>>
>> I don't know what that code does. I think the if statement is always
>> true.
>
> No, the code is fine.

Oh, you're right. It's crap code though.


More information about the Digitalmars-d mailing list