summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/PPC
diff options
context:
space:
mode:
authorAbhiroop Sarkar <asiamgenius@gmail.com>2018-09-27 15:28:46 -0400
committerBen Gamari <ben@smart-cactus.org>2019-07-01 17:02:29 -0400
commitff823a08f897e770efda4e89c43618dc6e30bb65 (patch)
treef26a80bcb060c8439d2daf8cefc9cb367bb3b388 /compiler/nativeGen/PPC
parentbd660edeb783a74e5ca3f1f82713b2aeedae19dc (diff)
downloadhaskell-wip/simd.tar.gz
Add support for SIMD operations in the NCGwip/simd
This adds support for constructing vector types from Float#, Double# etc and performing arithmetic operations on them Cleaned-Up-By: Ben Gamari <ben@well-typed.com>
Diffstat (limited to 'compiler/nativeGen/PPC')
-rw-r--r--compiler/nativeGen/PPC/CodeGen.hs6
-rw-r--r--compiler/nativeGen/PPC/Ppr.hs12
2 files changed, 12 insertions, 6 deletions
diff --git a/compiler/nativeGen/PPC/CodeGen.hs b/compiler/nativeGen/PPC/CodeGen.hs
index a49526c93a..7e5df6a76c 100644
--- a/compiler/nativeGen/PPC/CodeGen.hs
+++ b/compiler/nativeGen/PPC/CodeGen.hs
@@ -1909,6 +1909,8 @@ genCCall' dflags gcp target dest_regs args
FF32 -> (1, 1, 4, fprs)
FF64 -> (2, 1, 8, fprs)
II64 -> panic "genCCall' passArguments II64"
+ VecFormat {}
+ -> panic "genCCall' passArguments vector format"
GCP32ELF ->
case cmmTypeFormat rep of
@@ -1919,6 +1921,8 @@ genCCall' dflags gcp target dest_regs args
FF32 -> (0, 1, 4, fprs)
FF64 -> (0, 1, 8, fprs)
II64 -> panic "genCCall' passArguments II64"
+ VecFormat {}
+ -> panic "genCCall' passArguments vector format"
GCP64ELF _ ->
case cmmTypeFormat rep of
II8 -> (1, 0, 8, gprs)
@@ -1930,6 +1934,8 @@ genCCall' dflags gcp target dest_regs args
-- the FPRs.
FF32 -> (1, 1, 8, fprs)
FF64 -> (1, 1, 8, fprs)
+ VecFormat {}
+ -> panic "genCCall' passArguments vector format"
moveResult reduceToFF32 =
case dest_regs of
diff --git a/compiler/nativeGen/PPC/Ppr.hs b/compiler/nativeGen/PPC/Ppr.hs
index 4254f23122..b7316e6bc6 100644
--- a/compiler/nativeGen/PPC/Ppr.hs
+++ b/compiler/nativeGen/PPC/Ppr.hs
@@ -29,7 +29,7 @@ import BlockId
import CLabel
import PprCmmExpr ()
-import Unique ( pprUniqueAlways, getUnique )
+import Unique ( getUnique )
import GHC.Platform
import FastString
import Outputable
@@ -168,10 +168,7 @@ pprReg r
= case r of
RegReal (RealRegSingle i) -> ppr_reg_no i
RegReal (RealRegPair{}) -> panic "PPC.pprReg: no reg pairs on this arch"
- RegVirtual (VirtualRegI u) -> text "%vI_" <> pprUniqueAlways u
- RegVirtual (VirtualRegHi u) -> text "%vHi_" <> pprUniqueAlways u
- RegVirtual (VirtualRegF u) -> text "%vF_" <> pprUniqueAlways u
- RegVirtual (VirtualRegD u) -> text "%vD_" <> pprUniqueAlways u
+ RegVirtual v -> ppr v
where
ppr_reg_no :: Int -> SDoc
@@ -190,7 +187,8 @@ pprFormat x
II32 -> sLit "w"
II64 -> sLit "d"
FF32 -> sLit "fs"
- FF64 -> sLit "fd")
+ FF64 -> sLit "fd"
+ VecFormat _ _ _ -> panic "PPC.Ppr.pprFormat: VecFormat")
pprCond :: Cond -> SDoc
@@ -375,6 +373,7 @@ pprInstr (LD fmt reg addr) = hcat [
II64 -> sLit "d"
FF32 -> sLit "fs"
FF64 -> sLit "fd"
+ VecFormat _ _ _ -> panic "PPC.Ppr.pprInstr: VecFormat"
),
case addr of AddrRegImm _ _ -> empty
AddrRegReg _ _ -> char 'x',
@@ -414,6 +413,7 @@ pprInstr (LA fmt reg addr) = hcat [
II64 -> sLit "d"
FF32 -> sLit "fs"
FF64 -> sLit "fd"
+ VecFormat _ _ _ -> panic "PPC.Ppr.pprInstr: VecFormat"
),
case addr of AddrRegImm _ _ -> empty
AddrRegReg _ _ -> char 'x',