Vector operators in which one operand is a scalar may not apply implicit conversions to the scalar operand in host emulation. For example, the following will result in a compilation error due to failing template argument deduction in host emulation:
uint8_t op2;
int16 foo(int * op1, int ch)
{ return ((int16)op1[ch]) * op2; }
Workaround:
If the scalar operand is explicitly cast to the element type of the vector, no compilation error will occur in host emulation:
uint8_t op2;
int16 foo(int * op1, int ch)
{ return ((int16)op1[ch]) * (int32_t) op2; }
|