summaryrefslogtreecommitdiff
path: root/compiler/cmm/CmmMachOp.hs
diff options
context:
space:
mode:
authorGeoffrey Mainland <gmainlan@microsoft.com>2013-08-21 16:18:24 +0100
committerGeoffrey Mainland <gmainlan@microsoft.com>2013-09-22 22:33:59 -0400
commit16b350a4227c96e09533c6f165895f50003d3801 (patch)
treef2fbf6f0f4b5ea2a406cd6a078fc1cb7cce31ad5 /compiler/cmm/CmmMachOp.hs
parentda5a647c0c49fee7531ef4c076b1c9e6a9d0fe6d (diff)
downloadhaskell-16b350a4227c96e09533c6f165895f50003d3801.tar.gz
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.
Diffstat (limited to 'compiler/cmm/CmmMachOp.hs')
-rw-r--r--compiler/cmm/CmmMachOp.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/cmm/CmmMachOp.hs b/compiler/cmm/CmmMachOp.hs
index 8d42bbd2cb..c009d15e25 100644
--- a/compiler/cmm/CmmMachOp.hs
+++ b/compiler/cmm/CmmMachOp.hs
@@ -118,6 +118,10 @@ data MachOp
| MO_VS_Rem Length Width
| MO_VS_Neg Length Width
+ -- Unsigned vector multiply/divide
+ | MO_VU_Quot Length Width
+ | MO_VU_Rem Length Width
+
-- Floting point vector element insertion and extraction operations
| MO_VF_Insert Length Width -- Insert scalar into vector
| MO_VF_Extract Length Width -- Extract scalar from vector
@@ -375,6 +379,9 @@ machOpResultType dflags mop tys =
MO_VS_Rem l w -> cmmVec l (cmmBits w)
MO_VS_Neg l w -> cmmVec l (cmmBits w)
+ MO_VU_Quot l w -> cmmVec l (cmmBits w)
+ MO_VU_Rem l w -> cmmVec l (cmmBits w)
+
MO_VF_Insert l w -> cmmVec l (cmmFloat w)
MO_VF_Extract _ w -> cmmFloat w
@@ -461,6 +468,9 @@ machOpArgReps dflags op =
MO_VS_Rem _ r -> [r,r]
MO_VS_Neg _ r -> [r]
+ MO_VU_Quot _ r -> [r,r]
+ MO_VU_Rem _ r -> [r,r]
+
MO_VF_Insert l r -> [typeWidth (vec l (cmmFloat r)),r,wordWidth dflags]
MO_VF_Extract l r -> [typeWidth (vec l (cmmFloat r)),wordWidth dflags]