This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Writing a dot product that vectorizes without -fassociative-math -fno-signed-zeros -fno-trapping-math


Hello world,

Assume I want to calculate a dot product,

s = sum(a[i]*b[i], i=1..n)

The order of summation in this case should be arbitrary.

Currently, the way to do this is to write out an explicit loop
(either by by the user or by the compliler, such as a DOT_PRODUCT)
and specify the options (for the whole translation unit) that
allow associative math.

Could there be a way to specify more finegrained approch which can
set a 'yes, you can use associative math on this particular expression'
to enable automatic vectorization of, for exaple, DOT_PRODUCT?


Regards

	Thomas


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]