Commit 638583ad authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Add an ArchUnknown constructor to the arch type

Fixes build problems on platforms for which we did not have
and Arch constructor.
parent a87ffbd2
......@@ -199,6 +199,8 @@ nativeCodeGen dflags h us cmms
}
ArchPPC_64 ->
panic "nativeCodeGen: No NCG for PPC 64"
ArchUnknown ->
panic "nativeCodeGen: No NCG for unknown arch"
nativeCodeGen' :: (Instruction instr, Outputable instr)
=> DynFlags
......
......@@ -47,29 +47,32 @@ import qualified SPARC.Regs as SPARC
targetVirtualRegSqueeze :: RegClass -> VirtualReg -> FastInt
targetVirtualRegSqueeze
= case platformArch defaultTargetPlatform of
ArchX86 -> X86.virtualRegSqueeze
ArchX86_64 -> X86.virtualRegSqueeze
ArchPPC -> PPC.virtualRegSqueeze
ArchSPARC -> SPARC.virtualRegSqueeze
ArchPPC_64 -> panic "targetVirtualRegSqueeze ArchPPC_64"
ArchX86 -> X86.virtualRegSqueeze
ArchX86_64 -> X86.virtualRegSqueeze
ArchPPC -> PPC.virtualRegSqueeze
ArchSPARC -> SPARC.virtualRegSqueeze
ArchPPC_64 -> panic "targetVirtualRegSqueeze ArchPPC_64"
ArchUnknown -> panic "targetVirtualRegSqueeze ArchUnknown"
targetRealRegSqueeze :: RegClass -> RealReg -> FastInt
targetRealRegSqueeze
= case platformArch defaultTargetPlatform of
ArchX86 -> X86.realRegSqueeze
ArchX86_64 -> X86.realRegSqueeze
ArchPPC -> PPC.realRegSqueeze
ArchSPARC -> SPARC.realRegSqueeze
ArchPPC_64 -> panic "targetRealRegSqueeze ArchPPC_64"
ArchX86 -> X86.realRegSqueeze
ArchX86_64 -> X86.realRegSqueeze
ArchPPC -> PPC.realRegSqueeze
ArchSPARC -> SPARC.realRegSqueeze
ArchPPC_64 -> panic "targetRealRegSqueeze ArchPPC_64"
ArchUnknown -> panic "targetRealRegSqueeze ArchUnknown"
targetClassOfRealReg :: RealReg -> RegClass
targetClassOfRealReg
= case platformArch defaultTargetPlatform of
ArchX86 -> X86.classOfRealReg
ArchX86_64 -> X86.classOfRealReg
ArchPPC -> PPC.classOfRealReg
ArchSPARC -> SPARC.classOfRealReg
ArchPPC_64 -> panic "targetClassOfRealReg ArchPPC_64"
ArchX86 -> X86.classOfRealReg
ArchX86_64 -> X86.classOfRealReg
ArchPPC -> PPC.classOfRealReg
ArchSPARC -> SPARC.classOfRealReg
ArchPPC_64 -> panic "targetClassOfRealReg ArchPPC_64"
ArchUnknown -> panic "targetClassOfRealReg ArchUnknown"
-- TODO: This should look at targetPlatform too
targetWordSize :: Size
......@@ -78,20 +81,22 @@ targetWordSize = intSize wordWidth
targetMkVirtualReg :: Unique -> Size -> VirtualReg
targetMkVirtualReg
= case platformArch defaultTargetPlatform of
ArchX86 -> X86.mkVirtualReg
ArchX86_64 -> X86.mkVirtualReg
ArchPPC -> PPC.mkVirtualReg
ArchSPARC -> SPARC.mkVirtualReg
ArchPPC_64 -> panic "targetMkVirtualReg ArchPPC_64"
ArchX86 -> X86.mkVirtualReg
ArchX86_64 -> X86.mkVirtualReg
ArchPPC -> PPC.mkVirtualReg
ArchSPARC -> SPARC.mkVirtualReg
ArchPPC_64 -> panic "targetMkVirtualReg ArchPPC_64"
ArchUnknown -> panic "targetMkVirtualReg ArchUnknown"
targetRegDotColor :: RealReg -> SDoc
targetRegDotColor
= case platformArch defaultTargetPlatform of
ArchX86 -> X86.regDotColor
ArchX86_64 -> X86.regDotColor
ArchPPC -> PPC.regDotColor
ArchSPARC -> SPARC.regDotColor
ArchPPC_64 -> panic "targetRegDotColor ArchPPC_64"
ArchX86 -> X86.regDotColor
ArchX86_64 -> X86.regDotColor
ArchPPC -> PPC.regDotColor
ArchSPARC -> SPARC.regDotColor
ArchPPC_64 -> panic "targetRegDotColor ArchPPC_64"
ArchUnknown -> panic "targetRegDotColor ArchUnknown"
targetClassOfReg :: Reg -> RegClass
......
......@@ -31,7 +31,8 @@ data Platform
-- about what instruction set extensions an architecture might support.
--
data Arch
= ArchX86
= ArchUnknown
| ArchX86
| ArchX86_64
| ArchPPC
| ArchPPC_64
......@@ -80,7 +81,7 @@ defaultTargetArch = ArchPPC_64
#elif sparc_TARGET_ARCH
defaultTargetArch = ArchSPARC
#else
#error "Platform.buildArch: undefined"
defaultTargetArch = ArchUnknown
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment