OEP

149

Title

Vector operations

Summary

Take advantage of the vector operations available on modern processors.

Owner

Damian Dimmich

Status

Proposed

Date-Proposed

2006-03-15

Keywords

language vector operators arrays optimisation

Most modern processors provide instructions to perform vector operations in an efficient way. These have obvious uses in scientific and multimedia applications, and it would be nice to be able to take advantage of them in occam-pi.

Since vector operations typically require their operands to be aligned, it would be necessary to provide a new attribute that could be applied to variables to encourage the compiler to align them appropriately:

VECTOR [n]INT va, vb, vc:

Vector operations could be provided as built-in functions:

va := VECTOR.PLUS (vb, vc)

or as APL-style vector operators:

va := vb /+ vc

or by automatically vectorising replicated code:

va := [i = 0 FOR SIZE vb | vb[i] + vc[i]]
PAR i = 0 FOR SIZE vb
  va[i] := vb[i] + vc[i]

OEP/149 (last edited 2007-09-27 01:21:45 by ats1)