{-# OPTIONS_GHC -cpp -fglasgow-exts #-} {- For Hugs, use the option -F"cpp -P -traditional" -} module LinearScan.UsePos where import Debug.Trace (trace, traceShow) import qualified Prelude import qualified Data.IntMap import qualified Data.IntSet import qualified Data.List import qualified Data.Ord import qualified Data.Functor.Identity import qualified LinearScan.Utils import qualified LinearScan.Eqtype as Eqtype import qualified LinearScan.Seq as Seq import qualified LinearScan.Ssrbool as Ssrbool --unsafeCoerce :: a -> b #ifdef __GLASGOW_HASKELL__ import qualified GHC.Base as GHC.Base unsafeCoerce = GHC.Base.unsafeCoerce# #else -- HUGS import qualified LinearScan.IOExts as IOExts unsafeCoerce = IOExts.unsafeCoerce #endif data VarKind = Input | Temp | Output eqVarKind :: VarKind -> VarKind -> Prelude.Bool eqVarKind s1 s2 = case s1 of { Input -> case s2 of { Input -> Prelude.True; _ -> Prelude.False}; Temp -> case s2 of { Temp -> Prelude.True; _ -> Prelude.False}; Output -> case s2 of { Output -> Prelude.True; _ -> Prelude.False}} eqVarKindP :: Eqtype.Equality__Coq_axiom VarKind eqVarKindP b1 b2 = let { _evar_0_ = let {_evar_0_ = Ssrbool.ReflectT} in let {_evar_0_0 = Ssrbool.ReflectF} in let {_evar_0_1 = Ssrbool.ReflectF} in case b2 of { Input -> _evar_0_; Temp -> _evar_0_0; Output -> _evar_0_1}} in let { _evar_0_0 = let {_evar_0_0 = Ssrbool.ReflectF} in let {_evar_0_1 = Ssrbool.ReflectT} in let {_evar_0_2 = Ssrbool.ReflectF} in case b2 of { Input -> _evar_0_0; Temp -> _evar_0_1; Output -> _evar_0_2}} in let { _evar_0_1 = let {_evar_0_1 = Ssrbool.ReflectF} in let {_evar_0_2 = Ssrbool.ReflectF} in let {_evar_0_3 = Ssrbool.ReflectT} in case b2 of { Input -> _evar_0_1; Temp -> _evar_0_2; Output -> _evar_0_3}} in case b1 of { Input -> _evar_0_; Temp -> _evar_0_0; Output -> _evar_0_1} coq_VarKind_eqMixin :: Eqtype.Equality__Coq_mixin_of VarKind coq_VarKind_eqMixin = Eqtype.Equality__Mixin eqVarKind eqVarKindP coq_VarKind_eqType :: Eqtype.Equality__Coq_type coq_VarKind_eqType = unsafeCoerce coq_VarKind_eqMixin data UsePos = Build_UsePos Prelude.Int Prelude.Bool VarKind uloc :: UsePos -> Prelude.Int uloc u = case u of { Build_UsePos uloc0 regReq0 uvar0 -> uloc0} regReq :: UsePos -> Prelude.Bool regReq u = case u of { Build_UsePos uloc0 regReq0 uvar0 -> regReq0} uvar :: UsePos -> VarKind uvar u = case u of { Build_UsePos uloc0 regReq0 uvar0 -> uvar0} upos_le :: UsePos -> UsePos -> Prelude.Bool upos_le x y = (Prelude.<=) (uloc x) (uloc y) head_or :: Prelude.Int -> ([] UsePos) -> Prelude.Int head_or x xs = Seq.head x (Prelude.map (\u -> uloc u) xs)