[Haskell-cafe] optimising for vector units

Duncan Coutts duncan.coutts at worcester.oxford.ac.uk
Mon Jul 26 07:35:06 EDT 2004

On Mon, 2004-07-26 at 10:58, MR K P SCHUPKE wrote:
> In the absence of such a standard, the best that can be done is to
> abstract vectorisation by word size and number of words, and supply
> a software implementation of all vector ops to use if the hardware
> does not support certain primitives.

Recent version of gcc provides a semi-portable vector extension. You
define some vector data types and gcc will make use of whatever vector
capability exists on the machine you are compiling for. Otherwise it
uses narrower vector units if possible or just scaler units if that is
all that is available.


Correct me if I'm wrong but I thought that there was some overhead to
making FFI (even safe/unsafe) which would probably kill any advantage
from using small vector units. In which case it'd need to be implemented
as ghc primitive ops which is rather more work.


More information about the Haskell-Cafe mailing list