Very simple SIMD programming

Don Clugston dac at nospam.com
Wed Oct 24 02:24:13 PDT 2012


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. Try compiling it in D.

test.d(8): Error: 4 < x must be parenthesized when next to operator &
test.d(8): Error: x <= 8 must be parenthesized when next to operator &

Making that an error was such a good idea.
<g>


More information about the Digitalmars-d mailing list