X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FcodeGen%2FCgRetConv.lhs;h=0b72ebeb4e064fb131f4734a12de76f729ea3b0a;hb=67b9ddc822964b29ea177bde3c735702afcda667;hp=4c6d89b9c6c13a1b1dc1b86b0f30163f83441ca5;hpb=6dd3b5de2be9fd591722101a4ecf2efcc81880fe;p=ghc-hetmet.git diff --git a/ghc/compiler/codeGen/CgRetConv.lhs b/ghc/compiler/codeGen/CgRetConv.lhs index 4c6d89b..0b72ebe 100644 --- a/ghc/compiler/codeGen/CgRetConv.lhs +++ b/ghc/compiler/codeGen/CgRetConv.lhs @@ -1,7 +1,7 @@ % % (c) The GRASP Project, Glasgow University, 1992-1998 % -% $Id: CgRetConv.lhs,v 1.27 2000/10/12 15:17:08 sewardj Exp $ +% $Id: CgRetConv.lhs,v 1.29 2000/11/14 17:41:04 sewardj Exp $ % \section[CgRetConv]{Return conventions for the code generator} @@ -21,11 +21,11 @@ module CgRetConv ( import AbsCSyn -- quite a few things import Constants ( mAX_FAMILY_SIZE_FOR_VEC_RETURNS, mAX_Vanilla_REG, mAX_Float_REG, - mAX_Double_REG, mAX_Long_REG - ) -import CmdLineOpts ( opt_UseVanillaRegs, opt_UseFloatRegs, - opt_UseDoubleRegs, opt_UseLongRegs + mAX_Double_REG, mAX_Long_REG, + mAX_Real_Vanilla_REG, mAX_Real_Float_REG, + mAX_Real_Double_REG, mAX_Real_Long_REG ) +import CmdLineOpts ( opt_Unregisterised ) import Maybes ( catMaybes ) import PrimRep ( isFloatingRep, PrimRep(..), is64BitRep ) import TyCon ( TyCon, tyConFamilySize ) @@ -58,7 +58,7 @@ ctrlReturnConvAlg :: TyCon -> CtrlReturnConvention ctrlReturnConvAlg tycon = case (tyConFamilySize tycon) of - 0 -> panic "ctrlRetConvAlg" + 0 -> pprPanic "ctrlRetConvAlg" (ppr tycon) size -> -- we're supposed to know... if (size > (1::Int) && size <= mAX_FAMILY_SIZE_FOR_VEC_RETURNS) then VectoredReturn size @@ -185,11 +185,20 @@ We take these register supplies from the *real* registers, i.e. those that are guaranteed to map to machine registers. \begin{code} +useVanillaRegs | opt_Unregisterised = 0 + | otherwise = mAX_Real_Vanilla_REG +useFloatRegs | opt_Unregisterised = 0 + | otherwise = mAX_Real_Float_REG +useDoubleRegs | opt_Unregisterised = 0 + | otherwise = mAX_Real_Double_REG +useLongRegs | opt_Unregisterised = 0 + | otherwise = mAX_Real_Long_REG + vanillaRegNos, floatRegNos, doubleRegNos, longRegNos :: [Int] -vanillaRegNos = regList opt_UseVanillaRegs -floatRegNos = regList opt_UseFloatRegs -doubleRegNos = regList opt_UseDoubleRegs -longRegNos = regList opt_UseLongRegs +vanillaRegNos = regList useVanillaRegs +floatRegNos = regList useFloatRegs +doubleRegNos = regList useDoubleRegs +longRegNos = regList useLongRegs allVanillaRegNos, allFloatRegNos, allDoubleRegNos, allLongRegNos :: [Int] allVanillaRegNos = regList mAX_Vanilla_REG