On 12 April 2012 04:21, Mans Rullgard <mans.rullg...@linaro.org> wrote:
> On 11 April 2012 16:16, Ulrich Weigand <ulrich.weig...@de.ibm.com> wrote:
>> "Singh, Ravi Kumar (Ravi)" <ravi.si...@lsi.com> wrote:
>>
>>> Are there any pragmas for selectively disabling (in one chunk of
>>> code) the vectorization, when its enabled globally.
>>
>> No, there are not (just like for all optimization settings).
>
> Are you saying __attribute__((optimise("foo"))) is a lie?

It seems to work on 4.6 on public functions:

void doubleit(int *pout, const int *pin)
{
  for (int i = 0; i < 64; i++)
    {
      pout[i] = pin[i]*2;
    }
}

(gets vectorised)

__attribute__((optimize("-fno-tree-vectorize")))
void novect(int *pout, const int *pin)
{
  for (int i = 0; i < 64; i++)
    {
      pout[i] = pin[i]*2;
    }
}

(no vector code)

The attribute applies to that function only and doesn't seem to apply
if the function is inlined, such as:

__attribute__((optimize("-fno-tree-vectorize")))
static void novect(int *pout, const int *pin)
...

void outer(int *pin, int *pout)
{
  novect(pout, pin);
}

'outer' contains vectorised code.

-- Michael

_______________________________________________
linaro-toolchain mailing list
linaro-toolchain@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-toolchain

Reply via email to