SIMD primops are now generated using schemas that are polymorphic in
authorGeoffrey Mainland <gmainlan@microsoft.com>
Wed, 21 Aug 2013 15:18:24 +0000 (16:18 +0100)
committerGeoffrey Mainland <gmainlan@microsoft.com>
Mon, 23 Sep 2013 02:33:59 +0000 (22:33 -0400)
commit16b350a4227c96e09533c6f165895f50003d3801
treef2fbf6f0f4b5ea2a406cd6a078fc1cb7cce31ad5
parentda5a647c0c49fee7531ef4c076b1c9e6a9d0fe6d
SIMD primops are now generated using schemas that are polymorphic in
width and element type.

SIMD primops are now polymorphic in vector size and element type, but
only internally to the compiler. More specifically, utils/genprimopcode
has been extended so that it "knows" about SIMD vectors. This allows us
to, for example, write a single definition for the "add two vectors"
primop in primops.txt.pp and have it instantiated at many vector types.
This generates a primop in GHC.Prim for each vector type at which "add
two vectors" is instantiated, but only one data constructor for the
PrimOp data type, so the code generator is much, much simpler.
15 files changed:
compiler/cmm/CmmMachOp.hs
compiler/cmm/PprC.hs
compiler/codeGen/StgCmmPrim.hs
compiler/ghc.mk
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
compiler/nativeGen/X86/CodeGen.hs
compiler/prelude/PrelNames.lhs
compiler/prelude/PrimOp.lhs
compiler/prelude/TysPrim.lhs
compiler/prelude/primops.txt.pp
utils/genprimopcode/Lexer.x
utils/genprimopcode/Main.hs
utils/genprimopcode/Parser.y
utils/genprimopcode/ParserM.hs
utils/genprimopcode/Syntax.hs