Skip to content

Commit

Permalink
Where are the ghcPrimStep tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kleinreact committed Oct 11, 2024
1 parent e0b8905 commit c82aad9
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions clash-ghc/src-ghc/Clash/GHC/Evaluator/Primitive.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module Clash.GHC.Evaluator.Primitive
, isUndefinedXPrimVal
) where

import qualified Control.Lens as Lens
--import qualified Control.Lens as Lens
import Control.Concurrent.Supply (Supply,freshId)
import Control.DeepSeq (force)
import Control.Exception (ArithException(..), Exception, tryJust, evaluate)
Expand Down Expand Up @@ -94,26 +94,26 @@ import TysWiredIn (tupleTyCon)
import Clash.Class.BitPack (pack,unpack)
import Clash.Core.DataCon (DataCon (..))
import Clash.Core.Evaluator.Types
import Clash.Core.FreeVars (typeFreeVars)
--import Clash.Core.FreeVars (typeFreeVars)
import Clash.Core.HasType (piResultTys, applyTypeToArgs)
import Clash.Core.Literal (Literal (..))
import Clash.Core.Name
(Name (..), NameSort (..), mkUnsafeSystemName)
import Clash.Core.Pretty (showPpr)
import Clash.Core.Subst (extendTvSubst, mkSubst, substTy)
--import Clash.Core.Subst (extendTvSubst, mkSubst, substTy)
import Clash.Core.Term
(IsMultiPrim (..), Pat (..), PrimInfo (..), Term (..), WorkInfo (..), mkApps,
PrimUnfolding(..), collectArgs)
import Clash.Core.Type
(Type (..), ConstTy (..), LitTy (..), TypeView (..), mkFunTy, mkTyConApp,
normalizeType, splitFunForallTy, tyView)
{- normalizeType ,-} splitFunForallTy, tyView)
import Clash.Core.TyCon
(TyConMap, TyConName, tyConDataCons)
import Clash.Core.TysPrim
import Clash.Core.Util
(mkRTree,mkVec,tyNatSize,dataConInstArgTys,primCo, mkSelectorCase,undefinedPrims,
undefinedXPrims)
import Clash.Core.Var (mkLocalId, mkTyVar, varName)
import Clash.Core.Var (mkLocalId, mkTyVar, {- varName -})
import qualified Clash.Data.UniqMap as UniqMap
import Clash.Debug
import Clash.GHC.GHC2Core (modNameM)
Expand Down Expand Up @@ -4365,11 +4365,11 @@ ghcPrimStep tcm isSubj pInfo tys args mach = case primName pInfo of
-- - Specialised folds
"Clash.Sized.Vector.dfold"
| isSubj
, pTy : kTy : aTy : _ <- tys
, _ : p : f : z : xs : _ <- args
, DC _ vArgs <- xs
, Right k' <- runExcept (tyNatSize tcm kTy)
-> case k' of
, _pTy : kTy : _aTy : _ <- tys
, _ : _p : _f : _z : xs : _ <- args
, DC _ _vArgs <- xs
, Right _k' <- runExcept (tyNatSize tcm kTy)
-> error "DO WE EVER TEST THIS?" {-case k' of
0 -> reduce (valToTerm z)
_ -> let (tyArgs,_) = splitFunForallTy ty
(tyArgs',_) = splitFunForallTy (Either.rights tyArgs !! 2)
Expand Down Expand Up @@ -4405,9 +4405,9 @@ ghcPrimStep tcm isSubj pInfo tys args mach = case primName pInfo of
,Left (valToTerm z)
,Left (Either.lefts vArgs !! 2)
])
]
] -}
where
is0 = mScopeNames mach
_is0 = mScopeNames mach
"Clash.Sized.Vector.dtfold"
| isSubj
, pTy : kTy : aTy : _ <- tys
Expand Down

0 comments on commit c82aad9

Please sign in to comment.