Hello,
For the targets that support vectors, we can write the following code:

typedef short      V4H  __attribute__ ((vector_size (8)));

V4H tst(V4H a, V4H b){
  return a + b;
}

Other operators such as -, *, |, &, ^ etc are also supported.  However, vector 
shift
is not supported by frontend, including both scalar and vector second operands. 

V4H tst(V4H a, V4H b){
  return a << 3;
}

V4H tst(V4H a, V4H b){
  return a << b;
}

Currently, we have to use intrinsics to support such shift. Isn't syntax of 
vector
shift intuitive enough to be supported natively? Someone may argue it breaks the
C language. But vector is a GCC extension anyway. Support for vector add/sub/etc
already break C syntax. Any thought? Sorry if this issue had been raised in 
past.

Greetings,
Bingfeng Mei

Broadcom UK

Reply via email to