-- |
-- Module           : Lang.Crucible.LLVM.Intrinsics.LLVM
-- Description      : Override definitions for LLVM intrinsic and basic
--                    library functions
-- Copyright        : (c) Galois, Inc 2015-2016
-- License          : BSD3
-- Maintainer       : Rob Dockins <rdockins@galois.com>
-- Stability        : provisional
------------------------------------------------------------------------

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DoAndIfThenElse #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ImplicitParams #-}
{-# LANGUAGE ImpredicativeTypes #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ViewPatterns #-}

module Lang.Crucible.LLVM.Intrinsics.LLVM where

import           GHC.TypeNats (KnownNat)
import           Control.Lens hiding (op, (:>), Empty)
import           Control.Monad (foldM, unless)
import           Control.Monad.IO.Class (MonadIO(..))
import           Data.Bits ((.&.))
import qualified Data.Vector as V
import qualified Text.LLVM.AST as L

import qualified Data.BitVector.Sized as BV
import qualified Data.Parameterized.Context as Ctx
import           Data.Parameterized.Context ( pattern (:>), pattern Empty )

import           What4.Interface
import           What4.InterpretedFloatingPoint
import qualified What4.SpecialFunctions as W4

import           Lang.Crucible.Backend
import           Lang.Crucible.CFG.Common (GlobalVar)
import           Lang.Crucible.Types
import           Lang.Crucible.Simulator.OverrideSim
import           Lang.Crucible.Simulator.RegMap
import           Lang.Crucible.Simulator.SimError (SimErrorReason(AssertFailureSimError))

import           Lang.Crucible.LLVM.Bytes (Bytes(..))
import           Lang.Crucible.LLVM.DataLayout (noAlignment)
import           Lang.Crucible.LLVM.MemModel
import           Lang.Crucible.LLVM.QQ( llvmOvr )

import           Lang.Crucible.LLVM.Intrinsics.Common
import qualified Lang.Crucible.LLVM.Intrinsics.Libc as Libc

------------------------------------------------------------------------
-- ** Declarations

-- | This intrinsic is currently a no-op.
--
-- We might want to support this in the future to catch undefined memory
-- accesses.
--
-- <https://llvm.org/docs/LangRef.html#llvm-lifetime-start-intrinsic LLVM docs>
llvmLifetimeStartOverride
  :: (IsSymInterface sym, HasPtrWidth wptr)
  => LLVMOverride p sym (EmptyCtx ::> BVType 64 ::> LLVMPointerType wptr) UnitType
llvmLifetimeStartOverride :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
LLVMOverride
  p sym ((EmptyCtx ::> BVType 64) ::> LLVMPointerType wptr) UnitType
llvmLifetimeStartOverride =
  [llvmOvr| void @llvm.lifetime.start( i64, i8* ) |]
  (\GlobalVar Mem
_ops bak
_sym Assignment
  (RegEntry sym) ((EmptyCtx ::> BVType 64) ::> LLVMPointerType wptr)
_args -> () -> OverrideSim p sym LLVM rtp args' ret' ()
forall a. a -> OverrideSim p sym LLVM rtp args' ret' a
forall (m :: Type -> Type) a. Monad m => a -> m a
return ())

-- | See comment on 'llvmLifetimeStartOverride'
--
-- <https://llvm.org/docs/LangRef.html#llvm-lifetime-end-intrinsic LLVM docs>
llvmLifetimeEndOverride
  :: (IsSymInterface sym, HasPtrWidth wptr)
  => LLVMOverride p sym (EmptyCtx ::> BVType 64 ::> LLVMPointerType wptr) UnitType
llvmLifetimeEndOverride :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
LLVMOverride
  p sym ((EmptyCtx ::> BVType 64) ::> LLVMPointerType wptr) UnitType
llvmLifetimeEndOverride =
  [llvmOvr| void @llvm.lifetime.end( i64, i8* ) |]
  (\GlobalVar Mem
_ops bak
_sym Assignment
  (RegEntry sym) ((EmptyCtx ::> BVType 64) ::> LLVMPointerType wptr)
_args -> () -> OverrideSim p sym LLVM rtp args' ret' ()
forall a. a -> OverrideSim p sym LLVM rtp args' ret' a
forall (m :: Type -> Type) a. Monad m => a -> m a
return ())

-- | This is a no-op.
--
-- The language reference doesn't mention the use of this intrinsic.
llvmLifetimeOverrideOverload
  :: forall width sym wptr p
   . ( 1 <= width, KnownNat width
     , IsSymInterface sym, HasPtrWidth wptr)
  => String -- ^ "start" or "end"
  -> NatRepr width
  -> LLVMOverride p sym
        (EmptyCtx ::> BVType 64 ::> LLVMPointerType wptr)
        UnitType -- It appears in practice that this is always void
llvmLifetimeOverrideOverload :: forall (width :: Natural) sym (wptr :: Natural) p.
(1 <= width, KnownNat width, IsSymInterface sym,
 HasPtrWidth wptr) =>
String
-> NatRepr width
-> LLVMOverride
     p sym ((EmptyCtx ::> BVType 64) ::> LLVMPointerType wptr) UnitType
llvmLifetimeOverrideOverload String
startOrEnd NatRepr width
w =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.lifetime." String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
startOrEnd String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".p0i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show (NatRepr width -> Int
forall (n :: Natural). NatRepr n -> Int
widthVal NatRepr width
w)) in
    [llvmOvr| void $nm ( i64, #w * ) |]
    (\GlobalVar Mem
_ops bak
_sym Assignment
  (RegEntry sym) ((EmptyCtx ::> BVType 64) ::> LLVMPointerType wptr)
_args -> () -> OverrideSim p sym LLVM rtp args' ret' ()
forall a. a -> OverrideSim p sym LLVM rtp args' ret' a
forall (m :: Type -> Type) a. Monad m => a -> m a
return ())

-- | Like 'llvmLifetimeOverrideOverload', but with an opaque pointer type.
llvmLifetimeOverrideOverload_opaque
  :: forall sym wptr p
   . (IsSymInterface sym, HasPtrWidth wptr)
  => String -- ^ "start" or "end"
  -> LLVMOverride p sym
        (EmptyCtx ::> BVType 64 ::> LLVMPointerType wptr)
        UnitType -- It appears in practice that this is always void
llvmLifetimeOverrideOverload_opaque :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
String
-> LLVMOverride
     p sym ((EmptyCtx ::> BVType 64) ::> LLVMPointerType wptr) UnitType
llvmLifetimeOverrideOverload_opaque String
startOrEnd =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.lifetime." String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
startOrEnd String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".p0") in
    [llvmOvr| void $nm ( i64, ptr ) |]
    (\GlobalVar Mem
_ops bak
_sym Assignment
  (RegEntry sym) ((EmptyCtx ::> BVType 64) ::> LLVMPointerType wptr)
_args -> () -> OverrideSim p sym LLVM rtp args' ret' ()
forall a. a -> OverrideSim p sym LLVM rtp args' ret' a
forall (m :: Type -> Type) a. Monad m => a -> m a
return ())

-- | This intrinsic is currently a no-op.
--
-- We might want to support this in the future to catch undefined memory
-- writes.
--
-- <https://llvm.org/docs/LangRef.html#llvm-invariant-start-intrinsic LLVM docs>
llvmInvariantStartOverride
  :: (IsSymInterface sym, HasPtrWidth wptr)
  => NatRepr width
  -> LLVMOverride p sym
       (EmptyCtx ::> BVType 64 ::> LLVMPointerType wptr)
       (LLVMPointerType wptr)
llvmInvariantStartOverride :: forall sym (wptr :: Natural) (width :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
NatRepr width
-> LLVMOverride
     p
     sym
     ((EmptyCtx ::> BVType 64) ::> LLVMPointerType wptr)
     (LLVMPointerType wptr)
llvmInvariantStartOverride NatRepr width
w =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.invariant.start.p0i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show (NatRepr width -> Int
forall (n :: Natural). NatRepr n -> Int
widthVal NatRepr width
w)) in
    [llvmOvr| {}* $nm ( i64, #w * ) |]
    (\GlobalVar Mem
_ops bak
bak Assignment
  (RegEntry sym) ((EmptyCtx ::> BVType 64) ::> LLVMPointerType wptr)
_args -> IO (RegValue sym (LLVMPointerType wptr))
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (LLVMPointerType wptr))
forall a. IO a -> OverrideSim p sym LLVM rtp args' ret' a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (sym -> NatRepr wptr -> IO (RegValue sym (LLVMPointerType wptr))
forall (w :: Natural) sym.
(1 <= w, IsSymInterface sym) =>
sym -> NatRepr w -> IO (LLVMPtr sym w)
mkNullPointer (bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak) NatRepr wptr
forall (w :: Natural) (w' :: Natural).
(HasPtrWidth w, w ~ w') =>
NatRepr w'
PtrWidth))

-- | Like 'llvmInvariantStartOverride', but with an opaque pointer type.
llvmInvariantStartOverride_opaque
  :: (IsSymInterface sym, HasPtrWidth wptr)
  => LLVMOverride p sym
       (EmptyCtx ::> BVType 64 ::> LLVMPointerType wptr)
       (LLVMPointerType wptr)
llvmInvariantStartOverride_opaque :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
LLVMOverride
  p
  sym
  ((EmptyCtx ::> BVType 64) ::> LLVMPointerType wptr)
  (LLVMPointerType wptr)
llvmInvariantStartOverride_opaque =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol String
"llvm.invariant.start.p0" in
    [llvmOvr| {}* $nm ( i64, ptr ) |]
    (\GlobalVar Mem
_ops bak
bak Assignment
  (RegEntry sym) ((EmptyCtx ::> BVType 64) ::> LLVMPointerType wptr)
_args -> IO (RegValue sym (LLVMPointerType wptr))
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (LLVMPointerType wptr))
forall a. IO a -> OverrideSim p sym LLVM rtp args' ret' a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (sym -> NatRepr wptr -> IO (RegValue sym (LLVMPointerType wptr))
forall (w :: Natural) sym.
(1 <= w, IsSymInterface sym) =>
sym -> NatRepr w -> IO (LLVMPtr sym w)
mkNullPointer (bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak) NatRepr wptr
forall (w :: Natural) (w' :: Natural).
(HasPtrWidth w, w ~ w') =>
NatRepr w'
PtrWidth))

-- | See comment on 'llvmInvariantStartOverride'.
llvmInvariantEndOverride
  :: (IsSymInterface sym, HasPtrWidth wptr)
  => NatRepr width
  -> LLVMOverride p sym
       (EmptyCtx ::> LLVMPointerType wptr ::> BVType 64 ::> LLVMPointerType wptr)
       UnitType
llvmInvariantEndOverride :: forall sym (wptr :: Natural) (width :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
NatRepr width
-> LLVMOverride
     p
     sym
     (((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 64)
      ::> LLVMPointerType wptr)
     UnitType
llvmInvariantEndOverride NatRepr width
w =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.invariant.end.p0i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show (NatRepr width -> Int
forall (n :: Natural). NatRepr n -> Int
widthVal NatRepr width
w)) in
    [llvmOvr| void $nm ( {}*, i64, #w * ) |]
    (\GlobalVar Mem
_ops bak
_bak Assignment
  (RegEntry sym)
  (((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 64)
   ::> LLVMPointerType wptr)
_args -> () -> OverrideSim p sym LLVM rtp args' ret' ()
forall a. a -> OverrideSim p sym LLVM rtp args' ret' a
forall (m :: Type -> Type) a. Monad m => a -> m a
return ())

-- | See comment on 'llvmInvariantStartOverride_opaque'.
llvmInvariantEndOverride_opaque
  :: (IsSymInterface sym, HasPtrWidth wptr)
  => LLVMOverride p sym
       (EmptyCtx ::> LLVMPointerType wptr ::> BVType 64 ::> LLVMPointerType wptr)
       UnitType
llvmInvariantEndOverride_opaque :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
LLVMOverride
  p
  sym
  (((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 64)
   ::> LLVMPointerType wptr)
  UnitType
llvmInvariantEndOverride_opaque =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol String
"llvm.invariant.end.p0" in
    [llvmOvr| void $nm ( {}*, i64, ptr ) |]
    (\GlobalVar Mem
_ops bak
_bak Assignment
  (RegEntry sym)
  (((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 64)
   ::> LLVMPointerType wptr)
_args -> () -> OverrideSim p sym LLVM rtp args' ret' ()
forall a. a -> OverrideSim p sym LLVM rtp args' ret' a
forall (m :: Type -> Type) a. Monad m => a -> m a
return ())

-- | This instruction is a hint to optimizers, it isn't really useful for us.
--
-- Its runtime behavior of that of Haskell\'s 'const': just ignore the second
-- argument.
llvmExpectOverride
  :: (IsSymInterface sym, 1 <= width)
  => NatRepr width
  -> LLVMOverride p sym
       (EmptyCtx ::> BVType width ::> BVType width)
       (BVType width)
llvmExpectOverride :: forall sym (width :: Natural) p.
(IsSymInterface sym, 1 <= width) =>
NatRepr width
-> LLVMOverride
     p sym ((EmptyCtx ::> BVType width) ::> BVType width) (BVType width)
llvmExpectOverride NatRepr width
w =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.expect.i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show (NatRepr width -> Int
forall (n :: Natural). NatRepr n -> Int
widthVal NatRepr width
w)) in
    [llvmOvr| #w $nm ( #w, #w ) |]
    (\GlobalVar Mem
_ops bak
_bak Assignment
  (RegEntry sym) ((EmptyCtx ::> BVType width) ::> BVType width)
args ->
        CurryAssignment
  ((EmptyCtx ::> BVType width) ::> BVType width)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (BVType width)))
-> Assignment
     (RegEntry sym) ((EmptyCtx ::> BVType width) ::> BVType width)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (BVType width))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment ((EmptyCtx ::> BVType width) ::> BVType width) f x
-> Assignment f ((EmptyCtx ::> BVType width) ::> BVType width) -> x
Ctx.uncurryAssignment (\RegEntry sym (BVType width)
val RegEntry sym (BVType width)
_ -> RegValue sym (BVType width)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (BVType width))
forall a. a -> OverrideSim p sym LLVM rtp args' ret' a
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (RegEntry sym (BVType width) -> RegValue sym (BVType width)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue RegEntry sym (BVType width)
val)) Assignment
  (RegEntry sym) ((EmptyCtx ::> BVType width) ::> BVType width)
args)

-- | This intrinsic asserts that its argument is equal to 1.
--
-- We could have this generate a verification condition, but that would catch
-- clang compiler bugs (or Crucible bugs) more than user code bugs.
llvmAssumeOverride
  :: (IsSymInterface sym)
  => LLVMOverride p sym (EmptyCtx ::> BVType 1) UnitType
llvmAssumeOverride :: forall sym p.
IsSymInterface sym =>
LLVMOverride p sym (EmptyCtx ::> BVType 1) UnitType
llvmAssumeOverride =
   [llvmOvr| void @llvm.assume ( i1 ) |]
   (\GlobalVar Mem
_ops bak
_bak Assignment (RegEntry sym) (EmptyCtx ::> BVType 1)
_args -> () -> OverrideSim p sym LLVM rtp args' ret' ()
forall a. a -> OverrideSim p sym LLVM rtp args' ret' a
forall (m :: Type -> Type) a. Monad m => a -> m a
return ())

-- | This intrinsic is sometimes inserted by clang, and we interpret it
--   as an assertion failure, similar to calling @abort()@.
llvmTrapOverride
  :: (IsSymInterface sym)
  => LLVMOverride p sym EmptyCtx UnitType
llvmTrapOverride :: forall sym p.
IsSymInterface sym =>
LLVMOverride p sym EmptyCtx UnitType
llvmTrapOverride =
  [llvmOvr| void @llvm.trap() |]
  (\GlobalVar Mem
_ops bak
bak Assignment (RegEntry sym) EmptyCtx
_args -> IO (RegValue sym UnitType)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall a. IO a -> OverrideSim p sym LLVM rtp args' ret' a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (RegValue sym UnitType)
 -> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> IO (RegValue sym UnitType)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall a b. (a -> b) -> a -> b
$ bak -> SimErrorReason -> IO (RegValue sym UnitType)
forall sym bak a.
IsSymBackend sym bak =>
bak -> SimErrorReason -> IO a
addFailedAssertion bak
bak (SimErrorReason -> IO (RegValue sym UnitType))
-> SimErrorReason -> IO (RegValue sym UnitType)
forall a b. (a -> b) -> a -> b
$ String -> String -> SimErrorReason
AssertFailureSimError String
"llvm.trap() called" String
"")

-- | This is like @llvm.trap()@, but with an argument indicating which sort of
-- undefined behavior was trapped. The argument acts as an index into
-- <https://github.com/llvm/llvm-project/blob/650bbc56203c947bb85176c40ca9c7c7a91c3c57/clang/lib/CodeGen/CodeGenFunction.h#L118-L143 this list>.
-- Ideally, we would do something intelligent with this argument—see #368.
llvmUBSanTrapOverride ::
  IsSymInterface sym =>
  LLVMOverride p sym (EmptyCtx ::> BVType 8) UnitType
llvmUBSanTrapOverride :: forall sym p.
IsSymInterface sym =>
LLVMOverride p sym (EmptyCtx ::> BVType 8) UnitType
llvmUBSanTrapOverride =
  [llvmOvr| void @llvm.ubsantrap( i8 ) |]
  (\GlobalVar Mem
_ops bak
bak Assignment (RegEntry sym) (EmptyCtx ::> BVType 8)
_args -> IO (RegValue sym UnitType)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall a. IO a -> OverrideSim p sym LLVM rtp args' ret' a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (RegValue sym UnitType)
 -> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> IO (RegValue sym UnitType)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall a b. (a -> b) -> a -> b
$ bak -> SimErrorReason -> IO (RegValue sym UnitType)
forall sym bak a.
IsSymBackend sym bak =>
bak -> SimErrorReason -> IO a
addFailedAssertion bak
bak (SimErrorReason -> IO (RegValue sym UnitType))
-> SimErrorReason -> IO (RegValue sym UnitType)
forall a b. (a -> b) -> a -> b
$ String -> String -> SimErrorReason
AssertFailureSimError String
"llvm.ubsantrap() called" String
"")

llvmStacksave
  :: (IsSymInterface sym, HasPtrWidth wptr)
  => LLVMOverride p sym EmptyCtx (LLVMPointerType wptr)
llvmStacksave :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
LLVMOverride p sym EmptyCtx (LLVMPointerType wptr)
llvmStacksave =
  [llvmOvr| i8* @llvm.stacksave() |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) EmptyCtx
_args -> IO (RegValue sym (LLVMPointerType wptr))
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (LLVMPointerType wptr))
forall a. IO a -> OverrideSim p sym LLVM rtp args' ret' a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (sym -> NatRepr wptr -> IO (RegValue sym (LLVMPointerType wptr))
forall (w :: Natural) sym.
(1 <= w, IsSymInterface sym) =>
sym -> NatRepr w -> IO (LLVMPtr sym w)
mkNullPointer (bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak) NatRepr wptr
forall (w :: Natural) (w' :: Natural).
(HasPtrWidth w, w ~ w') =>
NatRepr w'
PtrWidth))

llvmStackrestore
  :: (IsSymInterface sym, HasPtrWidth wptr)
  => LLVMOverride p sym (EmptyCtx ::> LLVMPointerType wptr) UnitType
llvmStackrestore :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
LLVMOverride p sym (EmptyCtx ::> LLVMPointerType wptr) UnitType
llvmStackrestore =
  [llvmOvr| void @llvm.stackrestore( i8* ) |]
  (\GlobalVar Mem
_memOps bak
_bak Assignment (RegEntry sym) (EmptyCtx ::> LLVMPointerType wptr)
_args -> () -> OverrideSim p sym LLVM rtp args' ret' ()
forall a. a -> OverrideSim p sym LLVM rtp args' ret' a
forall (m :: Type -> Type) a. Monad m => a -> m a
return ())

llvmMemmoveOverride_8_8_32
  :: ( IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr
     , ?memOpts :: MemOptions )
  => LLVMOverride p sym
         (EmptyCtx ::> LLVMPointerType wptr ::> LLVMPointerType wptr
                   ::> BVType 32 ::> BVType 32 ::> BVType 1)
         UnitType
llvmMemmoveOverride_8_8_32 :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
LLVMOverride
  p
  sym
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
     ::> BVType 32)
    ::> BVType 32)
   ::> BVType 1)
  UnitType
llvmMemmoveOverride_8_8_32 =
  [llvmOvr| void @llvm.memmove.p0i8.p0i8.i32( i8*, i8*, i32, i32, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
     ::> BVType 32)
    ::> BVType 32)
   ::> BVType 1)
args ->
     CurryAssignment
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
     ::> BVType 32)
    ::> BVType 32)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> Assignment
     (RegEntry sym)
     (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
        ::> BVType 32)
       ::> BVType 32)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
     ::> BVType 32)
    ::> BVType 32)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
        ::> BVType 32)
       ::> BVType 32)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (\RegEntry sym (LLVMPointerType wptr)
dst RegEntry sym (LLVMPointerType wptr)
src RegEntry sym (BVType 32)
len RegEntry sym (BVType 32)
_align RegEntry sym (BVType 1)
v -> bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 32)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' ()
forall sym bak (wptr :: Natural) (w :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(IsSymBackend sym bak, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret ()
Libc.callMemmove bak
bak GlobalVar Mem
memOps RegEntry sym (LLVMPointerType wptr)
dst RegEntry sym (LLVMPointerType wptr)
src RegEntry sym (BVType 32)
len RegEntry sym (BVType 1)
v) Assignment
  (RegEntry sym)
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
     ::> BVType 32)
    ::> BVType 32)
   ::> BVType 1)
args)

llvmMemmoveOverride_8_8_32_noalign
  :: ( IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr
     , ?memOpts :: MemOptions )
  => LLVMOverride p sym
         (EmptyCtx ::> LLVMPointerType wptr ::> LLVMPointerType wptr
                   ::> BVType 32 ::> BVType 1)
         UnitType
llvmMemmoveOverride_8_8_32_noalign :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
LLVMOverride
  p
  sym
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 32)
   ::> BVType 1)
  UnitType
llvmMemmoveOverride_8_8_32_noalign =
  [llvmOvr| void @llvm.memmove.p0i8.p0i8.i32( i8*, i8*, i32, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 32)
   ::> BVType 1)
args -> CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 32)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> Assignment
     (RegEntry sym)
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
       ::> BVType 32)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 32)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
       ::> BVType 32)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 32)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' ()
forall sym bak (wptr :: Natural) (w :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(IsSymBackend sym bak, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret ()
Libc.callMemmove bak
bak GlobalVar Mem
memOps) Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 32)
   ::> BVType 1)
args)

llvmMemmoveOverride_8_8_32_noalign_opaque
  :: ( IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr
     , ?memOpts :: MemOptions )
  => LLVMOverride p sym
         (EmptyCtx ::> LLVMPointerType wptr ::> LLVMPointerType wptr
                   ::> BVType 32 ::> BVType 1)
         UnitType
llvmMemmoveOverride_8_8_32_noalign_opaque :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
LLVMOverride
  p
  sym
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 32)
   ::> BVType 1)
  UnitType
llvmMemmoveOverride_8_8_32_noalign_opaque =
  [llvmOvr| void @llvm.memmove.p0.p0.i32( ptr, ptr, i32, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 32)
   ::> BVType 1)
args -> CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 32)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> Assignment
     (RegEntry sym)
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
       ::> BVType 32)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 32)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
       ::> BVType 32)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 32)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' ()
forall sym bak (wptr :: Natural) (w :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(IsSymBackend sym bak, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret ()
Libc.callMemmove bak
bak GlobalVar Mem
memOps) Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 32)
   ::> BVType 1)
args)


llvmMemmoveOverride_8_8_64
  :: ( IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr
     , ?memOpts :: MemOptions )
  => LLVMOverride p sym
         (EmptyCtx ::> LLVMPointerType wptr ::> LLVMPointerType wptr
                   ::> BVType 64 ::> BVType 32 ::> BVType 1)
         UnitType
llvmMemmoveOverride_8_8_64 :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
LLVMOverride
  p
  sym
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
     ::> BVType 64)
    ::> BVType 32)
   ::> BVType 1)
  UnitType
llvmMemmoveOverride_8_8_64 =
  [llvmOvr| void @llvm.memmove.p0i8.p0i8.i64( i8*, i8*, i64, i32, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
     ::> BVType 64)
    ::> BVType 32)
   ::> BVType 1)
args ->
      CurryAssignment
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
     ::> BVType 64)
    ::> BVType 32)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> Assignment
     (RegEntry sym)
     (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
        ::> BVType 64)
       ::> BVType 32)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
     ::> BVType 64)
    ::> BVType 32)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
        ::> BVType 64)
       ::> BVType 32)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (\RegEntry sym (LLVMPointerType wptr)
dst RegEntry sym (LLVMPointerType wptr)
src RegEntry sym (BVType 64)
len RegEntry sym (BVType 32)
_align RegEntry sym (BVType 1)
v -> bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 64)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' ()
forall sym bak (wptr :: Natural) (w :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(IsSymBackend sym bak, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret ()
Libc.callMemmove bak
bak GlobalVar Mem
memOps RegEntry sym (LLVMPointerType wptr)
dst RegEntry sym (LLVMPointerType wptr)
src RegEntry sym (BVType 64)
len RegEntry sym (BVType 1)
v) Assignment
  (RegEntry sym)
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
     ::> BVType 64)
    ::> BVType 32)
   ::> BVType 1)
args)

llvmMemmoveOverride_8_8_64_noalign
  :: ( IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr
     , ?memOpts :: MemOptions )
  => LLVMOverride p sym
         (EmptyCtx ::> LLVMPointerType wptr ::> LLVMPointerType wptr
                   ::> BVType 64 ::> BVType 1)
         UnitType
llvmMemmoveOverride_8_8_64_noalign :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
LLVMOverride
  p
  sym
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 64)
   ::> BVType 1)
  UnitType
llvmMemmoveOverride_8_8_64_noalign =
  [llvmOvr| void @llvm.memmove.p0i8.p0i8.i64( i8*, i8*, i64, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 64)
   ::> BVType 1)
args -> CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 64)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> Assignment
     (RegEntry sym)
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
       ::> BVType 64)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 64)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
       ::> BVType 64)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 64)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' ()
forall sym bak (wptr :: Natural) (w :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(IsSymBackend sym bak, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret ()
Libc.callMemmove bak
bak GlobalVar Mem
memOps) Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 64)
   ::> BVType 1)
args)

llvmMemmoveOverride_8_8_64_noalign_opaque
  :: ( IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr
     , ?memOpts :: MemOptions )
  => LLVMOverride p sym
         (EmptyCtx ::> LLVMPointerType wptr ::> LLVMPointerType wptr
                   ::> BVType 64 ::> BVType 1)
         UnitType
llvmMemmoveOverride_8_8_64_noalign_opaque :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
LLVMOverride
  p
  sym
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 64)
   ::> BVType 1)
  UnitType
llvmMemmoveOverride_8_8_64_noalign_opaque =
  [llvmOvr| void @llvm.memmove.p0.p0.i64( ptr, ptr, i64, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 64)
   ::> BVType 1)
args ->
      CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 64)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> Assignment
     (RegEntry sym)
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
       ::> BVType 64)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 64)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
       ::> BVType 64)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 64)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' ()
forall sym bak (wptr :: Natural) (w :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(IsSymBackend sym bak, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret ()
Libc.callMemmove bak
bak GlobalVar Mem
memOps) Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 64)
   ::> BVType 1)
args)


llvmMemsetOverride_8_64
  :: (IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr)
  => LLVMOverride p sym
         (EmptyCtx ::> LLVMPointerType wptr
                   ::> BVType  8
                   ::> BVType 64
                   ::> BVType 32
                   ::> BVType 1)
         UnitType
llvmMemsetOverride_8_64 :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr) =>
LLVMOverride
  p
  sym
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8)
     ::> BVType 64)
    ::> BVType 32)
   ::> BVType 1)
  UnitType
llvmMemsetOverride_8_64 =
  [llvmOvr| void @llvm.memset.p0i8.i64( i8*, i8, i64, i32, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8)
     ::> BVType 64)
    ::> BVType 32)
   ::> BVType 1)
args ->
    CurryAssignment
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8)
     ::> BVType 64)
    ::> BVType 32)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> Assignment
     (RegEntry sym)
     (((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8)
        ::> BVType 64)
       ::> BVType 32)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8)
     ::> BVType 64)
    ::> BVType 32)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     (((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8)
        ::> BVType 64)
       ::> BVType 32)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (\RegEntry sym (LLVMPointerType wptr)
dst RegEntry sym (BVType 8)
val RegEntry sym (BVType 64)
len RegEntry sym (BVType 32)
_align RegEntry sym (BVType 1)
v -> bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 8)
-> RegEntry sym (BVType 64)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' ()
forall sym bak (wptr :: Natural) (w :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(IsSymBackend sym bak, HasLLVMAnn sym, HasPtrWidth wptr) =>
bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 8)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret ()
Libc.callMemset bak
bak GlobalVar Mem
memOps RegEntry sym (LLVMPointerType wptr)
dst RegEntry sym (BVType 8)
val RegEntry sym (BVType 64)
len RegEntry sym (BVType 1)
v) Assignment
  (RegEntry sym)
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8)
     ::> BVType 64)
    ::> BVType 32)
   ::> BVType 1)
args)

llvmMemsetOverride_8_64_noalign
  :: (IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr)
  => LLVMOverride p sym
         (EmptyCtx ::> LLVMPointerType wptr
                   ::> BVType  8
                   ::> BVType 64
                   ::> BVType 1)
         UnitType
llvmMemsetOverride_8_64_noalign :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr) =>
LLVMOverride
  p
  sym
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 64)
   ::> BVType 1)
  UnitType
llvmMemsetOverride_8_64_noalign =
  [llvmOvr| void @llvm.memset.p0i8.i64( i8*, i8, i64, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 64)
   ::> BVType 1)
args -> CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 64)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> Assignment
     (RegEntry sym)
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 64)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 64)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 64)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 8)
-> RegEntry sym (BVType 64)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' ()
forall sym bak (wptr :: Natural) (w :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(IsSymBackend sym bak, HasLLVMAnn sym, HasPtrWidth wptr) =>
bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 8)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret ()
Libc.callMemset bak
bak GlobalVar Mem
memOps) Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 64)
   ::> BVType 1)
args)

llvmMemsetOverride_8_64_noalign_opaque
  :: (IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr)
  => LLVMOverride p sym
         (EmptyCtx ::> LLVMPointerType wptr
                   ::> BVType  8
                   ::> BVType 64
                   ::> BVType 1)
         UnitType
llvmMemsetOverride_8_64_noalign_opaque :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr) =>
LLVMOverride
  p
  sym
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 64)
   ::> BVType 1)
  UnitType
llvmMemsetOverride_8_64_noalign_opaque =
  [llvmOvr| void @llvm.memset.p0.i64( ptr, i8, i64, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 64)
   ::> BVType 1)
args -> CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 64)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> Assignment
     (RegEntry sym)
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 64)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 64)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 64)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 8)
-> RegEntry sym (BVType 64)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' ()
forall sym bak (wptr :: Natural) (w :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(IsSymBackend sym bak, HasLLVMAnn sym, HasPtrWidth wptr) =>
bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 8)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret ()
Libc.callMemset bak
bak GlobalVar Mem
memOps) Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 64)
   ::> BVType 1)
args)


llvmMemsetOverride_8_32
  :: (IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr)
  => LLVMOverride p sym
         (EmptyCtx ::> LLVMPointerType wptr
                   ::> BVType  8
                   ::> BVType 32
                   ::> BVType 32
                   ::> BVType 1)
         UnitType
llvmMemsetOverride_8_32 :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr) =>
LLVMOverride
  p
  sym
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8)
     ::> BVType 32)
    ::> BVType 32)
   ::> BVType 1)
  UnitType
llvmMemsetOverride_8_32 =
  [llvmOvr| void @llvm.memset.p0i8.i32( i8*, i8, i32, i32, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8)
     ::> BVType 32)
    ::> BVType 32)
   ::> BVType 1)
args ->
    CurryAssignment
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8)
     ::> BVType 32)
    ::> BVType 32)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> Assignment
     (RegEntry sym)
     (((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8)
        ::> BVType 32)
       ::> BVType 32)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8)
     ::> BVType 32)
    ::> BVType 32)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     (((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8)
        ::> BVType 32)
       ::> BVType 32)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (\RegEntry sym (LLVMPointerType wptr)
dst RegEntry sym (BVType 8)
val RegEntry sym (BVType 32)
len RegEntry sym (BVType 32)
_align RegEntry sym (BVType 1)
v -> bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 8)
-> RegEntry sym (BVType 32)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' ()
forall sym bak (wptr :: Natural) (w :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(IsSymBackend sym bak, HasLLVMAnn sym, HasPtrWidth wptr) =>
bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 8)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret ()
Libc.callMemset bak
bak GlobalVar Mem
memOps RegEntry sym (LLVMPointerType wptr)
dst RegEntry sym (BVType 8)
val RegEntry sym (BVType 32)
len RegEntry sym (BVType 1)
v) Assignment
  (RegEntry sym)
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8)
     ::> BVType 32)
    ::> BVType 32)
   ::> BVType 1)
args)

llvmMemsetOverride_8_32_noalign
  :: (IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr)
  => LLVMOverride p sym
         (EmptyCtx ::> LLVMPointerType wptr
                   ::> BVType  8
                   ::> BVType 32
                   ::> BVType 1)
         UnitType
llvmMemsetOverride_8_32_noalign :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr) =>
LLVMOverride
  p
  sym
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 32)
   ::> BVType 1)
  UnitType
llvmMemsetOverride_8_32_noalign =
  [llvmOvr| void @llvm.memset.p0i8.i32( i8*, i8, i32, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 32)
   ::> BVType 1)
args -> CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 32)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> Assignment
     (RegEntry sym)
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 32)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 32)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 32)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 8)
-> RegEntry sym (BVType 32)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' ()
forall sym bak (wptr :: Natural) (w :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(IsSymBackend sym bak, HasLLVMAnn sym, HasPtrWidth wptr) =>
bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 8)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret ()
Libc.callMemset bak
bak GlobalVar Mem
memOps) Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 32)
   ::> BVType 1)
args)

llvmMemsetOverride_8_32_noalign_opaque
  :: (IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr)
  => LLVMOverride p sym
         (EmptyCtx ::> LLVMPointerType wptr
                   ::> BVType  8
                   ::> BVType 32
                   ::> BVType 1)
         UnitType
llvmMemsetOverride_8_32_noalign_opaque :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr) =>
LLVMOverride
  p
  sym
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 32)
   ::> BVType 1)
  UnitType
llvmMemsetOverride_8_32_noalign_opaque =
  [llvmOvr| void @llvm.memset.p0.i32( ptr, i8, i32, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 32)
   ::> BVType 1)
args -> CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 32)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> Assignment
     (RegEntry sym)
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 32)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 32)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 32)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 8)
-> RegEntry sym (BVType 32)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' ()
forall sym bak (wptr :: Natural) (w :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(IsSymBackend sym bak, HasLLVMAnn sym, HasPtrWidth wptr) =>
bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 8)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret ()
Libc.callMemset bak
bak GlobalVar Mem
memOps) Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 8) ::> BVType 32)
   ::> BVType 1)
args)


llvmMemcpyOverride_8_8_32
  :: ( IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr
     , ?memOpts :: MemOptions )
  => LLVMOverride p sym
          (EmptyCtx ::> LLVMPointerType wptr ::> LLVMPointerType wptr
                    ::> BVType 32 ::> BVType 32 ::> BVType 1)
          UnitType
llvmMemcpyOverride_8_8_32 :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
LLVMOverride
  p
  sym
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
     ::> BVType 32)
    ::> BVType 32)
   ::> BVType 1)
  UnitType
llvmMemcpyOverride_8_8_32 =
  [llvmOvr| void @llvm.memcpy.p0i8.p0i8.i32( i8*, i8*, i32, i32, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
     ::> BVType 32)
    ::> BVType 32)
   ::> BVType 1)
args ->
    CurryAssignment
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
     ::> BVType 32)
    ::> BVType 32)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> Assignment
     (RegEntry sym)
     (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
        ::> BVType 32)
       ::> BVType 32)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
     ::> BVType 32)
    ::> BVType 32)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
        ::> BVType 32)
       ::> BVType 32)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (\RegEntry sym (LLVMPointerType wptr)
dst RegEntry sym (LLVMPointerType wptr)
src RegEntry sym (BVType 32)
len RegEntry sym (BVType 32)
_align RegEntry sym (BVType 1)
v -> bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 32)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' ()
forall sym bak (wptr :: Natural) (w :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(IsSymBackend sym bak, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret ()
Libc.callMemcpy bak
bak GlobalVar Mem
memOps RegEntry sym (LLVMPointerType wptr)
dst RegEntry sym (LLVMPointerType wptr)
src RegEntry sym (BVType 32)
len RegEntry sym (BVType 1)
v) Assignment
  (RegEntry sym)
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
     ::> BVType 32)
    ::> BVType 32)
   ::> BVType 1)
args)

llvmMemcpyOverride_8_8_32_noalign
  :: ( IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr
     , ?memOpts :: MemOptions )
  => LLVMOverride p sym
          (EmptyCtx ::> LLVMPointerType wptr ::> LLVMPointerType wptr
                    ::> BVType 32 ::> BVType 1)
          UnitType
llvmMemcpyOverride_8_8_32_noalign :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
LLVMOverride
  p
  sym
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 32)
   ::> BVType 1)
  UnitType
llvmMemcpyOverride_8_8_32_noalign =
  [llvmOvr| void @llvm.memcpy.p0i8.p0i8.i32( i8*, i8*, i32, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 32)
   ::> BVType 1)
args -> CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 32)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> Assignment
     (RegEntry sym)
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
       ::> BVType 32)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 32)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
       ::> BVType 32)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 32)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' ()
forall sym bak (wptr :: Natural) (w :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(IsSymBackend sym bak, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret ()
Libc.callMemcpy bak
bak GlobalVar Mem
memOps) Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 32)
   ::> BVType 1)
args)

llvmMemcpyOverride_8_8_32_noalign_opaque
  :: ( IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr
     , ?memOpts :: MemOptions )
  => LLVMOverride p sym
          (EmptyCtx ::> LLVMPointerType wptr ::> LLVMPointerType wptr
                    ::> BVType 32 ::> BVType 1)
          UnitType
llvmMemcpyOverride_8_8_32_noalign_opaque :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
LLVMOverride
  p
  sym
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 32)
   ::> BVType 1)
  UnitType
llvmMemcpyOverride_8_8_32_noalign_opaque =
  [llvmOvr| void @llvm.memcpy.p0.p0.i32( ptr, ptr, i32, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 32)
   ::> BVType 1)
args -> CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 32)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> Assignment
     (RegEntry sym)
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
       ::> BVType 32)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 32)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
       ::> BVType 32)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 32)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' ()
forall sym bak (wptr :: Natural) (w :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(IsSymBackend sym bak, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret ()
Libc.callMemcpy bak
bak GlobalVar Mem
memOps) Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 32)
   ::> BVType 1)
args)


llvmMemcpyOverride_8_8_64
  :: ( IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr
     , ?memOpts :: MemOptions )
  => LLVMOverride p sym
         (EmptyCtx ::> LLVMPointerType wptr ::> LLVMPointerType wptr
                   ::> BVType 64 ::> BVType 32 ::> BVType 1)
         UnitType
llvmMemcpyOverride_8_8_64 :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
LLVMOverride
  p
  sym
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
     ::> BVType 64)
    ::> BVType 32)
   ::> BVType 1)
  UnitType
llvmMemcpyOverride_8_8_64 =
  [llvmOvr| void @llvm.memcpy.p0i8.p0i8.i64( i8*, i8*, i64, i32, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
     ::> BVType 64)
    ::> BVType 32)
   ::> BVType 1)
args ->
    CurryAssignment
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
     ::> BVType 64)
    ::> BVType 32)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> Assignment
     (RegEntry sym)
     (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
        ::> BVType 64)
       ::> BVType 32)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
     ::> BVType 64)
    ::> BVType 32)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
        ::> BVType 64)
       ::> BVType 32)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (\RegEntry sym (LLVMPointerType wptr)
dst RegEntry sym (LLVMPointerType wptr)
src RegEntry sym (BVType 64)
len RegEntry sym (BVType 32)
_align RegEntry sym (BVType 1)
v -> bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 64)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' ()
forall sym bak (wptr :: Natural) (w :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(IsSymBackend sym bak, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret ()
Libc.callMemcpy bak
bak GlobalVar Mem
memOps RegEntry sym (LLVMPointerType wptr)
dst RegEntry sym (LLVMPointerType wptr)
src RegEntry sym (BVType 64)
len RegEntry sym (BVType 1)
v) Assignment
  (RegEntry sym)
  (((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
     ::> BVType 64)
    ::> BVType 32)
   ::> BVType 1)
args)

llvmMemcpyOverride_8_8_64_noalign
  :: ( IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr
     , ?memOpts :: MemOptions )
  => LLVMOverride p sym
         (EmptyCtx ::> LLVMPointerType wptr ::> LLVMPointerType wptr
                   ::> BVType 64 ::> BVType 1)
         UnitType
llvmMemcpyOverride_8_8_64_noalign :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
LLVMOverride
  p
  sym
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 64)
   ::> BVType 1)
  UnitType
llvmMemcpyOverride_8_8_64_noalign =
  [llvmOvr| void @llvm.memcpy.p0i8.p0i8.i64( i8*, i8*, i64, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 64)
   ::> BVType 1)
args -> CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 64)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> Assignment
     (RegEntry sym)
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
       ::> BVType 64)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 64)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
       ::> BVType 64)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 64)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' ()
forall sym bak (wptr :: Natural) (w :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(IsSymBackend sym bak, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret ()
Libc.callMemcpy bak
bak GlobalVar Mem
memOps) Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 64)
   ::> BVType 1)
args)

llvmMemcpyOverride_8_8_64_noalign_opaque
  :: ( IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr
     , ?memOpts :: MemOptions )
  => LLVMOverride p sym
         (EmptyCtx ::> LLVMPointerType wptr ::> LLVMPointerType wptr
                   ::> BVType 64 ::> BVType 1)
         UnitType
llvmMemcpyOverride_8_8_64_noalign_opaque :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
LLVMOverride
  p
  sym
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 64)
   ::> BVType 1)
  UnitType
llvmMemcpyOverride_8_8_64_noalign_opaque =
  [llvmOvr| void @llvm.memcpy.p0.p0.i64( ptr, ptr, i64, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 64)
   ::> BVType 1)
args -> CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 64)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> Assignment
     (RegEntry sym)
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
       ::> BVType 64)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 64)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
       ::> BVType 64)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 64)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' ()
forall sym bak (wptr :: Natural) (w :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(IsSymBackend sym bak, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret ()
Libc.callMemcpy bak
bak GlobalVar Mem
memOps) Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> LLVMPointerType wptr)
    ::> BVType 64)
   ::> BVType 1)
args)


llvmObjectsizeOverride_32
  :: (IsSymInterface sym, HasPtrWidth wptr)
  => LLVMOverride p sym (EmptyCtx ::> LLVMPointerType wptr ::> BVType 1) (BVType 32)
llvmObjectsizeOverride_32 :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
LLVMOverride
  p
  sym
  ((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1)
  (BVType 32)
llvmObjectsizeOverride_32 =
  [llvmOvr| i32 @llvm.objectsize.i32.p0i8( i8*, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym) ((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1)
args -> CurryAssignment
  ((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 32)))
-> Assignment
     (RegEntry sym) ((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 32))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) f x
-> Assignment f ((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> NatRepr 32
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 32))
forall (w :: Natural) sym bak (wptr :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> NatRepr w
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callObjectsize bak
bak GlobalVar Mem
memOps NatRepr 32
forall (n :: Natural). KnownNat n => NatRepr n
knownNat) Assignment
  (RegEntry sym) ((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1)
args)

llvmObjectsizeOverride_32_null
  :: (IsSymInterface sym, HasPtrWidth wptr)
  => LLVMOverride p sym (EmptyCtx ::> LLVMPointerType wptr ::> BVType 1 ::> BVType 1) (BVType 32)
llvmObjectsizeOverride_32_null :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
LLVMOverride
  p
  sym
  (((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
  (BVType 32)
llvmObjectsizeOverride_32_null =
  [llvmOvr| i32 @llvm.objectsize.i32.p0i8( i8*, i1, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  (((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
args -> CurryAssignment
  (((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 32)))
-> Assignment
     (RegEntry sym)
     (((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 32))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  (((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
  f
  x
-> Assignment
     f (((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> NatRepr 32
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 32))
forall (w :: Natural) sym bak (wptr :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> NatRepr w
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callObjectsize_null bak
bak GlobalVar Mem
memOps NatRepr 32
forall (n :: Natural). KnownNat n => NatRepr n
knownNat) Assignment
  (RegEntry sym)
  (((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
args)

llvmObjectsizeOverride_32_null_dynamic
  :: (IsSymInterface sym, HasPtrWidth wptr)
  => LLVMOverride p sym (EmptyCtx ::> LLVMPointerType wptr ::> BVType 1 ::> BVType 1 ::> BVType 1) (BVType 32)
llvmObjectsizeOverride_32_null_dynamic :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
LLVMOverride
  p
  sym
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
   ::> BVType 1)
  (BVType 32)
llvmObjectsizeOverride_32_null_dynamic =
  [llvmOvr| i32 @llvm.objectsize.i32.p0i8( i8*, i1, i1, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
   ::> BVType 1)
args -> CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 32)))
-> Assignment
     (RegEntry sym)
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 32))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> NatRepr 32
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 32))
forall (w :: Natural) sym bak (wptr :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> NatRepr w
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callObjectsize_null_dynamic bak
bak GlobalVar Mem
memOps NatRepr 32
forall (n :: Natural). KnownNat n => NatRepr n
knownNat) Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
   ::> BVType 1)
args)

llvmObjectsizeOverride_32_null_dynamic_opaque
  :: (IsSymInterface sym, HasPtrWidth wptr)
  => LLVMOverride p sym (EmptyCtx ::> LLVMPointerType wptr ::> BVType 1 ::> BVType 1 ::> BVType 1) (BVType 32)
llvmObjectsizeOverride_32_null_dynamic_opaque :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
LLVMOverride
  p
  sym
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
   ::> BVType 1)
  (BVType 32)
llvmObjectsizeOverride_32_null_dynamic_opaque =
  [llvmOvr| i32 @llvm.objectsize.i32.p0( ptr, i1, i1, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
   ::> BVType 1)
args -> CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 32)))
-> Assignment
     (RegEntry sym)
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 32))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> NatRepr 32
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 32))
forall (w :: Natural) sym bak (wptr :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> NatRepr w
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callObjectsize_null_dynamic bak
bak GlobalVar Mem
memOps NatRepr 32
forall (n :: Natural). KnownNat n => NatRepr n
knownNat) Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
   ::> BVType 1)
args)

llvmObjectsizeOverride_64
  :: (IsSymInterface sym, HasPtrWidth wptr)
  => LLVMOverride p sym (EmptyCtx ::> LLVMPointerType wptr ::> BVType 1) (BVType 64)
llvmObjectsizeOverride_64 :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
LLVMOverride
  p
  sym
  ((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1)
  (BVType 64)
llvmObjectsizeOverride_64 =
  [llvmOvr| i64 @llvm.objectsize.i64.p0i8( i8*, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym) ((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1)
args -> CurryAssignment
  ((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 64)))
-> Assignment
     (RegEntry sym) ((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 64))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) f x
-> Assignment f ((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> NatRepr 64
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 64))
forall (w :: Natural) sym bak (wptr :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> NatRepr w
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callObjectsize bak
bak GlobalVar Mem
memOps NatRepr 64
forall (n :: Natural). KnownNat n => NatRepr n
knownNat) Assignment
  (RegEntry sym) ((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1)
args)

llvmObjectsizeOverride_64_null
  :: (IsSymInterface sym, HasPtrWidth wptr)
  => LLVMOverride p sym (EmptyCtx ::> LLVMPointerType wptr ::> BVType 1 ::> BVType 1) (BVType 64)
llvmObjectsizeOverride_64_null :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
LLVMOverride
  p
  sym
  (((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
  (BVType 64)
llvmObjectsizeOverride_64_null =
  [llvmOvr| i64 @llvm.objectsize.i64.p0i8( i8*, i1, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  (((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
args -> CurryAssignment
  (((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 64)))
-> Assignment
     (RegEntry sym)
     (((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 64))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  (((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
  f
  x
-> Assignment
     f (((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> NatRepr 64
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 64))
forall (w :: Natural) sym bak (wptr :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> NatRepr w
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callObjectsize_null bak
bak GlobalVar Mem
memOps NatRepr 64
forall (n :: Natural). KnownNat n => NatRepr n
knownNat) Assignment
  (RegEntry sym)
  (((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
args)

llvmObjectsizeOverride_64_null_dynamic
  :: (IsSymInterface sym, HasPtrWidth wptr)
  => LLVMOverride p sym (EmptyCtx ::> LLVMPointerType wptr ::> BVType 1 ::> BVType 1 ::> BVType 1) (BVType 64)
llvmObjectsizeOverride_64_null_dynamic :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
LLVMOverride
  p
  sym
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
   ::> BVType 1)
  (BVType 64)
llvmObjectsizeOverride_64_null_dynamic =
  [llvmOvr| i64 @llvm.objectsize.i64.p0i8( i8*, i1, i1, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
   ::> BVType 1)
args -> CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 64)))
-> Assignment
     (RegEntry sym)
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 64))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> NatRepr 64
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 64))
forall (w :: Natural) sym bak (wptr :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> NatRepr w
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callObjectsize_null_dynamic bak
bak GlobalVar Mem
memOps NatRepr 64
forall (n :: Natural). KnownNat n => NatRepr n
knownNat) Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
   ::> BVType 1)
args)

llvmObjectsizeOverride_64_null_dynamic_opaque
  :: (IsSymInterface sym, HasPtrWidth wptr)
  => LLVMOverride p sym (EmptyCtx ::> LLVMPointerType wptr ::> BVType 1 ::> BVType 1 ::> BVType 1) (BVType 64)
llvmObjectsizeOverride_64_null_dynamic_opaque :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
LLVMOverride
  p
  sym
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
   ::> BVType 1)
  (BVType 64)
llvmObjectsizeOverride_64_null_dynamic_opaque =
  [llvmOvr| i64 @llvm.objectsize.i64.p0( ptr, i1, i1, i1 ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
   ::> BVType 1)
args -> CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
   ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 64)))
-> Assignment
     (RegEntry sym)
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
      ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 64))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
   ::> BVType 1)
  f
  x
-> Assignment
     f
     ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
      ::> BVType 1)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> NatRepr 64
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 64))
forall (w :: Natural) sym bak (wptr :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> NatRepr w
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callObjectsize_null_dynamic bak
bak GlobalVar Mem
memOps NatRepr 64
forall (n :: Natural). KnownNat n => NatRepr n
knownNat) Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 1) ::> BVType 1)
   ::> BVType 1)
args)

-- | This instruction is a hint to code generators, which means that it is a
-- no-op for us.
--
-- <https://releases.llvm.org/12.0.0/docs/LangRef.html#llvm-prefetch-intrinsic LLVM docs>
llvmPrefetchOverride ::
  (IsSymInterface sym, HasPtrWidth wptr) =>
  LLVMOverride p sym
    (EmptyCtx ::> LLVMPointerType wptr ::> BVType 32 ::> BVType 32 ::> BVType 32)
    UnitType
llvmPrefetchOverride :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
LLVMOverride
  p
  sym
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 32)
    ::> BVType 32)
   ::> BVType 32)
  UnitType
llvmPrefetchOverride =
  [llvmOvr| void @llvm.prefetch.p0i8( i8*, i32, i32, i32 ) |]
  (\GlobalVar Mem
_memOps bak
_bak Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 32)
    ::> BVType 32)
   ::> BVType 32)
_args -> () -> OverrideSim p sym LLVM rtp args' ret' ()
forall a. a -> OverrideSim p sym LLVM rtp args' ret' a
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure ())

-- | Like 'llvmPrefetchOverride', but with an opaque pointer type.
llvmPrefetchOverride_opaque ::
  (IsSymInterface sym, HasPtrWidth wptr) =>
  LLVMOverride p sym
    (EmptyCtx ::> LLVMPointerType wptr ::> BVType 32 ::> BVType 32 ::> BVType 32)
    UnitType
llvmPrefetchOverride_opaque :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
LLVMOverride
  p
  sym
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 32)
    ::> BVType 32)
   ::> BVType 32)
  UnitType
llvmPrefetchOverride_opaque =
  [llvmOvr| void @llvm.prefetch.p0( ptr, i32, i32, i32 ) |]
  (\GlobalVar Mem
_memOps bak
_bak Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 32)
    ::> BVType 32)
   ::> BVType 32)
_args -> () -> OverrideSim p sym LLVM rtp args' ret' ()
forall a. a -> OverrideSim p sym LLVM rtp args' ret' a
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure ())

-- | This instruction is a hint to code generators, which means that it is a
-- no-op for us.
--
-- See also 'llvmPrefetchOverride'. This version exists for compatibility with
-- pre-10 versions of LLVM, where llvm.prefetch always assumed that the first
-- argument resides in address space 0.
--
-- <https://releases.llvm.org/12.0.0/docs/LangRef.html#llvm-prefetch-intrinsic LLVM docs>
llvmPrefetchOverride_preLLVM10 ::
  (IsSymInterface sym, HasPtrWidth wptr) =>
  LLVMOverride p sym
    (EmptyCtx ::> LLVMPointerType wptr ::> BVType 32 ::> BVType 32 ::> BVType 32)
    UnitType
llvmPrefetchOverride_preLLVM10 :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
LLVMOverride
  p
  sym
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 32)
    ::> BVType 32)
   ::> BVType 32)
  UnitType
llvmPrefetchOverride_preLLVM10 =
  [llvmOvr| void @llvm.prefetch( i8*, i32, i32, i32 ) |]
  (\GlobalVar Mem
_memOps bak
_bak Assignment
  (RegEntry sym)
  ((((EmptyCtx ::> LLVMPointerType wptr) ::> BVType 32)
    ::> BVType 32)
   ::> BVType 32)
_args -> () -> OverrideSim p sym LLVM rtp args' ret' ()
forall a. a -> OverrideSim p sym LLVM rtp args' ret' a
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure ())

llvmFshl ::
  (1 <= w, IsSymInterface sym) =>
  NatRepr w ->
  LLVMOverride p sym
    (EmptyCtx ::> BVType w ::> BVType w ::> BVType w)
    (BVType w)
llvmFshl :: forall (w :: Natural) sym p.
(1 <= w, IsSymInterface sym) =>
NatRepr w
-> LLVMOverride
     p
     sym
     (((EmptyCtx ::> BVType w) ::> BVType w) ::> BVType w)
     (BVType w)
llvmFshl NatRepr w
w =
 let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.fshl.i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Natural -> String
forall a. Show a => a -> String
show (NatRepr w -> Natural
forall (n :: Natural). NatRepr n -> Natural
natValue NatRepr w
w)) in
 [llvmOvr| #w $nm ( #w, #w, #w ) |]
 (\GlobalVar Mem
_memOps bak
bak Assignment
  (RegEntry sym)
  (((EmptyCtx ::> BVType w) ::> BVType w) ::> BVType w)
args -> CurryAssignment
  (((EmptyCtx ::> BVType w) ::> BVType w) ::> BVType w)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w)))
-> Assignment
     (RegEntry sym)
     (((EmptyCtx ::> BVType w) ::> BVType w) ::> BVType w)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  (((EmptyCtx ::> BVType w) ::> BVType w) ::> BVType w) f x
-> Assignment
     f (((EmptyCtx ::> BVType w) ::> BVType w) ::> BVType w)
-> x
Ctx.uncurryAssignment (bak
-> NatRepr w
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> NatRepr w
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callFshl bak
bak NatRepr w
w) Assignment
  (RegEntry sym)
  (((EmptyCtx ::> BVType w) ::> BVType w) ::> BVType w)
args)

llvmFshr ::
  (1 <= w, IsSymInterface sym) =>
  NatRepr w ->
  LLVMOverride p sym
    (EmptyCtx ::> BVType w ::> BVType w ::> BVType w)
    (BVType w)
llvmFshr :: forall (w :: Natural) sym p.
(1 <= w, IsSymInterface sym) =>
NatRepr w
-> LLVMOverride
     p
     sym
     (((EmptyCtx ::> BVType w) ::> BVType w) ::> BVType w)
     (BVType w)
llvmFshr NatRepr w
w =
 let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.fshr.i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Natural -> String
forall a. Show a => a -> String
show (NatRepr w -> Natural
forall (n :: Natural). NatRepr n -> Natural
natValue NatRepr w
w)) in
 [llvmOvr| #w $nm ( #w, #w, #w ) |]
 (\GlobalVar Mem
_memOps bak
bak Assignment
  (RegEntry sym)
  (((EmptyCtx ::> BVType w) ::> BVType w) ::> BVType w)
args -> CurryAssignment
  (((EmptyCtx ::> BVType w) ::> BVType w) ::> BVType w)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w)))
-> Assignment
     (RegEntry sym)
     (((EmptyCtx ::> BVType w) ::> BVType w) ::> BVType w)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  (((EmptyCtx ::> BVType w) ::> BVType w) ::> BVType w) f x
-> Assignment
     f (((EmptyCtx ::> BVType w) ::> BVType w) ::> BVType w)
-> x
Ctx.uncurryAssignment (bak
-> NatRepr w
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> NatRepr w
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callFshr bak
bak NatRepr w
w) Assignment
  (RegEntry sym)
  (((EmptyCtx ::> BVType w) ::> BVType w) ::> BVType w)
args)

llvmSaddWithOverflow
  :: (1 <= w, IsSymInterface sym)
  => NatRepr w ->
     LLVMOverride p sym
         (EmptyCtx ::> BVType w ::> BVType w)
         (StructType (EmptyCtx ::> BVType w ::> BVType 1))
llvmSaddWithOverflow :: forall (w :: Natural) sym p.
(1 <= w, IsSymInterface sym) =>
NatRepr w
-> LLVMOverride
     p
     sym
     ((EmptyCtx ::> BVType w) ::> BVType w)
     (StructType ((EmptyCtx ::> BVType w) ::> BVType 1))
llvmSaddWithOverflow NatRepr w
w =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.sadd.with.overflow.i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Natural -> String
forall a. Show a => a -> String
show (NatRepr w -> Natural
forall (n :: Natural). NatRepr n -> Natural
natValue NatRepr w
w)) in
  [llvmOvr| { #w, i1 } $nm ( #w, #w ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
args -> CurryAssignment
  ((EmptyCtx ::> BVType w) ::> BVType w)
  (RegEntry sym)
  (OverrideSim
     p
     sym
     LLVM
     rtp
     args'
     ret'
     (RegValue
        sym ('StructType ((EmptyCtx ::> BVType w) ::> BVType 1))))
-> Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
-> OverrideSim
     p
     sym
     LLVM
     rtp
     args'
     ret'
     (RegValue sym ('StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment ((EmptyCtx ::> BVType w) ::> BVType w) f x
-> Assignment f ((EmptyCtx ::> BVType w) ::> BVType w) -> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim
     p
     sym
     LLVM
     rtp
     args'
     ret'
     (RegValue sym ('StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
callSaddWithOverflow bak
bak GlobalVar Mem
memOps) Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
args)

llvmUaddWithOverflow
  :: (1 <= w, IsSymInterface sym)
  => NatRepr w ->
     LLVMOverride p sym
         (EmptyCtx ::> BVType w ::> BVType w)
         (StructType (EmptyCtx ::> BVType w ::> BVType 1))
llvmUaddWithOverflow :: forall (w :: Natural) sym p.
(1 <= w, IsSymInterface sym) =>
NatRepr w
-> LLVMOverride
     p
     sym
     ((EmptyCtx ::> BVType w) ::> BVType w)
     (StructType ((EmptyCtx ::> BVType w) ::> BVType 1))
llvmUaddWithOverflow NatRepr w
w =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.uadd.with.overflow.i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Natural -> String
forall a. Show a => a -> String
show (NatRepr w -> Natural
forall (n :: Natural). NatRepr n -> Natural
natValue NatRepr w
w)) in
    [llvmOvr| { #w, i1 } $nm ( #w, #w ) |]
    (\GlobalVar Mem
memOps bak
bak Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
args -> CurryAssignment
  ((EmptyCtx ::> BVType w) ::> BVType w)
  (RegEntry sym)
  (OverrideSim
     p
     sym
     LLVM
     rtp
     args'
     ret'
     (RegValue
        sym ('StructType ((EmptyCtx ::> BVType w) ::> BVType 1))))
-> Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
-> OverrideSim
     p
     sym
     LLVM
     rtp
     args'
     ret'
     (RegValue sym ('StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment ((EmptyCtx ::> BVType w) ::> BVType w) f x
-> Assignment f ((EmptyCtx ::> BVType w) ::> BVType w) -> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim
     p
     sym
     LLVM
     rtp
     args'
     ret'
     (RegValue sym ('StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
callUaddWithOverflow bak
bak GlobalVar Mem
memOps) Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
args)


llvmSsubWithOverflow
  :: (1 <= w, IsSymInterface sym)
  => NatRepr w ->
     LLVMOverride p sym
         (EmptyCtx ::> BVType w ::> BVType w)
         (StructType (EmptyCtx ::> BVType w ::> BVType 1))
llvmSsubWithOverflow :: forall (w :: Natural) sym p.
(1 <= w, IsSymInterface sym) =>
NatRepr w
-> LLVMOverride
     p
     sym
     ((EmptyCtx ::> BVType w) ::> BVType w)
     (StructType ((EmptyCtx ::> BVType w) ::> BVType 1))
llvmSsubWithOverflow NatRepr w
w =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.ssub.with.overflow.i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Natural -> String
forall a. Show a => a -> String
show (NatRepr w -> Natural
forall (n :: Natural). NatRepr n -> Natural
natValue NatRepr w
w)) in
    [llvmOvr| { #w, i1 } $nm ( #w, #w ) |]
    (\GlobalVar Mem
memOps bak
bak Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
args -> CurryAssignment
  ((EmptyCtx ::> BVType w) ::> BVType w)
  (RegEntry sym)
  (OverrideSim
     p
     sym
     LLVM
     rtp
     args'
     ret'
     (RegValue
        sym ('StructType ((EmptyCtx ::> BVType w) ::> BVType 1))))
-> Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
-> OverrideSim
     p
     sym
     LLVM
     rtp
     args'
     ret'
     (RegValue sym ('StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment ((EmptyCtx ::> BVType w) ::> BVType w) f x
-> Assignment f ((EmptyCtx ::> BVType w) ::> BVType w) -> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim
     p
     sym
     LLVM
     rtp
     args'
     ret'
     (RegValue sym ('StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
callSsubWithOverflow bak
bak GlobalVar Mem
memOps) Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
args)


llvmUsubWithOverflow
  :: (1 <= w, IsSymInterface sym)
  => NatRepr w ->
     LLVMOverride p sym
         (EmptyCtx ::> BVType w ::> BVType w)
         (StructType (EmptyCtx ::> BVType w ::> BVType 1))
llvmUsubWithOverflow :: forall (w :: Natural) sym p.
(1 <= w, IsSymInterface sym) =>
NatRepr w
-> LLVMOverride
     p
     sym
     ((EmptyCtx ::> BVType w) ::> BVType w)
     (StructType ((EmptyCtx ::> BVType w) ::> BVType 1))
llvmUsubWithOverflow NatRepr w
w =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.usub.with.overflow.i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Natural -> String
forall a. Show a => a -> String
show (NatRepr w -> Natural
forall (n :: Natural). NatRepr n -> Natural
natValue NatRepr w
w)) in
    [llvmOvr| { #w, i1 } $nm ( #w, #w ) |]
    (\GlobalVar Mem
memOps bak
bak Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
args -> CurryAssignment
  ((EmptyCtx ::> BVType w) ::> BVType w)
  (RegEntry sym)
  (OverrideSim
     p
     sym
     LLVM
     rtp
     args'
     ret'
     (RegValue
        sym ('StructType ((EmptyCtx ::> BVType w) ::> BVType 1))))
-> Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
-> OverrideSim
     p
     sym
     LLVM
     rtp
     args'
     ret'
     (RegValue sym ('StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment ((EmptyCtx ::> BVType w) ::> BVType w) f x
-> Assignment f ((EmptyCtx ::> BVType w) ::> BVType w) -> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim
     p
     sym
     LLVM
     rtp
     args'
     ret'
     (RegValue sym ('StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
callUsubWithOverflow bak
bak GlobalVar Mem
memOps) Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
args)

llvmSmulWithOverflow
  :: (1 <= w, IsSymInterface sym)
  => NatRepr w ->
     LLVMOverride p sym
         (EmptyCtx ::> BVType w ::> BVType w)
         (StructType (EmptyCtx ::> BVType w ::> BVType 1))
llvmSmulWithOverflow :: forall (w :: Natural) sym p.
(1 <= w, IsSymInterface sym) =>
NatRepr w
-> LLVMOverride
     p
     sym
     ((EmptyCtx ::> BVType w) ::> BVType w)
     (StructType ((EmptyCtx ::> BVType w) ::> BVType 1))
llvmSmulWithOverflow NatRepr w
w =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.smul.with.overflow.i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Natural -> String
forall a. Show a => a -> String
show (NatRepr w -> Natural
forall (n :: Natural). NatRepr n -> Natural
natValue NatRepr w
w)) in
    [llvmOvr| { #w, i1 } $nm ( #w, #w ) |]
    (\GlobalVar Mem
memOps bak
bak Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
args -> CurryAssignment
  ((EmptyCtx ::> BVType w) ::> BVType w)
  (RegEntry sym)
  (OverrideSim
     p
     sym
     LLVM
     rtp
     args'
     ret'
     (RegValue
        sym ('StructType ((EmptyCtx ::> BVType w) ::> BVType 1))))
-> Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
-> OverrideSim
     p
     sym
     LLVM
     rtp
     args'
     ret'
     (RegValue sym ('StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment ((EmptyCtx ::> BVType w) ::> BVType w) f x
-> Assignment f ((EmptyCtx ::> BVType w) ::> BVType w) -> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim
     p
     sym
     LLVM
     rtp
     args'
     ret'
     (RegValue sym ('StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
callSmulWithOverflow bak
bak GlobalVar Mem
memOps) Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
args)

llvmUmulWithOverflow
  :: (1 <= w, IsSymInterface sym)
  => NatRepr w ->
     LLVMOverride p sym
         (EmptyCtx ::> BVType w ::> BVType w)
         (StructType (EmptyCtx ::> BVType w ::> BVType 1))
llvmUmulWithOverflow :: forall (w :: Natural) sym p.
(1 <= w, IsSymInterface sym) =>
NatRepr w
-> LLVMOverride
     p
     sym
     ((EmptyCtx ::> BVType w) ::> BVType w)
     (StructType ((EmptyCtx ::> BVType w) ::> BVType 1))
llvmUmulWithOverflow NatRepr w
w =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.umul.with.overflow.i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Natural -> String
forall a. Show a => a -> String
show (NatRepr w -> Natural
forall (n :: Natural). NatRepr n -> Natural
natValue NatRepr w
w)) in
  [llvmOvr| { #w, i1 } $nm ( #w, #w ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
args -> CurryAssignment
  ((EmptyCtx ::> BVType w) ::> BVType w)
  (RegEntry sym)
  (OverrideSim
     p
     sym
     LLVM
     rtp
     args'
     ret'
     (RegValue
        sym ('StructType ((EmptyCtx ::> BVType w) ::> BVType 1))))
-> Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
-> OverrideSim
     p
     sym
     LLVM
     rtp
     args'
     ret'
     (RegValue sym ('StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment ((EmptyCtx ::> BVType w) ::> BVType w) f x
-> Assignment f ((EmptyCtx ::> BVType w) ::> BVType w) -> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim
     p
     sym
     LLVM
     rtp
     args'
     ret'
     (RegValue sym ('StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
callUmulWithOverflow bak
bak GlobalVar Mem
memOps) Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
args)

llvmUmax ::
  (1 <= w, IsSymInterface sym) =>
  NatRepr w ->
  LLVMOverride p sym
     (EmptyCtx ::> BVType w ::> BVType w)
     (BVType w)
llvmUmax :: forall (w :: Natural) sym p.
(1 <= w, IsSymInterface sym) =>
NatRepr w
-> LLVMOverride
     p sym ((EmptyCtx ::> BVType w) ::> BVType w) (BVType w)
llvmUmax NatRepr w
w =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.umax.i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Natural -> String
forall a. Show a => a -> String
show (NatRepr w -> Natural
forall (n :: Natural). NatRepr n -> Natural
natValue NatRepr w
w)) in
    [llvmOvr| #w $nm( #w, #w ) |]
    (\GlobalVar Mem
memOps bak
bak Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
args -> CurryAssignment
  ((EmptyCtx ::> BVType w) ::> BVType w)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w)))
-> Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment ((EmptyCtx ::> BVType w) ::> BVType w) f x
-> Assignment f ((EmptyCtx ::> BVType w) ::> BVType w) -> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callUmax bak
bak GlobalVar Mem
memOps) Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
args)

llvmUmin ::
  (1 <= w, IsSymInterface sym) =>
  NatRepr w ->
  LLVMOverride p sym
     (EmptyCtx ::> BVType w ::> BVType w)
     (BVType w)
llvmUmin :: forall (w :: Natural) sym p.
(1 <= w, IsSymInterface sym) =>
NatRepr w
-> LLVMOverride
     p sym ((EmptyCtx ::> BVType w) ::> BVType w) (BVType w)
llvmUmin NatRepr w
w =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.umin.i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Natural -> String
forall a. Show a => a -> String
show (NatRepr w -> Natural
forall (n :: Natural). NatRepr n -> Natural
natValue NatRepr w
w)) in
    [llvmOvr| #w $nm( #w, #w ) |]
    (\GlobalVar Mem
memOps bak
bak Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
args -> CurryAssignment
  ((EmptyCtx ::> BVType w) ::> BVType w)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w)))
-> Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment ((EmptyCtx ::> BVType w) ::> BVType w) f x
-> Assignment f ((EmptyCtx ::> BVType w) ::> BVType w) -> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callUmin bak
bak GlobalVar Mem
memOps) Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
args)

llvmSmax ::
  (1 <= w, IsSymInterface sym) =>
  NatRepr w ->
  LLVMOverride p sym
     (EmptyCtx ::> BVType w ::> BVType w)
     (BVType w)
llvmSmax :: forall (w :: Natural) sym p.
(1 <= w, IsSymInterface sym) =>
NatRepr w
-> LLVMOverride
     p sym ((EmptyCtx ::> BVType w) ::> BVType w) (BVType w)
llvmSmax NatRepr w
w =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.smax.i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Natural -> String
forall a. Show a => a -> String
show (NatRepr w -> Natural
forall (n :: Natural). NatRepr n -> Natural
natValue NatRepr w
w)) in
    [llvmOvr| #w $nm( #w, #w ) |]
    (\GlobalVar Mem
memOps bak
bak Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
args -> CurryAssignment
  ((EmptyCtx ::> BVType w) ::> BVType w)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w)))
-> Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment ((EmptyCtx ::> BVType w) ::> BVType w) f x
-> Assignment f ((EmptyCtx ::> BVType w) ::> BVType w) -> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callSmax bak
bak GlobalVar Mem
memOps) Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
args)

llvmSmin ::
  (1 <= w, IsSymInterface sym) =>
  NatRepr w ->
  LLVMOverride p sym
     (EmptyCtx ::> BVType w ::> BVType w)
     (BVType w)
llvmSmin :: forall (w :: Natural) sym p.
(1 <= w, IsSymInterface sym) =>
NatRepr w
-> LLVMOverride
     p sym ((EmptyCtx ::> BVType w) ::> BVType w) (BVType w)
llvmSmin NatRepr w
w =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.smin.i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Natural -> String
forall a. Show a => a -> String
show (NatRepr w -> Natural
forall (n :: Natural). NatRepr n -> Natural
natValue NatRepr w
w)) in
    [llvmOvr| #w $nm( #w, #w ) |]
    (\GlobalVar Mem
memOps bak
bak Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
args -> CurryAssignment
  ((EmptyCtx ::> BVType w) ::> BVType w)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w)))
-> Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment ((EmptyCtx ::> BVType w) ::> BVType w) f x
-> Assignment f ((EmptyCtx ::> BVType w) ::> BVType w) -> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callSmin bak
bak GlobalVar Mem
memOps) Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType w)
args)

llvmCtlz
  :: (1 <= w, IsSymInterface sym)
  => NatRepr w ->
     LLVMOverride p sym
         (EmptyCtx ::> BVType w ::> BVType 1)
         (BVType w)
llvmCtlz :: forall (w :: Natural) sym p.
(1 <= w, IsSymInterface sym) =>
NatRepr w
-> LLVMOverride
     p sym ((EmptyCtx ::> BVType w) ::> BVType 1) (BVType w)
llvmCtlz NatRepr w
w =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.ctlz.i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Natural -> String
forall a. Show a => a -> String
show (NatRepr w -> Natural
forall (n :: Natural). NatRepr n -> Natural
natValue NatRepr w
w)) in
    [llvmOvr| #w $nm ( #w, i1 ) |]
    (\GlobalVar Mem
memOps bak
bak Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType 1)
args -> CurryAssignment
  ((EmptyCtx ::> BVType w) ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w)))
-> Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment ((EmptyCtx ::> BVType w) ::> BVType 1) f x
-> Assignment f ((EmptyCtx ::> BVType w) ::> BVType 1) -> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callCtlz bak
bak GlobalVar Mem
memOps) Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType 1)
args)

llvmCttz
  :: (1 <= w, IsSymInterface sym)
  => NatRepr w
  -> LLVMOverride p sym
         (EmptyCtx ::> BVType w ::> BVType 1)
         (BVType w)
llvmCttz :: forall (w :: Natural) sym p.
(1 <= w, IsSymInterface sym) =>
NatRepr w
-> LLVMOverride
     p sym ((EmptyCtx ::> BVType w) ::> BVType 1) (BVType w)
llvmCttz NatRepr w
w =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.cttz.i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Natural -> String
forall a. Show a => a -> String
show (NatRepr w -> Natural
forall (n :: Natural). NatRepr n -> Natural
natValue NatRepr w
w)) in
    [llvmOvr| #w $nm ( #w, i1 ) |]
    (\GlobalVar Mem
memOps bak
bak Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType 1)
args -> CurryAssignment
  ((EmptyCtx ::> BVType w) ::> BVType 1)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w)))
-> Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment ((EmptyCtx ::> BVType w) ::> BVType 1) f x
-> Assignment f ((EmptyCtx ::> BVType w) ::> BVType 1) -> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callCttz bak
bak GlobalVar Mem
memOps) Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType 1)
args)

llvmCtpop
  :: (1 <= w, IsSymInterface sym)
  => NatRepr w
  -> LLVMOverride p sym
         (EmptyCtx ::> BVType w)
         (BVType w)
llvmCtpop :: forall (w :: Natural) sym p.
(1 <= w, IsSymInterface sym) =>
NatRepr w -> LLVMOverride p sym (EmptyCtx ::> BVType w) (BVType w)
llvmCtpop NatRepr w
w =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.ctpop.i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Natural -> String
forall a. Show a => a -> String
show (NatRepr w -> Natural
forall (n :: Natural). NatRepr n -> Natural
natValue NatRepr w
w)) in
    [llvmOvr| #w $nm( #w ) |]
    (\GlobalVar Mem
memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> BVType w)
args -> CurryAssignment
  (EmptyCtx ::> BVType w)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w)))
-> Assignment (RegEntry sym) (EmptyCtx ::> BVType w)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> BVType w) f x
-> Assignment f (EmptyCtx ::> BVType w) -> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callCtpop bak
bak GlobalVar Mem
memOps) Assignment (RegEntry sym) (EmptyCtx ::> BVType w)
args)

llvmBitreverse
  :: (1 <= w, IsSymInterface sym)
  => NatRepr w
  -> LLVMOverride p sym
         (EmptyCtx ::> BVType w)
         (BVType w)
llvmBitreverse :: forall (w :: Natural) sym p.
(1 <= w, IsSymInterface sym) =>
NatRepr w -> LLVMOverride p sym (EmptyCtx ::> BVType w) (BVType w)
llvmBitreverse NatRepr w
w =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.bitreverse.i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Natural -> String
forall a. Show a => a -> String
show (NatRepr w -> Natural
forall (n :: Natural). NatRepr n -> Natural
natValue NatRepr w
w)) in
    [llvmOvr| #w $nm( #w ) |]
    (\GlobalVar Mem
memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> BVType w)
args -> CurryAssignment
  (EmptyCtx ::> BVType w)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w)))
-> Assignment (RegEntry sym) (EmptyCtx ::> BVType w)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> BVType w) f x
-> Assignment f (EmptyCtx ::> BVType w) -> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callBitreverse bak
bak GlobalVar Mem
memOps) Assignment (RegEntry sym) (EmptyCtx ::> BVType w)
args)

-- | <https://llvm.org/docs/LangRef.html#llvm-bswap-intrinsics LLVM docs>
llvmBSwapOverride
  :: forall width sym p
   . ( 1 <= width, IsSymInterface sym)
  => NatRepr width
  -> LLVMOverride p sym
         (EmptyCtx ::> BVType (width * 8))
         (BVType (width * 8))
llvmBSwapOverride :: forall (width :: Natural) sym p.
(1 <= width, IsSymInterface sym) =>
NatRepr width
-> LLVMOverride
     p sym (EmptyCtx ::> BVType (width * 8)) (BVType (width * 8))
llvmBSwapOverride NatRepr width
widthRepr =
  let width8 :: NatRepr (width * 8)
width8 = NatRepr width -> NatRepr 8 -> NatRepr (width * 8)
forall (n :: Natural) (m :: Natural).
NatRepr n -> NatRepr m -> NatRepr (n * m)
natMultiply NatRepr width
widthRepr (forall (n :: Natural). KnownNat n => NatRepr n
knownNat @8)
      nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.bswap.i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show (NatRepr (width * 8) -> Int
forall (n :: Natural). NatRepr n -> Int
widthVal NatRepr (width * 8)
width8))
  in
    case NatRepr width -> NatRepr 8 -> (width * 8) :~: (8 * width)
forall (f :: Natural -> Type) (m :: Natural) (g :: Natural -> Type)
       (n :: Natural).
f m -> g n -> (m * n) :~: (n * m)
mulComm NatRepr width
widthRepr (forall (n :: Natural). KnownNat n => NatRepr n
knownNat @8) of { (width * 8) :~: (8 * width)
Refl ->
    case NatRepr 8 -> NatRepr width -> LeqProof width (8 * width)
forall (x :: Natural) (p :: Natural -> Type) (q :: Natural -> Type)
       (y :: Natural).
(1 <= x) =>
p x -> q y -> LeqProof y (x * y)
leqMulMono (forall (n :: Natural). KnownNat n => NatRepr n
knownNat @8) NatRepr width
widthRepr :: LeqProof width (width * 8) of { LeqProof width (width * 8)
LeqProof ->
    case LeqProof 1 width
-> LeqProof width (width * 8) -> LeqProof 1 (width * 8)
forall (m :: Natural) (n :: Natural) (p :: Natural).
LeqProof m n -> LeqProof n p -> LeqProof m p
leqTrans (LeqProof 1 width
forall (m :: Natural) (n :: Natural). (m <= n) => LeqProof m n
LeqProof :: LeqProof 1 width)
                  (LeqProof width (width * 8)
forall (m :: Natural) (n :: Natural). (m <= n) => LeqProof m n
LeqProof :: LeqProof width (width * 8)) of { LeqProof 1 (width * 8)
LeqProof ->
        -- From the LLVM docs:
        -- declare i16 @llvm.bswap.i16(i16 <id>)
        [llvmOvr| #width8 $nm( #width8 ) |]
        (\GlobalVar Mem
_ bak
bak Assignment (RegEntry sym) (EmptyCtx ::> BVType (width * 8))
args -> CurryAssignment
  (EmptyCtx ::> BVType (width * 8))
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (BVType (width * 8))))
-> Assignment (RegEntry sym) (EmptyCtx ::> BVType (width * 8))
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (BVType (width * 8)))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> BVType (width * 8)) f x
-> Assignment f (EmptyCtx ::> BVType (width * 8)) -> x
Ctx.uncurryAssignment (bak
-> NatRepr width
-> RegEntry sym (BVType (width * 8))
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (BVType (width * 8)))
forall (width :: Natural) sym bak p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(1 <= width, IsSymBackend sym bak) =>
bak
-> NatRepr width
-> RegEntry sym (BVType (width * 8))
-> OverrideSim
     p sym ext r args ret (RegValue sym (BVType (width * 8)))
Libc.callBSwap bak
bak NatRepr width
widthRepr) Assignment (RegEntry sym) (EmptyCtx ::> BVType (width * 8))
args)
    }}}

llvmAbsOverride ::
  (1 <= w, IsSymInterface sym, HasLLVMAnn sym) =>
  NatRepr w ->
  LLVMOverride p sym
     (EmptyCtx ::> BVType w ::> BVType 1)
     (BVType w)
llvmAbsOverride :: forall (w :: Natural) sym p.
(1 <= w, IsSymInterface sym, HasLLVMAnn sym) =>
NatRepr w
-> LLVMOverride
     p sym ((EmptyCtx ::> BVType w) ::> BVType 1) (BVType w)
llvmAbsOverride NatRepr w
w =
  let nm :: Symbol
nm = String -> Symbol
L.Symbol (String
"llvm.abs.i" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Natural -> String
forall a. Show a => a -> String
show (NatRepr w -> Natural
forall (n :: Natural). NatRepr n -> Natural
natValue NatRepr w
w)) in
    [llvmOvr| #w $nm( #w, i1 ) |]
    (\GlobalVar Mem
mvar bak
bak Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType 1)
args ->
     do CallStack
callStack <- GlobalVar Mem -> OverrideSim p sym LLVM rtp args' ret' CallStack
forall p sym ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
GlobalVar Mem -> OverrideSim p sym ext r args ret CallStack
callStackFromMemVar' GlobalVar Mem
mvar
        CurryAssignment
  ((EmptyCtx ::> BVType w) ::> BVType 1)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (SymExpr sym ('BaseBVType w)))
-> Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType 1)
-> OverrideSim
     p sym LLVM rtp args' ret' (SymExpr sym ('BaseBVType w))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment ((EmptyCtx ::> BVType w) ::> BVType 1) f x
-> Assignment f ((EmptyCtx ::> BVType w) ::> BVType 1) -> x
Ctx.uncurryAssignment (bak
-> CallStack
-> NatRepr w
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType w))
forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak, HasLLVMAnn sym) =>
bak
-> CallStack
-> NatRepr w
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
Libc.callLLVMAbs bak
bak CallStack
callStack NatRepr w
w) Assignment (RegEntry sym) ((EmptyCtx ::> BVType w) ::> BVType 1)
args)

llvmCopysignOverride_F32 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType SingleFloat ::> FloatType SingleFloat)
     (FloatType SingleFloat)
llvmCopysignOverride_F32 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p
  sym
  ((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
  (FloatType SingleFloat)
llvmCopysignOverride_F32 =
  [llvmOvr| float @llvm.copysign.f32( float, float ) |]
  (\GlobalVar Mem
_memOpts bak
bak Assignment
  (RegEntry sym)
  ((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
args -> CurryAssignment
  ((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat)))
-> Assignment
     (RegEntry sym)
     ((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
  f
  x
-> Assignment
     f ((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
-> x
Ctx.uncurryAssignment (bak
-> RegEntry sym (FloatType SingleFloat)
-> RegEntry sym (FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
IsSymBackend sym bak =>
bak
-> RegEntry sym (FloatType fi)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
callCopysign bak
bak) Assignment
  (RegEntry sym)
  ((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
args)

llvmCopysignOverride_F64 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType DoubleFloat ::> FloatType DoubleFloat)
     (FloatType DoubleFloat)
llvmCopysignOverride_F64 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p
  sym
  ((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
  (FloatType DoubleFloat)
llvmCopysignOverride_F64 =
  [llvmOvr| double @llvm.copysign.f64( double, double ) |]
  (\GlobalVar Mem
_memOpts bak
bak Assignment
  (RegEntry sym)
  ((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
args -> CurryAssignment
  ((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat)))
-> Assignment
     (RegEntry sym)
     ((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
  f
  x
-> Assignment
     f ((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
-> x
Ctx.uncurryAssignment (bak
-> RegEntry sym (FloatType DoubleFloat)
-> RegEntry sym (FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
IsSymBackend sym bak =>
bak
-> RegEntry sym (FloatType fi)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
callCopysign bak
bak) Assignment
  (RegEntry sym)
  ((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
args)


llvmFabsF32
  :: forall sym p
   . ( IsSymInterface sym)
  => LLVMOverride p sym
        (EmptyCtx ::> FloatType SingleFloat)
        (FloatType SingleFloat)
llvmFabsF32 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType SingleFloat) (FloatType SingleFloat)
llvmFabsF32 =
  [llvmOvr| float @llvm.fabs.f32( float ) |]
  (\GlobalVar Mem
_memOps bak
bak (Assignment (RegEntry sym) ctx
Empty :> (RegEntry sym tp -> RegValue sym tp
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym tp
x)) -> IO (SymInterpretedFloat sym SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (SymInterpretedFloat sym SingleFloat)
forall a. IO a -> OverrideSim p sym LLVM rtp args' ret' a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (forall sym (fi :: FloatInfo).
IsInterpretedFloatExprBuilder sym =>
sym
-> SymInterpretedFloat sym fi -> IO (SymInterpretedFloat sym fi)
iFloatAbs @_ @SingleFloat (bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak) RegValue sym tp
SymInterpretedFloat sym SingleFloat
x))


llvmFabsF64
  :: forall sym p
   . ( IsSymInterface sym)
  => LLVMOverride p sym
        (EmptyCtx ::> FloatType DoubleFloat)
        (FloatType DoubleFloat)
llvmFabsF64 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType DoubleFloat) (FloatType DoubleFloat)
llvmFabsF64 =
  [llvmOvr| double @llvm.fabs.f64( double ) |]
  (\GlobalVar Mem
_memOps bak
bak (Assignment (RegEntry sym) ctx
Empty :> (RegEntry sym tp -> RegValue sym tp
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym tp
x)) -> IO (SymInterpretedFloat sym DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (SymInterpretedFloat sym DoubleFloat)
forall a. IO a -> OverrideSim p sym LLVM rtp args' ret' a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (forall sym (fi :: FloatInfo).
IsInterpretedFloatExprBuilder sym =>
sym
-> SymInterpretedFloat sym fi -> IO (SymInterpretedFloat sym fi)
iFloatAbs @_ @DoubleFloat (bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak) RegValue sym tp
SymInterpretedFloat sym DoubleFloat
x))

llvmCeilOverride_F32 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType SingleFloat)
     (FloatType SingleFloat)
llvmCeilOverride_F32 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType SingleFloat) (FloatType SingleFloat)
llvmCeilOverride_F32 =
  [llvmOvr| float @llvm.ceil.f32( float ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
args -> CurryAssignment
  (EmptyCtx ::> FloatType SingleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat)))
-> Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> FloatType SingleFloat) f x
-> Assignment f (EmptyCtx ::> FloatType SingleFloat) -> x
Ctx.uncurryAssignment (bak
-> RegEntry sym (FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
IsSymBackend sym bak =>
bak
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callCeil bak
bak) Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
args)

llvmCeilOverride_F64 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType DoubleFloat)
     (FloatType DoubleFloat)
llvmCeilOverride_F64 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType DoubleFloat) (FloatType DoubleFloat)
llvmCeilOverride_F64 =
  [llvmOvr| double @llvm.ceil.f64( double ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
args -> CurryAssignment
  (EmptyCtx ::> FloatType DoubleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat)))
-> Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> FloatType DoubleFloat) f x
-> Assignment f (EmptyCtx ::> FloatType DoubleFloat) -> x
Ctx.uncurryAssignment (bak
-> RegEntry sym (FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
IsSymBackend sym bak =>
bak
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callCeil bak
bak) Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
args)

llvmFloorOverride_F32 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType SingleFloat)
     (FloatType SingleFloat)
llvmFloorOverride_F32 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType SingleFloat) (FloatType SingleFloat)
llvmFloorOverride_F32 =
  [llvmOvr| float @llvm.floor.f32( float ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
args -> CurryAssignment
  (EmptyCtx ::> FloatType SingleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat)))
-> Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> FloatType SingleFloat) f x
-> Assignment f (EmptyCtx ::> FloatType SingleFloat) -> x
Ctx.uncurryAssignment (bak
-> RegEntry sym (FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
IsSymBackend sym bak =>
bak
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callFloor bak
bak) Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
args)

llvmFloorOverride_F64 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType DoubleFloat)
     (FloatType DoubleFloat)
llvmFloorOverride_F64 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType DoubleFloat) (FloatType DoubleFloat)
llvmFloorOverride_F64 =
  [llvmOvr| double @llvm.floor.f64( double ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
args -> CurryAssignment
  (EmptyCtx ::> FloatType DoubleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat)))
-> Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> FloatType DoubleFloat) f x
-> Assignment f (EmptyCtx ::> FloatType DoubleFloat) -> x
Ctx.uncurryAssignment (bak
-> RegEntry sym (FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
IsSymBackend sym bak =>
bak
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callFloor bak
bak) Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
args)

llvmSqrtOverride_F32 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType SingleFloat)
     (FloatType SingleFloat)
llvmSqrtOverride_F32 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType SingleFloat) (FloatType SingleFloat)
llvmSqrtOverride_F32 =
  [llvmOvr| float @llvm.sqrt.f32( float ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
args -> CurryAssignment
  (EmptyCtx ::> FloatType SingleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat)))
-> Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> FloatType SingleFloat) f x
-> Assignment f (EmptyCtx ::> FloatType SingleFloat) -> x
Ctx.uncurryAssignment (bak
-> RegEntry sym (FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
IsSymBackend sym bak =>
bak
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callSqrt bak
bak) Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
args)

llvmSqrtOverride_F64 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType DoubleFloat)
     (FloatType DoubleFloat)
llvmSqrtOverride_F64 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType DoubleFloat) (FloatType DoubleFloat)
llvmSqrtOverride_F64 =
  [llvmOvr| double @llvm.sqrt.f64( double ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
args -> CurryAssignment
  (EmptyCtx ::> FloatType DoubleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat)))
-> Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> FloatType DoubleFloat) f x
-> Assignment f (EmptyCtx ::> FloatType DoubleFloat) -> x
Ctx.uncurryAssignment (bak
-> RegEntry sym (FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
IsSymBackend sym bak =>
bak
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callSqrt bak
bak) Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
args)

llvmSinOverride_F32 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType SingleFloat)
     (FloatType SingleFloat)
llvmSinOverride_F32 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType SingleFloat) (FloatType SingleFloat)
llvmSinOverride_F32 =
  [llvmOvr| float @llvm.sin.f32( float ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
args -> CurryAssignment
  (EmptyCtx ::> FloatType SingleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat)))
-> Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> FloatType SingleFloat) f x
-> Assignment f (EmptyCtx ::> FloatType SingleFloat) -> x
Ctx.uncurryAssignment (bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(IsSymBackend sym bak, KnownRepr FloatInfoRepr fi) =>
bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callSpecialFunction1 bak
bak SpecialFunction (EmptyCtx ::> R)
W4.Sin) Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
args)

llvmSinOverride_F64 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType DoubleFloat)
     (FloatType DoubleFloat)
llvmSinOverride_F64 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType DoubleFloat) (FloatType DoubleFloat)
llvmSinOverride_F64 =
  [llvmOvr| double @llvm.sin.f64( double ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
args -> CurryAssignment
  (EmptyCtx ::> FloatType DoubleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat)))
-> Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> FloatType DoubleFloat) f x
-> Assignment f (EmptyCtx ::> FloatType DoubleFloat) -> x
Ctx.uncurryAssignment (bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(IsSymBackend sym bak, KnownRepr FloatInfoRepr fi) =>
bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callSpecialFunction1 bak
bak SpecialFunction (EmptyCtx ::> R)
W4.Sin) Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
args)

llvmCosOverride_F32 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType SingleFloat)
     (FloatType SingleFloat)
llvmCosOverride_F32 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType SingleFloat) (FloatType SingleFloat)
llvmCosOverride_F32 =
  [llvmOvr| float @llvm.cos.f32( float ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
args -> CurryAssignment
  (EmptyCtx ::> FloatType SingleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat)))
-> Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> FloatType SingleFloat) f x
-> Assignment f (EmptyCtx ::> FloatType SingleFloat) -> x
Ctx.uncurryAssignment (bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(IsSymBackend sym bak, KnownRepr FloatInfoRepr fi) =>
bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callSpecialFunction1 bak
bak SpecialFunction (EmptyCtx ::> R)
W4.Cos) Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
args)

llvmCosOverride_F64 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType DoubleFloat)
     (FloatType DoubleFloat)
llvmCosOverride_F64 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType DoubleFloat) (FloatType DoubleFloat)
llvmCosOverride_F64 =
  [llvmOvr| double @llvm.cos.f64( double ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
args -> CurryAssignment
  (EmptyCtx ::> FloatType DoubleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat)))
-> Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> FloatType DoubleFloat) f x
-> Assignment f (EmptyCtx ::> FloatType DoubleFloat) -> x
Ctx.uncurryAssignment (bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(IsSymBackend sym bak, KnownRepr FloatInfoRepr fi) =>
bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callSpecialFunction1 bak
bak SpecialFunction (EmptyCtx ::> R)
W4.Cos) Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
args)

llvmPowOverride_F32 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType SingleFloat ::> FloatType SingleFloat)
     (FloatType SingleFloat)
llvmPowOverride_F32 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p
  sym
  ((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
  (FloatType SingleFloat)
llvmPowOverride_F32 =
  [llvmOvr| float @llvm.pow.f32( float, float ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment
  (RegEntry sym)
  ((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
args -> CurryAssignment
  ((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat)))
-> Assignment
     (RegEntry sym)
     ((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
  f
  x
-> Assignment
     f ((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
-> x
Ctx.uncurryAssignment (bak
-> SpecialFunction ((EmptyCtx ::> R) ::> R)
-> RegEntry sym (FloatType SingleFloat)
-> RegEntry sym (FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(IsSymBackend sym bak, KnownRepr FloatInfoRepr fi) =>
bak
-> SpecialFunction ((EmptyCtx ::> R) ::> R)
-> RegEntry sym (FloatType fi)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callSpecialFunction2 bak
bak SpecialFunction ((EmptyCtx ::> R) ::> R)
W4.Pow) Assignment
  (RegEntry sym)
  ((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
args)

llvmPowOverride_F64 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType DoubleFloat ::> FloatType DoubleFloat)
     (FloatType DoubleFloat)
llvmPowOverride_F64 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p
  sym
  ((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
  (FloatType DoubleFloat)
llvmPowOverride_F64 =
  [llvmOvr| double @llvm.pow.f64( double, double ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment
  (RegEntry sym)
  ((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
args -> CurryAssignment
  ((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat)))
-> Assignment
     (RegEntry sym)
     ((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
  f
  x
-> Assignment
     f ((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
-> x
Ctx.uncurryAssignment (bak
-> SpecialFunction ((EmptyCtx ::> R) ::> R)
-> RegEntry sym (FloatType DoubleFloat)
-> RegEntry sym (FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(IsSymBackend sym bak, KnownRepr FloatInfoRepr fi) =>
bak
-> SpecialFunction ((EmptyCtx ::> R) ::> R)
-> RegEntry sym (FloatType fi)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callSpecialFunction2 bak
bak SpecialFunction ((EmptyCtx ::> R) ::> R)
W4.Pow) Assignment
  (RegEntry sym)
  ((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
args)

llvmExpOverride_F32 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType SingleFloat)
     (FloatType SingleFloat)
llvmExpOverride_F32 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType SingleFloat) (FloatType SingleFloat)
llvmExpOverride_F32 =
  [llvmOvr| float @llvm.exp.f32( float ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
args -> CurryAssignment
  (EmptyCtx ::> FloatType SingleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat)))
-> Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> FloatType SingleFloat) f x
-> Assignment f (EmptyCtx ::> FloatType SingleFloat) -> x
Ctx.uncurryAssignment (bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(IsSymBackend sym bak, KnownRepr FloatInfoRepr fi) =>
bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callSpecialFunction1 bak
bak SpecialFunction (EmptyCtx ::> R)
W4.Exp) Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
args)

llvmExpOverride_F64 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType DoubleFloat)
     (FloatType DoubleFloat)
llvmExpOverride_F64 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType DoubleFloat) (FloatType DoubleFloat)
llvmExpOverride_F64 =
  [llvmOvr| double @llvm.exp.f64( double ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
args -> CurryAssignment
  (EmptyCtx ::> FloatType DoubleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat)))
-> Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> FloatType DoubleFloat) f x
-> Assignment f (EmptyCtx ::> FloatType DoubleFloat) -> x
Ctx.uncurryAssignment (bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(IsSymBackend sym bak, KnownRepr FloatInfoRepr fi) =>
bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callSpecialFunction1 bak
bak SpecialFunction (EmptyCtx ::> R)
W4.Exp) Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
args)

llvmLogOverride_F32 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType SingleFloat)
     (FloatType SingleFloat)
llvmLogOverride_F32 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType SingleFloat) (FloatType SingleFloat)
llvmLogOverride_F32 =
  [llvmOvr| float @llvm.log.f32( float ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
args -> CurryAssignment
  (EmptyCtx ::> FloatType SingleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat)))
-> Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> FloatType SingleFloat) f x
-> Assignment f (EmptyCtx ::> FloatType SingleFloat) -> x
Ctx.uncurryAssignment (bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(IsSymBackend sym bak, KnownRepr FloatInfoRepr fi) =>
bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callSpecialFunction1 bak
bak SpecialFunction (EmptyCtx ::> R)
W4.Log) Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
args)

llvmLogOverride_F64 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType DoubleFloat)
     (FloatType DoubleFloat)
llvmLogOverride_F64 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType DoubleFloat) (FloatType DoubleFloat)
llvmLogOverride_F64 =
  [llvmOvr| double @llvm.log.f64( double ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
args -> CurryAssignment
  (EmptyCtx ::> FloatType DoubleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat)))
-> Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> FloatType DoubleFloat) f x
-> Assignment f (EmptyCtx ::> FloatType DoubleFloat) -> x
Ctx.uncurryAssignment (bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(IsSymBackend sym bak, KnownRepr FloatInfoRepr fi) =>
bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callSpecialFunction1 bak
bak SpecialFunction (EmptyCtx ::> R)
W4.Log) Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
args)

llvmExp2Override_F32 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType SingleFloat)
     (FloatType SingleFloat)
llvmExp2Override_F32 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType SingleFloat) (FloatType SingleFloat)
llvmExp2Override_F32 =
  [llvmOvr| float @llvm.exp2.f32( float ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
args -> CurryAssignment
  (EmptyCtx ::> FloatType SingleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat)))
-> Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> FloatType SingleFloat) f x
-> Assignment f (EmptyCtx ::> FloatType SingleFloat) -> x
Ctx.uncurryAssignment (bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(IsSymBackend sym bak, KnownRepr FloatInfoRepr fi) =>
bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callSpecialFunction1 bak
bak SpecialFunction (EmptyCtx ::> R)
W4.Exp2) Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
args)

llvmExp2Override_F64 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType DoubleFloat)
     (FloatType DoubleFloat)
llvmExp2Override_F64 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType DoubleFloat) (FloatType DoubleFloat)
llvmExp2Override_F64 =
  [llvmOvr| double @llvm.exp2.f64( double ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
args -> CurryAssignment
  (EmptyCtx ::> FloatType DoubleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat)))
-> Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> FloatType DoubleFloat) f x
-> Assignment f (EmptyCtx ::> FloatType DoubleFloat) -> x
Ctx.uncurryAssignment (bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(IsSymBackend sym bak, KnownRepr FloatInfoRepr fi) =>
bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callSpecialFunction1 bak
bak SpecialFunction (EmptyCtx ::> R)
W4.Exp2) Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
args)

llvmLog2Override_F32 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType SingleFloat)
     (FloatType SingleFloat)
llvmLog2Override_F32 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType SingleFloat) (FloatType SingleFloat)
llvmLog2Override_F32 =
  [llvmOvr| float @llvm.log2.f32( float ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
args -> CurryAssignment
  (EmptyCtx ::> FloatType SingleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat)))
-> Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> FloatType SingleFloat) f x
-> Assignment f (EmptyCtx ::> FloatType SingleFloat) -> x
Ctx.uncurryAssignment (bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(IsSymBackend sym bak, KnownRepr FloatInfoRepr fi) =>
bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callSpecialFunction1 bak
bak SpecialFunction (EmptyCtx ::> R)
W4.Log2) Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
args)

llvmLog2Override_F64 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType DoubleFloat)
     (FloatType DoubleFloat)
llvmLog2Override_F64 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType DoubleFloat) (FloatType DoubleFloat)
llvmLog2Override_F64 =
  [llvmOvr| double @llvm.log2.f64( double ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
args -> CurryAssignment
  (EmptyCtx ::> FloatType DoubleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat)))
-> Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> FloatType DoubleFloat) f x
-> Assignment f (EmptyCtx ::> FloatType DoubleFloat) -> x
Ctx.uncurryAssignment (bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(IsSymBackend sym bak, KnownRepr FloatInfoRepr fi) =>
bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callSpecialFunction1 bak
bak SpecialFunction (EmptyCtx ::> R)
W4.Log2) Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
args)

llvmLog10Override_F32 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType SingleFloat)
     (FloatType SingleFloat)
llvmLog10Override_F32 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType SingleFloat) (FloatType SingleFloat)
llvmLog10Override_F32 =
  [llvmOvr| float @llvm.log10.f32( float ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
args -> CurryAssignment
  (EmptyCtx ::> FloatType SingleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat)))
-> Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> FloatType SingleFloat) f x
-> Assignment f (EmptyCtx ::> FloatType SingleFloat) -> x
Ctx.uncurryAssignment (bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(IsSymBackend sym bak, KnownRepr FloatInfoRepr fi) =>
bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callSpecialFunction1 bak
bak SpecialFunction (EmptyCtx ::> R)
W4.Log10) Assignment (RegEntry sym) (EmptyCtx ::> FloatType SingleFloat)
args)

llvmLog10Override_F64 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType DoubleFloat)
     (FloatType DoubleFloat)
llvmLog10Override_F64 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p sym (EmptyCtx ::> FloatType DoubleFloat) (FloatType DoubleFloat)
llvmLog10Override_F64 =
  [llvmOvr| double @llvm.log10.f64( double ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
args -> CurryAssignment
  (EmptyCtx ::> FloatType DoubleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat)))
-> Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment (EmptyCtx ::> FloatType DoubleFloat) f x
-> Assignment f (EmptyCtx ::> FloatType DoubleFloat) -> x
Ctx.uncurryAssignment (bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(IsSymBackend sym bak, KnownRepr FloatInfoRepr fi) =>
bak
-> SpecialFunction (EmptyCtx ::> R)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callSpecialFunction1 bak
bak SpecialFunction (EmptyCtx ::> R)
W4.Log10) Assignment (RegEntry sym) (EmptyCtx ::> FloatType DoubleFloat)
args)

llvmIsFpclassOverride_F32 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType SingleFloat
               ::> BVType 32)
     (BVType 1)
llvmIsFpclassOverride_F32 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p
  sym
  ((EmptyCtx ::> FloatType SingleFloat) ::> BVType 32)
  (BVType 1)
llvmIsFpclassOverride_F32 =
  [llvmOvr| i1 @llvm.is.fpclass.f32( float, i32 ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment
  (RegEntry sym) ((EmptyCtx ::> FloatType SingleFloat) ::> BVType 32)
args -> CurryAssignment
  ((EmptyCtx ::> FloatType SingleFloat) ::> BVType 32)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 1)))
-> Assignment
     (RegEntry sym) ((EmptyCtx ::> FloatType SingleFloat) ::> BVType 32)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 1))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((EmptyCtx ::> FloatType SingleFloat) ::> BVType 32) f x
-> Assignment
     f ((EmptyCtx ::> FloatType SingleFloat) ::> BVType 32)
-> x
Ctx.uncurryAssignment (bak
-> RegEntry sym (FloatType SingleFloat)
-> RegEntry sym (BVType 32)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 1))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
IsSymBackend sym bak =>
bak
-> RegEntry sym (FloatType fi)
-> RegEntry sym (BVType 32)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType 1))
callIsFpclass bak
bak) Assignment
  (RegEntry sym) ((EmptyCtx ::> FloatType SingleFloat) ::> BVType 32)
args)

llvmIsFpclassOverride_F64 ::
  IsSymInterface sym =>
  LLVMOverride p sym
     (EmptyCtx ::> FloatType DoubleFloat
               ::> BVType 32)
     (BVType 1)
llvmIsFpclassOverride_F64 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p
  sym
  ((EmptyCtx ::> FloatType DoubleFloat) ::> BVType 32)
  (BVType 1)
llvmIsFpclassOverride_F64 =
  [llvmOvr| i1 @llvm.is.fpclass.f64( double, i32 ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment
  (RegEntry sym) ((EmptyCtx ::> FloatType DoubleFloat) ::> BVType 32)
args -> CurryAssignment
  ((EmptyCtx ::> FloatType DoubleFloat) ::> BVType 32)
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 1)))
-> Assignment
     (RegEntry sym) ((EmptyCtx ::> FloatType DoubleFloat) ::> BVType 32)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 1))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((EmptyCtx ::> FloatType DoubleFloat) ::> BVType 32) f x
-> Assignment
     f ((EmptyCtx ::> FloatType DoubleFloat) ::> BVType 32)
-> x
Ctx.uncurryAssignment (bak
-> RegEntry sym (FloatType DoubleFloat)
-> RegEntry sym (BVType 32)
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym (BVType 1))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
IsSymBackend sym bak =>
bak
-> RegEntry sym (FloatType fi)
-> RegEntry sym (BVType 32)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType 1))
callIsFpclass bak
bak) Assignment
  (RegEntry sym) ((EmptyCtx ::> FloatType DoubleFloat) ::> BVType 32)
args)

llvmFmaOverride_F32 ::
     forall sym p
   . IsSymInterface sym
  => LLVMOverride p sym
        (EmptyCtx ::> FloatType SingleFloat
                  ::> FloatType SingleFloat
                  ::> FloatType SingleFloat)
        (FloatType SingleFloat)
llvmFmaOverride_F32 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p
  sym
  (((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
   ::> FloatType SingleFloat)
  (FloatType SingleFloat)
llvmFmaOverride_F32 =
  [llvmOvr| float @llvm.fma.f32( float, float, float ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment
  (RegEntry sym)
  (((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
   ::> FloatType SingleFloat)
args -> CurryAssignment
  (((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
   ::> FloatType SingleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat)))
-> Assignment
     (RegEntry sym)
     (((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
      ::> FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  (((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
   ::> FloatType SingleFloat)
  f
  x
-> Assignment
     f
     (((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
      ::> FloatType SingleFloat)
-> x
Ctx.uncurryAssignment (bak
-> RegEntry sym (FloatType SingleFloat)
-> RegEntry sym (FloatType SingleFloat)
-> RegEntry sym (FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
IsSymBackend sym bak =>
bak
-> RegEntry sym (FloatType fi)
-> RegEntry sym (FloatType fi)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callFMA bak
bak) Assignment
  (RegEntry sym)
  (((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
   ::> FloatType SingleFloat)
args)

llvmFmaOverride_F64 ::
     forall sym p
   . IsSymInterface sym
  => LLVMOverride p sym
        (EmptyCtx ::> FloatType DoubleFloat
                  ::> FloatType DoubleFloat
                  ::> FloatType DoubleFloat)
        (FloatType DoubleFloat)
llvmFmaOverride_F64 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p
  sym
  (((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
   ::> FloatType DoubleFloat)
  (FloatType DoubleFloat)
llvmFmaOverride_F64 =
  [llvmOvr| double @llvm.fma.f64( double, double, double ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment
  (RegEntry sym)
  (((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
   ::> FloatType DoubleFloat)
args -> CurryAssignment
  (((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
   ::> FloatType DoubleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat)))
-> Assignment
     (RegEntry sym)
     (((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
      ::> FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  (((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
   ::> FloatType DoubleFloat)
  f
  x
-> Assignment
     f
     (((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
      ::> FloatType DoubleFloat)
-> x
Ctx.uncurryAssignment (bak
-> RegEntry sym (FloatType DoubleFloat)
-> RegEntry sym (FloatType DoubleFloat)
-> RegEntry sym (FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
IsSymBackend sym bak =>
bak
-> RegEntry sym (FloatType fi)
-> RegEntry sym (FloatType fi)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callFMA bak
bak) Assignment
  (RegEntry sym)
  (((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
   ::> FloatType DoubleFloat)
args)

llvmFmuladdOverride_F32 ::
     forall sym p
   . IsSymInterface sym
  => LLVMOverride p sym
        (EmptyCtx ::> FloatType SingleFloat
                  ::> FloatType SingleFloat
                  ::> FloatType SingleFloat)
        (FloatType SingleFloat)
llvmFmuladdOverride_F32 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p
  sym
  (((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
   ::> FloatType SingleFloat)
  (FloatType SingleFloat)
llvmFmuladdOverride_F32 =
  [llvmOvr| float @llvm.fmuladd.f32( float, float, float ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment
  (RegEntry sym)
  (((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
   ::> FloatType SingleFloat)
args -> CurryAssignment
  (((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
   ::> FloatType SingleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat)))
-> Assignment
     (RegEntry sym)
     (((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
      ::> FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  (((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
   ::> FloatType SingleFloat)
  f
  x
-> Assignment
     f
     (((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
      ::> FloatType SingleFloat)
-> x
Ctx.uncurryAssignment (bak
-> RegEntry sym (FloatType SingleFloat)
-> RegEntry sym (FloatType SingleFloat)
-> RegEntry sym (FloatType SingleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType SingleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
IsSymBackend sym bak =>
bak
-> RegEntry sym (FloatType fi)
-> RegEntry sym (FloatType fi)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callFMA bak
bak) Assignment
  (RegEntry sym)
  (((EmptyCtx ::> FloatType SingleFloat) ::> FloatType SingleFloat)
   ::> FloatType SingleFloat)
args)

llvmFmuladdOverride_F64 ::
     forall sym p
   . IsSymInterface sym
  => LLVMOverride p sym
        (EmptyCtx ::> FloatType DoubleFloat
                  ::> FloatType DoubleFloat
                  ::> FloatType DoubleFloat)
        (FloatType DoubleFloat)
llvmFmuladdOverride_F64 :: forall sym p.
IsSymInterface sym =>
LLVMOverride
  p
  sym
  (((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
   ::> FloatType DoubleFloat)
  (FloatType DoubleFloat)
llvmFmuladdOverride_F64 =
  [llvmOvr| double @llvm.fmuladd.f64( double, double, double ) |]
  (\GlobalVar Mem
_memOps bak
bak Assignment
  (RegEntry sym)
  (((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
   ::> FloatType DoubleFloat)
args -> CurryAssignment
  (((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
   ::> FloatType DoubleFloat)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat)))
-> Assignment
     (RegEntry sym)
     (((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
      ::> FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  (((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
   ::> FloatType DoubleFloat)
  f
  x
-> Assignment
     f
     (((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
      ::> FloatType DoubleFloat)
-> x
Ctx.uncurryAssignment (bak
-> RegEntry sym (FloatType DoubleFloat)
-> RegEntry sym (FloatType DoubleFloat)
-> RegEntry sym (FloatType DoubleFloat)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (FloatType DoubleFloat))
forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
IsSymBackend sym bak =>
bak
-> RegEntry sym (FloatType fi)
-> RegEntry sym (FloatType fi)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
Libc.callFMA bak
bak) Assignment
  (RegEntry sym)
  (((EmptyCtx ::> FloatType DoubleFloat) ::> FloatType DoubleFloat)
   ::> FloatType DoubleFloat)
args)


llvmX86_pclmulqdq
--declare <2 x i64> @llvm.x86.pclmulqdq(<2 x i64>, <2 x i64>, i8) #1
  :: (IsSymInterface sym, HasPtrWidth wptr)
  => LLVMOverride p sym
         (EmptyCtx ::> VectorType (BVType 64)
                   ::> VectorType (BVType 64)
                   ::> BVType 8)
         (VectorType (BVType 64))
llvmX86_pclmulqdq :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasPtrWidth wptr) =>
LLVMOverride
  p
  sym
  (((EmptyCtx ::> VectorType (BVType 64)) ::> VectorType (BVType 64))
   ::> BVType 8)
  (VectorType (BVType 64))
llvmX86_pclmulqdq =
  [llvmOvr| <2 x i64> @llvm.x86.pclmulqdq(<2 x i64>, <2 x i64>, i8) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  (((EmptyCtx ::> VectorType (BVType 64)) ::> VectorType (BVType 64))
   ::> BVType 8)
args -> CurryAssignment
  (((EmptyCtx ::> VectorType (BVType 64)) ::> VectorType (BVType 64))
   ::> BVType 8)
  (RegEntry sym)
  (OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (VectorType (BVType 64))))
-> Assignment
     (RegEntry sym)
     (((EmptyCtx ::> VectorType (BVType 64)) ::> VectorType (BVType 64))
      ::> BVType 8)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (VectorType (BVType 64)))
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  (((EmptyCtx ::> VectorType (BVType 64)) ::> VectorType (BVType 64))
   ::> BVType 8)
  f
  x
-> Assignment
     f
     (((EmptyCtx ::> VectorType (BVType 64)) ::> VectorType (BVType 64))
      ::> BVType 8)
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (VectorType (BVType 64))
-> RegEntry sym (VectorType (BVType 64))
-> RegEntry sym (BVType 8)
-> OverrideSim
     p sym LLVM rtp args' ret' (RegValue sym (VectorType (BVType 64)))
forall p sym bak ext (wptr :: Natural) r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(IsSymBackend sym bak, HasPtrWidth wptr) =>
bak
-> GlobalVar Mem
-> RegEntry sym (VectorType (BVType 64))
-> RegEntry sym (VectorType (BVType 64))
-> RegEntry sym (BVType 8)
-> OverrideSim
     p sym ext r args ret (RegValue sym (VectorType (BVType 64)))
callX86_pclmulqdq bak
bak GlobalVar Mem
memOps) Assignment
  (RegEntry sym)
  (((EmptyCtx ::> VectorType (BVType 64)) ::> VectorType (BVType 64))
   ::> BVType 8)
args)


llvmX86_SSE2_storeu_dq
  :: ( IsSymInterface sym
     , HasLLVMAnn sym
     , HasPtrWidth wptr
     , ?memOpts :: MemOptions )
  => LLVMOverride p sym
         (EmptyCtx ::> LLVMPointerType wptr
                   ::> VectorType (BVType 8))
         UnitType
llvmX86_SSE2_storeu_dq :: forall sym (wptr :: Natural) p.
(IsSymInterface sym, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
LLVMOverride
  p
  sym
  ((EmptyCtx ::> LLVMPointerType wptr) ::> VectorType (BVType 8))
  UnitType
llvmX86_SSE2_storeu_dq =
  [llvmOvr| void @llvm.x86.sse2.storeu.dq( i8*, <16 x i8> ) |]
  (\GlobalVar Mem
memOps bak
bak Assignment
  (RegEntry sym)
  ((EmptyCtx ::> LLVMPointerType wptr) ::> VectorType (BVType 8))
args -> CurryAssignment
  ((EmptyCtx ::> LLVMPointerType wptr) ::> VectorType (BVType 8))
  (RegEntry sym)
  (OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType))
-> Assignment
     (RegEntry sym)
     ((EmptyCtx ::> LLVMPointerType wptr) ::> VectorType (BVType 8))
-> OverrideSim p sym LLVM rtp args' ret' (RegValue sym UnitType)
forall k (ctx :: Ctx k) (f :: k -> Type) x.
CurryAssignmentClass ctx =>
CurryAssignment ctx f x -> Assignment f ctx -> x
forall (f :: CrucibleType -> Type) x.
CurryAssignment
  ((EmptyCtx ::> LLVMPointerType wptr) ::> VectorType (BVType 8)) f x
-> Assignment
     f ((EmptyCtx ::> LLVMPointerType wptr) ::> VectorType (BVType 8))
-> x
Ctx.uncurryAssignment (bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (VectorType (BVType 8))
-> OverrideSim p sym LLVM rtp args' ret' ()
forall sym bak (wptr :: Natural) p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(IsSymBackend sym bak, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (VectorType (BVType 8))
-> OverrideSim p sym ext r args ret ()
callStoreudq bak
bak GlobalVar Mem
memOps) Assignment
  (RegEntry sym)
  ((EmptyCtx ::> LLVMPointerType wptr) ::> VectorType (BVType 8))
args)

------------------------------------------------------------------------
-- ** Implementations

callX86_pclmulqdq :: forall p sym bak ext wptr r args ret.
  (IsSymBackend sym bak, HasPtrWidth wptr) =>
  bak ->
  GlobalVar Mem ->
  RegEntry sym (VectorType (BVType 64)) ->
  RegEntry sym (VectorType (BVType 64)) ->
  RegEntry sym (BVType 8) ->
  OverrideSim p sym ext r args ret (RegValue sym (VectorType (BVType 64)))
callX86_pclmulqdq :: forall p sym bak ext (wptr :: Natural) r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(IsSymBackend sym bak, HasPtrWidth wptr) =>
bak
-> GlobalVar Mem
-> RegEntry sym (VectorType (BVType 64))
-> RegEntry sym (VectorType (BVType 64))
-> RegEntry sym (BVType 8)
-> OverrideSim
     p sym ext r args ret (RegValue sym (VectorType (BVType 64)))
callX86_pclmulqdq bak
bak GlobalVar Mem
_mvar
  (RegEntry sym (VectorType (BVType 64))
-> RegValue sym (VectorType (BVType 64))
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (VectorType (BVType 64))
xs)
  (RegEntry sym (VectorType (BVType 64))
-> RegValue sym (VectorType (BVType 64))
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (VectorType (BVType 64))
ys)
  (RegEntry sym (BVType 8) -> RegValue sym (BVType 8)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType 8)
imm) =
    do Bool
-> OverrideSim p sym ext r args ret ()
-> OverrideSim p sym ext r args ret ()
forall (f :: Type -> Type). Applicative f => Bool -> f () -> f ()
unless (Vector (SymExpr sym ('BaseBVType 64)) -> Int
forall a. Vector a -> Int
V.length Vector (SymExpr sym ('BaseBVType 64))
RegValue sym (VectorType (BVType 64))
xs Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
2) (OverrideSim p sym ext r args ret ()
 -> OverrideSim p sym ext r args ret ())
-> OverrideSim p sym ext r args ret ()
-> OverrideSim p sym ext r args ret ()
forall a b. (a -> b) -> a -> b
$
          IO () -> OverrideSim p sym ext r args ret ()
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO () -> OverrideSim p sym ext r args ret ())
-> IO () -> OverrideSim p sym ext r args ret ()
forall a b. (a -> b) -> a -> b
$ bak -> SimErrorReason -> IO ()
forall sym bak a.
IsSymBackend sym bak =>
bak -> SimErrorReason -> IO a
addFailedAssertion bak
bak (SimErrorReason -> IO ()) -> SimErrorReason -> IO ()
forall a b. (a -> b) -> a -> b
$ String -> String -> SimErrorReason
AssertFailureSimError
           (String
"Vector length mismatch in llvm.x86.pclmulqdq intrinsic")
           ([String] -> String
unwords [String
"Expected <2 x i64>, but got vector of length", Int -> String
forall a. Show a => a -> String
show (Vector (SymExpr sym ('BaseBVType 64)) -> Int
forall a. Vector a -> Int
V.length Vector (SymExpr sym ('BaseBVType 64))
RegValue sym (VectorType (BVType 64))
xs)])
       Bool
-> OverrideSim p sym ext r args ret ()
-> OverrideSim p sym ext r args ret ()
forall (f :: Type -> Type). Applicative f => Bool -> f () -> f ()
unless (Vector (SymExpr sym ('BaseBVType 64)) -> Int
forall a. Vector a -> Int
V.length Vector (SymExpr sym ('BaseBVType 64))
RegValue sym (VectorType (BVType 64))
ys Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
2) (OverrideSim p sym ext r args ret ()
 -> OverrideSim p sym ext r args ret ())
-> OverrideSim p sym ext r args ret ()
-> OverrideSim p sym ext r args ret ()
forall a b. (a -> b) -> a -> b
$
          IO () -> OverrideSim p sym ext r args ret ()
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO () -> OverrideSim p sym ext r args ret ())
-> IO () -> OverrideSim p sym ext r args ret ()
forall a b. (a -> b) -> a -> b
$ bak -> SimErrorReason -> IO ()
forall sym bak a.
IsSymBackend sym bak =>
bak -> SimErrorReason -> IO a
addFailedAssertion bak
bak (SimErrorReason -> IO ()) -> SimErrorReason -> IO ()
forall a b. (a -> b) -> a -> b
$ String -> String -> SimErrorReason
AssertFailureSimError
           (String
"Vector length mismatch in llvm.x86.pclmulqdq intrinsic")
           ([String] -> String
unwords [String
"Expected <2 x i64>, but got vector of length", Int -> String
forall a. Show a => a -> String
show (Vector (SymExpr sym ('BaseBVType 64)) -> Int
forall a. Vector a -> Int
V.length Vector (SymExpr sym ('BaseBVType 64))
RegValue sym (VectorType (BVType 64))
ys)])
       case BV 8 -> Integer
forall (w :: Natural). BV w -> Integer
BV.asUnsigned (BV 8 -> Integer) -> Maybe (BV 8) -> Maybe Integer
forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
<$> SymExpr sym (BaseBVType 8) -> Maybe (BV 8)
forall (w :: Natural). SymExpr sym (BaseBVType w) -> Maybe (BV w)
forall (e :: BaseType -> Type) (w :: Natural).
IsExpr e =>
e (BaseBVType w) -> Maybe (BV w)
asBV RegValue sym (BVType 8)
SymExpr sym (BaseBVType 8)
imm of
         Just Integer
byte ->
           do let xidx :: Int
xidx = if Integer
byte Integer -> Integer -> Integer
forall a. Bits a => a -> a -> a
.&. Integer
0x01 Integer -> Integer -> Bool
forall a. Eq a => a -> a -> Bool
== Integer
0 then Int
0 else Int
1
              let yidx :: Int
yidx = if Integer
byte Integer -> Integer -> Integer
forall a. Bits a => a -> a -> a
.&. Integer
0x10 Integer -> Integer -> Bool
forall a. Eq a => a -> a -> Bool
== Integer
0 then Int
0 else Int
1
              IO (Vector (SymExpr sym ('BaseBVType 64)))
-> OverrideSim
     p sym ext r args ret (Vector (SymExpr sym ('BaseBVType 64)))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (Vector (SymExpr sym ('BaseBVType 64)))
 -> OverrideSim
      p sym ext r args ret (Vector (SymExpr sym ('BaseBVType 64))))
-> IO (Vector (SymExpr sym ('BaseBVType 64)))
-> OverrideSim
     p sym ext r args ret (Vector (SymExpr sym ('BaseBVType 64)))
forall a b. (a -> b) -> a -> b
$ SymExpr sym ('BaseBVType 64)
-> SymExpr sym ('BaseBVType 64)
-> IO (Vector (SymExpr sym ('BaseBVType 64)))
doPcmul (Vector (SymExpr sym ('BaseBVType 64))
RegValue sym (VectorType (BVType 64))
xs Vector (SymExpr sym ('BaseBVType 64))
-> Int -> SymExpr sym ('BaseBVType 64)
forall a. Vector a -> Int -> a
V.! Int
xidx) (Vector (SymExpr sym ('BaseBVType 64))
RegValue sym (VectorType (BVType 64))
ys Vector (SymExpr sym ('BaseBVType 64))
-> Int -> SymExpr sym ('BaseBVType 64)
forall a. Vector a -> Int -> a
V.! Int
yidx)
         Maybe Integer
_ ->
             IO (Vector (SymExpr sym ('BaseBVType 64)))
-> OverrideSim
     p sym ext r args ret (Vector (SymExpr sym ('BaseBVType 64)))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (Vector (SymExpr sym ('BaseBVType 64)))
 -> OverrideSim
      p sym ext r args ret (Vector (SymExpr sym ('BaseBVType 64))))
-> IO (Vector (SymExpr sym ('BaseBVType 64)))
-> OverrideSim
     p sym ext r args ret (Vector (SymExpr sym ('BaseBVType 64)))
forall a b. (a -> b) -> a -> b
$ bak -> SimErrorReason -> IO (Vector (SymExpr sym ('BaseBVType 64)))
forall sym bak a.
IsSymBackend sym bak =>
bak -> SimErrorReason -> IO a
addFailedAssertion bak
bak (SimErrorReason -> IO (Vector (SymExpr sym ('BaseBVType 64))))
-> SimErrorReason -> IO (Vector (SymExpr sym ('BaseBVType 64)))
forall a b. (a -> b) -> a -> b
$ String -> String -> SimErrorReason
AssertFailureSimError
                (String
"Illegal selector argument to llvm.x86.pclmulqdq")
                ([String] -> String
unwords [String
"Expected concrete value but got", Doc Any -> String
forall a. Show a => a -> String
show (SymExpr sym (BaseBVType 8) -> Doc Any
forall (tp :: BaseType) ann. SymExpr sym tp -> Doc ann
forall (e :: BaseType -> Type) (tp :: BaseType) ann.
IsExpr e =>
e tp -> Doc ann
printSymExpr RegValue sym (BVType 8)
SymExpr sym (BaseBVType 8)
imm)])
  where
  sym :: sym
sym = bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak

  doPcmul :: SymBV sym 64 -> SymBV sym 64 -> IO (V.Vector (SymBV sym 64))
  doPcmul :: SymExpr sym ('BaseBVType 64)
-> SymExpr sym ('BaseBVType 64)
-> IO (Vector (SymExpr sym ('BaseBVType 64)))
doPcmul SymExpr sym ('BaseBVType 64)
x SymExpr sym ('BaseBVType 64)
y =
    do SymExpr sym (BaseBVType (64 + 64))
r <- sym
-> SymExpr sym ('BaseBVType 64)
-> SymExpr sym ('BaseBVType 64)
-> IO (SymExpr sym (BaseBVType (64 + 64)))
forall (w :: Natural).
(1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym (w + w))
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym (w + w))
carrylessMultiply sym
sym SymExpr sym ('BaseBVType 64)
x SymExpr sym ('BaseBVType 64)
y
       SymExpr sym ('BaseBVType 64)
lo <- sym
-> NatRepr 64 -> SymBV sym 128 -> IO (SymExpr sym ('BaseBVType 64))
forall (r :: Natural) (w :: Natural).
(1 <= r, (r + 1) <= w) =>
sym -> NatRepr r -> SymBV sym w -> IO (SymBV sym r)
forall sym (r :: Natural) (w :: Natural).
(IsExprBuilder sym, 1 <= r, (r + 1) <= w) =>
sym -> NatRepr r -> SymBV sym w -> IO (SymBV sym r)
bvTrunc sym
sym (forall (n :: Natural). KnownNat n => NatRepr n
knownNat @64) SymBV sym 128
SymExpr sym (BaseBVType (64 + 64))
r
       SymExpr sym ('BaseBVType 64)
hi <- sym
-> NatRepr 64
-> NatRepr 64
-> SymBV sym 128
-> IO (SymExpr sym ('BaseBVType 64))
forall (idx :: Natural) (n :: Natural) (w :: Natural).
(1 <= n, (idx + n) <= w) =>
sym -> NatRepr idx -> NatRepr n -> SymBV sym w -> IO (SymBV sym n)
forall sym (idx :: Natural) (n :: Natural) (w :: Natural).
(IsExprBuilder sym, 1 <= n, (idx + n) <= w) =>
sym -> NatRepr idx -> NatRepr n -> SymBV sym w -> IO (SymBV sym n)
bvSelect sym
sym (forall (n :: Natural). KnownNat n => NatRepr n
knownNat @64) (forall (n :: Natural). KnownNat n => NatRepr n
knownNat @64) SymBV sym 128
SymExpr sym (BaseBVType (64 + 64))
r
       -- NB, little endian because X86
       Vector (SymExpr sym ('BaseBVType 64))
-> IO (Vector (SymExpr sym ('BaseBVType 64)))
forall a. a -> IO a
forall (m :: Type -> Type) a. Monad m => a -> m a
return (Vector (SymExpr sym ('BaseBVType 64))
 -> IO (Vector (SymExpr sym ('BaseBVType 64))))
-> Vector (SymExpr sym ('BaseBVType 64))
-> IO (Vector (SymExpr sym ('BaseBVType 64)))
forall a b. (a -> b) -> a -> b
$ [SymExpr sym ('BaseBVType 64)]
-> Vector (SymExpr sym ('BaseBVType 64))
forall a. [a] -> Vector a
V.fromList [ SymExpr sym ('BaseBVType 64)
lo, SymExpr sym ('BaseBVType 64)
hi ]

callStoreudq
  :: ( IsSymBackend sym bak
     , HasLLVMAnn sym
     , HasPtrWidth wptr
     , ?memOpts :: MemOptions )
  => bak
  -> GlobalVar Mem
  -> RegEntry sym (LLVMPointerType wptr)
  -> RegEntry sym (VectorType (BVType 8))
  -> OverrideSim p sym ext r args ret ()
callStoreudq :: forall sym bak (wptr :: Natural) p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(IsSymBackend sym bak, HasLLVMAnn sym, HasPtrWidth wptr,
 ?memOpts::MemOptions) =>
bak
-> GlobalVar Mem
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (VectorType (BVType 8))
-> OverrideSim p sym ext r args ret ()
callStoreudq bak
bak GlobalVar Mem
mvar
  (RegEntry sym (LLVMPointerType wptr)
-> RegValue sym (LLVMPointerType wptr)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (LLVMPointerType wptr)
dest)
  (RegEntry sym (VectorType (BVType 8))
-> RegValue sym (VectorType (BVType 8))
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (VectorType (BVType 8))
vec) =
    do MemImpl sym
mem <- GlobalVar Mem
-> OverrideSim p sym ext r args ret (RegValue sym Mem)
forall sym (tp :: CrucibleType) p ext rtp
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
IsSymInterface sym =>
GlobalVar tp
-> OverrideSim p sym ext rtp args ret (RegValue sym tp)
readGlobal GlobalVar Mem
mvar
       Bool
-> OverrideSim p sym ext r args ret ()
-> OverrideSim p sym ext r args ret ()
forall (f :: Type -> Type). Applicative f => Bool -> f () -> f ()
unless (Vector (SymExpr sym (BaseBVType 8)) -> Int
forall a. Vector a -> Int
V.length Vector (SymExpr sym (BaseBVType 8))
RegValue sym (VectorType (BVType 8))
vec Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
16) (OverrideSim p sym ext r args ret ()
 -> OverrideSim p sym ext r args ret ())
-> OverrideSim p sym ext r args ret ()
-> OverrideSim p sym ext r args ret ()
forall a b. (a -> b) -> a -> b
$
          IO () -> OverrideSim p sym ext r args ret ()
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO () -> OverrideSim p sym ext r args ret ())
-> IO () -> OverrideSim p sym ext r args ret ()
forall a b. (a -> b) -> a -> b
$ bak -> SimErrorReason -> IO ()
forall sym bak a.
IsSymBackend sym bak =>
bak -> SimErrorReason -> IO a
addFailedAssertion bak
bak (SimErrorReason -> IO ()) -> SimErrorReason -> IO ()
forall a b. (a -> b) -> a -> b
$ String -> String -> SimErrorReason
AssertFailureSimError
           (String
"Vector length mismatch in stored_qu intrinsic.")
           ([String] -> String
unwords [String
"Expected <16 x i8>, but got vector of length", Int -> String
forall a. Show a => a -> String
show (Vector (SymExpr sym (BaseBVType 8)) -> Int
forall a. Vector a -> Int
V.length Vector (SymExpr sym (BaseBVType 8))
RegValue sym (VectorType (BVType 8))
vec)])
       MemImpl sym
mem' <- IO (MemImpl sym) -> OverrideSim p sym ext r args ret (MemImpl sym)
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (MemImpl sym)
 -> OverrideSim p sym ext r args ret (MemImpl sym))
-> IO (MemImpl sym)
-> OverrideSim p sym ext r args ret (MemImpl sym)
forall a b. (a -> b) -> a -> b
$ bak
-> MemImpl sym
-> RegValue sym (LLVMPointerType wptr)
-> TypeRepr (VectorType (BVType 8))
-> StorageType
-> Alignment
-> RegValue sym (VectorType (BVType 8))
-> IO (MemImpl sym)
forall sym bak (wptr :: Natural) (tp :: CrucibleType).
(IsSymBackend sym bak, HasPtrWidth wptr, HasLLVMAnn sym,
 ?memOpts::MemOptions) =>
bak
-> MemImpl sym
-> LLVMPtr sym wptr
-> TypeRepr tp
-> StorageType
-> Alignment
-> RegValue sym tp
-> IO (MemImpl sym)
doStore
                 bak
bak
                 MemImpl sym
mem
                 RegValue sym (LLVMPointerType wptr)
dest
                 (TypeRepr (BVType 8) -> TypeRepr (VectorType (BVType 8))
forall (tp1 :: CrucibleType).
TypeRepr tp1 -> TypeRepr ('VectorType tp1)
VectorRepr (forall (n :: Natural). (1 <= n, KnownNat n) => TypeRepr (BVType n)
KnownBV @8))
                 (Natural -> StorageType -> StorageType
arrayType Natural
16 (Bytes -> StorageType
bitvectorType (Integer -> Bytes
Bytes Integer
1)))
                 Alignment
noAlignment
                 RegValue sym (VectorType (BVType 8))
vec
       GlobalVar Mem
-> RegValue sym Mem -> OverrideSim p sym ext r args ret ()
forall (tp :: CrucibleType) sym p ext rtp
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
GlobalVar tp
-> RegValue sym tp -> OverrideSim p sym ext rtp args ret ()
writeGlobal GlobalVar Mem
mvar RegValue sym Mem
MemImpl sym
mem'


-- Excerpt from the LLVM documentation:
--
-- The llvm.objectsize intrinsic is designed to provide information to
-- the optimizers to determine at compile time whether a) an operation
-- (like memcpy) will overflow a buffer that corresponds to an object,
-- or b) that a runtime check for overflow isn’t necessary. An object
-- in this context means an allocation of a specific class, structure,
-- array, or other object.
--
-- The llvm.objectsize intrinsic takes two arguments. The first
-- argument is a pointer to or into the object. The second argument is
-- a boolean and determines whether llvm.objectsize returns 0 (if
-- true) or -1 (if false) when the object size is unknown. The second
-- argument only accepts constants.
--
-- The llvm.objectsize intrinsic is lowered to a constant representing
-- the size of the object concerned. If the size cannot be determined
-- at compile time, llvm.objectsize returns i32/i64 -1 or 0 (depending
-- on the min argument).
callObjectsize
  :: (1 <= w, IsSymBackend sym bak)
  => bak
  -> GlobalVar Mem
  -> NatRepr w
  -> RegEntry sym (LLVMPointerType wptr)
  -> RegEntry sym (BVType 1)
  -> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callObjectsize :: forall (w :: Natural) sym bak (wptr :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> NatRepr w
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callObjectsize bak
bak GlobalVar Mem
_mvar NatRepr w
w
  (RegEntry sym (LLVMPointerType wptr)
-> RegValue sym (LLVMPointerType wptr)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (LLVMPointerType wptr)
_ptr)
  (RegEntry sym (BVType 1) -> RegValue sym (BVType 1)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType 1)
flag) = IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (RegValue sym (BVType w))
 -> OverrideSim p sym ext r args ret (RegValue sym (BVType w)))
-> IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a b. (a -> b) -> a -> b
$ do
    let sym :: sym
sym = bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak
    -- Ignore the pointer value, and just return the value for unknown, as
    -- defined by the documenatation.  If an `objectsize` invocation survives
    -- through compilation for us to see, that means the compiler could not
    -- determine the value.
    SymExpr sym BaseBoolType
t <- sym -> SymBV sym 1 -> IO (SymExpr sym BaseBoolType)
forall (w :: Natural).
(1 <= w) =>
sym -> SymBV sym w -> IO (SymExpr sym BaseBoolType)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> IO (Pred sym)
bvIsNonzero sym
sym RegValue sym (BVType 1)
SymBV sym 1
flag
    SymExpr sym (BaseBVType w)
z <- sym -> NatRepr w -> BV w -> IO (SymExpr sym (BaseBVType w))
forall (w :: Natural).
(1 <= w) =>
sym -> NatRepr w -> BV w -> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> NatRepr w -> BV w -> IO (SymBV sym w)
bvLit sym
sym NatRepr w
w (NatRepr w -> BV w
forall (w :: Natural). NatRepr w -> BV w
BV.zero NatRepr w
w)
    SymExpr sym (BaseBVType w)
n <- sym
-> SymExpr sym (BaseBVType w) -> IO (SymExpr sym (BaseBVType w))
forall (w :: Natural).
(1 <= w) =>
sym -> SymBV sym w -> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> IO (SymBV sym w)
bvNotBits sym
sym SymExpr sym (BaseBVType w)
z -- NB: -1 is the boolean negation of zero
    sym
-> SymExpr sym BaseBoolType
-> SymExpr sym (BaseBVType w)
-> SymExpr sym (BaseBVType w)
-> IO (SymExpr sym (BaseBVType w))
forall (w :: Natural).
(1 <= w) =>
sym
-> SymExpr sym BaseBoolType
-> SymBV sym w
-> SymBV sym w
-> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> Pred sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
bvIte sym
sym SymExpr sym BaseBoolType
t SymExpr sym (BaseBVType w)
z SymExpr sym (BaseBVType w)
n

callObjectsize_null
  :: (1 <= w, IsSymBackend sym bak)
  => bak
  -> GlobalVar Mem
  -> NatRepr w
  -> RegEntry sym (LLVMPointerType wptr)
  -> RegEntry sym (BVType 1)
  -> RegEntry sym (BVType 1)
  -> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callObjectsize_null :: forall (w :: Natural) sym bak (wptr :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> NatRepr w
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callObjectsize_null bak
bak GlobalVar Mem
mvar NatRepr w
w RegEntry sym (LLVMPointerType wptr)
ptr RegEntry sym (BVType 1)
flag RegEntry sym (BVType 1)
_nullUnknown = bak
-> GlobalVar Mem
-> NatRepr w
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall (w :: Natural) sym bak (wptr :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> NatRepr w
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callObjectsize bak
bak GlobalVar Mem
mvar NatRepr w
w RegEntry sym (LLVMPointerType wptr)
ptr RegEntry sym (BVType 1)
flag

callObjectsize_null_dynamic
  :: (1 <= w, IsSymBackend sym bak)
  => bak
  -> GlobalVar Mem
  -> NatRepr w
  -> RegEntry sym (LLVMPointerType wptr)
  -> RegEntry sym (BVType 1)
  -> RegEntry sym (BVType 1)
  -> RegEntry sym (BVType 1)
  -> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callObjectsize_null_dynamic :: forall (w :: Natural) sym bak (wptr :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> NatRepr w
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callObjectsize_null_dynamic bak
bak GlobalVar Mem
mvar NatRepr w
w RegEntry sym (LLVMPointerType wptr)
ptr RegEntry sym (BVType 1)
flag RegEntry sym (BVType 1)
_nullUnknown (RegEntry sym (BVType 1) -> RegValue sym (BVType 1)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType 1)
dynamic) =
  do let sym :: sym
sym = bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak
     IO () -> OverrideSim p sym ext r args ret ()
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO () -> OverrideSim p sym ext r args ret ())
-> IO () -> OverrideSim p sym ext r args ret ()
forall a b. (a -> b) -> a -> b
$
       do SymExpr sym BaseBoolType
notDynamic <- sym -> SymExpr sym BaseBoolType -> IO (SymExpr sym BaseBoolType)
forall sym. IsExprBuilder sym => sym -> Pred sym -> IO (Pred sym)
notPred sym
sym (SymExpr sym BaseBoolType -> IO (SymExpr sym BaseBoolType))
-> IO (SymExpr sym BaseBoolType) -> IO (SymExpr sym BaseBoolType)
forall (m :: Type -> Type) a b. Monad m => (a -> m b) -> m a -> m b
=<< sym -> SymBV sym 1 -> IO (SymExpr sym BaseBoolType)
forall (w :: Natural).
(1 <= w) =>
sym -> SymBV sym w -> IO (SymExpr sym BaseBoolType)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> IO (Pred sym)
bvIsNonzero sym
sym RegValue sym (BVType 1)
SymBV sym 1
dynamic
          bak -> SymExpr sym BaseBoolType -> SimErrorReason -> IO ()
forall sym bak.
IsSymBackend sym bak =>
bak -> Pred sym -> SimErrorReason -> IO ()
assert bak
bak SymExpr sym BaseBoolType
notDynamic (String -> String -> SimErrorReason
AssertFailureSimError String
"llvm.objectsize called with `dynamic` set to `true`" String
"")
     bak
-> GlobalVar Mem
-> NatRepr w
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall (w :: Natural) sym bak (wptr :: Natural) p ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> NatRepr w
-> RegEntry sym (LLVMPointerType wptr)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callObjectsize bak
bak GlobalVar Mem
mvar NatRepr w
w RegEntry sym (LLVMPointerType wptr)
ptr RegEntry sym (BVType 1)
flag

callCtlz
  :: (1 <= w, IsSymBackend sym bak)
  => bak
  -> GlobalVar Mem
  -> RegEntry sym (BVType w)
  -> RegEntry sym (BVType 1)
  -> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callCtlz :: forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callCtlz bak
bak GlobalVar Mem
_mvar
  (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
val)
  (RegEntry sym (BVType 1) -> RegValue sym (BVType 1)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType 1)
isZeroUndef) = IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (RegValue sym (BVType w))
 -> OverrideSim p sym ext r args ret (RegValue sym (BVType w)))
-> IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a b. (a -> b) -> a -> b
$
    do let sym :: sym
sym = bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak
       SymExpr sym BaseBoolType
isNonzero <- sym -> SymBV sym w -> IO (SymExpr sym BaseBoolType)
forall (w :: Natural).
(1 <= w) =>
sym -> SymBV sym w -> IO (SymExpr sym BaseBoolType)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> IO (Pred sym)
bvIsNonzero sym
sym RegValue sym (BVType w)
SymBV sym w
val
       SymExpr sym BaseBoolType
zeroOK    <- sym -> SymExpr sym BaseBoolType -> IO (SymExpr sym BaseBoolType)
forall sym. IsExprBuilder sym => sym -> Pred sym -> IO (Pred sym)
notPred sym
sym (SymExpr sym BaseBoolType -> IO (SymExpr sym BaseBoolType))
-> IO (SymExpr sym BaseBoolType) -> IO (SymExpr sym BaseBoolType)
forall (m :: Type -> Type) a b. Monad m => (a -> m b) -> m a -> m b
=<< sym -> SymBV sym 1 -> IO (SymExpr sym BaseBoolType)
forall (w :: Natural).
(1 <= w) =>
sym -> SymBV sym w -> IO (SymExpr sym BaseBoolType)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> IO (Pred sym)
bvIsNonzero sym
sym RegValue sym (BVType 1)
SymBV sym 1
isZeroUndef
       SymExpr sym BaseBoolType
p <- sym
-> SymExpr sym BaseBoolType
-> SymExpr sym BaseBoolType
-> IO (SymExpr sym BaseBoolType)
forall sym.
IsExprBuilder sym =>
sym -> Pred sym -> Pred sym -> IO (Pred sym)
orPred sym
sym SymExpr sym BaseBoolType
isNonzero SymExpr sym BaseBoolType
zeroOK
       bak -> SymExpr sym BaseBoolType -> SimErrorReason -> IO ()
forall sym bak.
IsSymBackend sym bak =>
bak -> Pred sym -> SimErrorReason -> IO ()
assert bak
bak SymExpr sym BaseBoolType
p (String -> String -> SimErrorReason
AssertFailureSimError String
"Ctlz called with disallowed zero value" String
"")
       sym -> SymBV sym w -> IO (SymBV sym w)
forall (w :: Natural).
(1 <= w) =>
sym -> SymBV sym w -> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> IO (SymBV sym w)
bvCountLeadingZeros sym
sym RegValue sym (BVType w)
SymBV sym w
val

callFshl
  :: (1 <= w, IsSymBackend sym bak)
  => bak
  -> NatRepr w
  -> RegEntry sym (BVType w)
  -> RegEntry sym (BVType w)
  -> RegEntry sym (BVType w)
  -> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callFshl :: forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> NatRepr w
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callFshl bak
bak NatRepr w
w RegEntry sym (BVType w)
x RegEntry sym (BVType w)
y RegEntry sym (BVType w)
amt = IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (RegValue sym (BVType w))
 -> OverrideSim p sym ext r args ret (RegValue sym (BVType w)))
-> IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a b. (a -> b) -> a -> b
$
  do LeqProof 1 (w + w)
LeqProof <- LeqProof 1 (w + w) -> IO (LeqProof 1 (w + w))
forall a. a -> IO a
forall (m :: Type -> Type) a. Monad m => a -> m a
return (LeqProof 1 w -> LeqProof 1 (w + w)
forall (n :: Natural). LeqProof 1 n -> LeqProof 1 (n + n)
dblPosIsPos (NatRepr 1 -> NatRepr w -> LeqProof 1 w
forall (m :: Natural) (n :: Natural) (f :: Natural -> Type)
       (g :: Natural -> Type).
(m <= n) =>
f m -> g n -> LeqProof m n
leqProof (forall (n :: Natural). KnownNat n => NatRepr n
knownNat @1) NatRepr w
w))
     Just LeqProof (w + 1) (w + w)
LeqProof <- Maybe (LeqProof (w + 1) (w + w))
-> IO (Maybe (LeqProof (w + 1) (w + w)))
forall a. a -> IO a
forall (m :: Type -> Type) a. Monad m => a -> m a
return (NatRepr (w + 1)
-> NatRepr (w + w) -> Maybe (LeqProof (w + 1) (w + w))
forall (m :: Natural) (n :: Natural).
NatRepr m -> NatRepr n -> Maybe (LeqProof m n)
testLeq (NatRepr w -> NatRepr 1 -> NatRepr (w + 1)
forall (m :: Natural) (n :: Natural).
NatRepr m -> NatRepr n -> NatRepr (m + n)
addNat NatRepr w
w (forall (n :: Natural). KnownNat n => NatRepr n
knownNat @1)) (NatRepr w -> NatRepr w -> NatRepr (w + w)
forall (m :: Natural) (n :: Natural).
NatRepr m -> NatRepr n -> NatRepr (m + n)
addNat NatRepr w
w NatRepr w
w))
     let sym :: sym
sym = bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak

     -- concatenate the values together
     SymExpr sym (BaseBVType (w + w))
xy <- sym
-> SymBV sym w
-> SymBV sym w
-> IO (SymExpr sym (BaseBVType (w + w)))
forall (u :: Natural) (v :: Natural).
(1 <= u, 1 <= v) =>
sym -> SymBV sym u -> SymBV sym v -> IO (SymBV sym (u + v))
forall sym (u :: Natural) (v :: Natural).
(IsExprBuilder sym, 1 <= u, 1 <= v) =>
sym -> SymBV sym u -> SymBV sym v -> IO (SymBV sym (u + v))
bvConcat sym
sym (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue RegEntry sym (BVType w)
x) (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue RegEntry sym (BVType w)
y)

     -- The shift argument is treated as an unsigned amount modulo the element size of the arguments.
     SymBV sym w
m <- sym -> NatRepr w -> BV w -> IO (SymBV sym w)
forall (w :: Natural).
(1 <= w) =>
sym -> NatRepr w -> BV w -> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> NatRepr w -> BV w -> IO (SymBV sym w)
bvLit sym
sym NatRepr w
w (NatRepr w -> BV w
forall (w :: Natural). NatRepr w -> BV w
BV.width NatRepr w
w)
     SymBV sym w
mamt <- sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
forall (w :: Natural).
(1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
bvUrem sym
sym (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue RegEntry sym (BVType w)
amt) SymBV sym w
m
     SymExpr sym (BaseBVType (w + w))
mamt' <- sym
-> NatRepr (w + w)
-> SymBV sym w
-> IO (SymExpr sym (BaseBVType (w + w)))
forall (u :: Natural) (r :: Natural).
(1 <= u, (u + 1) <= r) =>
sym -> NatRepr r -> SymBV sym u -> IO (SymBV sym r)
forall sym (u :: Natural) (r :: Natural).
(IsExprBuilder sym, 1 <= u, (u + 1) <= r) =>
sym -> NatRepr r -> SymBV sym u -> IO (SymBV sym r)
bvZext sym
sym (NatRepr w -> NatRepr w -> NatRepr (w + w)
forall (m :: Natural) (n :: Natural).
NatRepr m -> NatRepr n -> NatRepr (m + n)
addNat NatRepr w
w NatRepr w
w) SymBV sym w
mamt

     -- shift left, select high bits
     SymExpr sym (BaseBVType (w + w))
z <- sym
-> SymExpr sym (BaseBVType (w + w))
-> SymExpr sym (BaseBVType (w + w))
-> IO (SymExpr sym (BaseBVType (w + w)))
forall (w :: Natural).
(1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
bvShl sym
sym SymExpr sym (BaseBVType (w + w))
xy SymExpr sym (BaseBVType (w + w))
mamt'
     sym
-> NatRepr w
-> NatRepr w
-> SymExpr sym (BaseBVType (w + w))
-> IO (SymBV sym w)
forall (idx :: Natural) (n :: Natural) (w :: Natural).
(1 <= n, (idx + n) <= w) =>
sym -> NatRepr idx -> NatRepr n -> SymBV sym w -> IO (SymBV sym n)
forall sym (idx :: Natural) (n :: Natural) (w :: Natural).
(IsExprBuilder sym, 1 <= n, (idx + n) <= w) =>
sym -> NatRepr idx -> NatRepr n -> SymBV sym w -> IO (SymBV sym n)
bvSelect sym
sym NatRepr w
w NatRepr w
w SymExpr sym (BaseBVType (w + w))
z

callFshr
  :: (1 <= w, IsSymBackend sym bak)
  => bak
  -> NatRepr w
  -> RegEntry sym (BVType w)
  -> RegEntry sym (BVType w)
  -> RegEntry sym (BVType w)
  -> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callFshr :: forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> NatRepr w
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callFshr bak
bak NatRepr w
w RegEntry sym (BVType w)
x RegEntry sym (BVType w)
y RegEntry sym (BVType w)
amt = IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (RegValue sym (BVType w))
 -> OverrideSim p sym ext r args ret (RegValue sym (BVType w)))
-> IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a b. (a -> b) -> a -> b
$
  do LeqProof 1 (w + w)
LeqProof <- LeqProof 1 (w + w) -> IO (LeqProof 1 (w + w))
forall a. a -> IO a
forall (m :: Type -> Type) a. Monad m => a -> m a
return (LeqProof 1 w -> LeqProof 1 (w + w)
forall (n :: Natural). LeqProof 1 n -> LeqProof 1 (n + n)
dblPosIsPos (NatRepr 1 -> NatRepr w -> LeqProof 1 w
forall (m :: Natural) (n :: Natural) (f :: Natural -> Type)
       (g :: Natural -> Type).
(m <= n) =>
f m -> g n -> LeqProof m n
leqProof (forall (n :: Natural). KnownNat n => NatRepr n
knownNat @1) NatRepr w
w))
     LeqProof w (w + w)
LeqProof <- LeqProof w (w + w) -> IO (LeqProof w (w + w))
forall a. a -> IO a
forall (m :: Type -> Type) a. Monad m => a -> m a
return (NatRepr w -> NatRepr w -> LeqProof w (w + w)
forall (f :: Natural -> Type) (m :: Natural) (g :: Natural -> Type)
       (n :: Natural).
f m -> g n -> LeqProof n (m + n)
addPrefixIsLeq NatRepr w
w NatRepr w
w)
     Just LeqProof (w + 1) (w + w)
LeqProof <- Maybe (LeqProof (w + 1) (w + w))
-> IO (Maybe (LeqProof (w + 1) (w + w)))
forall a. a -> IO a
forall (m :: Type -> Type) a. Monad m => a -> m a
return (NatRepr (w + 1)
-> NatRepr (w + w) -> Maybe (LeqProof (w + 1) (w + w))
forall (m :: Natural) (n :: Natural).
NatRepr m -> NatRepr n -> Maybe (LeqProof m n)
testLeq (NatRepr w -> NatRepr 1 -> NatRepr (w + 1)
forall (m :: Natural) (n :: Natural).
NatRepr m -> NatRepr n -> NatRepr (m + n)
addNat NatRepr w
w (forall (n :: Natural). KnownNat n => NatRepr n
knownNat @1)) (NatRepr w -> NatRepr w -> NatRepr (w + w)
forall (m :: Natural) (n :: Natural).
NatRepr m -> NatRepr n -> NatRepr (m + n)
addNat NatRepr w
w NatRepr w
w))
     let sym :: sym
sym = bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak

     -- concatenate the values together
     SymExpr sym (BaseBVType (w + w))
xy <- sym
-> SymBV sym w
-> SymBV sym w
-> IO (SymExpr sym (BaseBVType (w + w)))
forall (u :: Natural) (v :: Natural).
(1 <= u, 1 <= v) =>
sym -> SymBV sym u -> SymBV sym v -> IO (SymBV sym (u + v))
forall sym (u :: Natural) (v :: Natural).
(IsExprBuilder sym, 1 <= u, 1 <= v) =>
sym -> SymBV sym u -> SymBV sym v -> IO (SymBV sym (u + v))
bvConcat sym
sym (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue RegEntry sym (BVType w)
x) (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue RegEntry sym (BVType w)
y)

     -- The shift argument is treated as an unsigned amount modulo the element size of the arguments.
     SymBV sym w
m <- sym -> NatRepr w -> BV w -> IO (SymBV sym w)
forall (w :: Natural).
(1 <= w) =>
sym -> NatRepr w -> BV w -> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> NatRepr w -> BV w -> IO (SymBV sym w)
bvLit sym
sym NatRepr w
w (NatRepr w -> BV w
forall (w :: Natural). NatRepr w -> BV w
BV.width NatRepr w
w)
     SymBV sym w
mamt <- sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
forall (w :: Natural).
(1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
bvUrem sym
sym (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue RegEntry sym (BVType w)
amt) SymBV sym w
m
     SymExpr sym (BaseBVType (w + w))
mamt' <- sym
-> NatRepr (w + w)
-> SymBV sym w
-> IO (SymExpr sym (BaseBVType (w + w)))
forall (u :: Natural) (r :: Natural).
(1 <= u, (u + 1) <= r) =>
sym -> NatRepr r -> SymBV sym u -> IO (SymBV sym r)
forall sym (u :: Natural) (r :: Natural).
(IsExprBuilder sym, 1 <= u, (u + 1) <= r) =>
sym -> NatRepr r -> SymBV sym u -> IO (SymBV sym r)
bvZext sym
sym (NatRepr w -> NatRepr w -> NatRepr (w + w)
forall (m :: Natural) (n :: Natural).
NatRepr m -> NatRepr n -> NatRepr (m + n)
addNat NatRepr w
w NatRepr w
w) SymBV sym w
mamt

     -- shift right, select low bits
     SymExpr sym (BaseBVType (w + w))
z <- sym
-> SymExpr sym (BaseBVType (w + w))
-> SymExpr sym (BaseBVType (w + w))
-> IO (SymExpr sym (BaseBVType (w + w)))
forall (w :: Natural).
(1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
bvLshr sym
sym SymExpr sym (BaseBVType (w + w))
xy SymExpr sym (BaseBVType (w + w))
mamt'
     sym
-> NatRepr 0
-> NatRepr w
-> SymExpr sym (BaseBVType (w + w))
-> IO (SymBV sym w)
forall (idx :: Natural) (n :: Natural) (w :: Natural).
(1 <= n, (idx + n) <= w) =>
sym -> NatRepr idx -> NatRepr n -> SymBV sym w -> IO (SymBV sym n)
forall sym (idx :: Natural) (n :: Natural) (w :: Natural).
(IsExprBuilder sym, 1 <= n, (idx + n) <= w) =>
sym -> NatRepr idx -> NatRepr n -> SymBV sym w -> IO (SymBV sym n)
bvSelect sym
sym (forall (n :: Natural). KnownNat n => NatRepr n
knownNat @0) NatRepr w
w SymExpr sym (BaseBVType (w + w))
z

callSaddWithOverflow
  :: (1 <= w, IsSymBackend sym bak)
  => bak
  -> GlobalVar Mem
  -> RegEntry sym (BVType w)
  -> RegEntry sym (BVType w)
  -> OverrideSim p sym ext r args ret (RegValue sym (StructType (EmptyCtx ::> BVType w ::> BVType 1)))
callSaddWithOverflow :: forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
callSaddWithOverflow bak
bak GlobalVar Mem
_mvar
  (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
x)
  (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
y) = IO
  (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO
   (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
 -> OverrideSim
      p
      sym
      ext
      r
      args
      ret
      (RegValue
         sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1))))
-> IO
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
forall a b. (a -> b) -> a -> b
$
    do let sym :: sym
sym = bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak
       (SymExpr sym BaseBoolType
ov, SymExpr sym (BaseBVType w)
z) <- sym
-> SymExpr sym (BaseBVType w)
-> SymExpr sym (BaseBVType w)
-> IO (SymExpr sym BaseBoolType, SymExpr sym (BaseBVType w))
forall (w :: Natural).
(1 <= w) =>
sym
-> SymBV sym w
-> SymBV sym w
-> IO (SymExpr sym BaseBoolType, SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (Pred sym, SymBV sym w)
addSignedOF sym
sym RegValue sym (BVType w)
SymExpr sym (BaseBVType w)
x RegValue sym (BVType w)
SymExpr sym (BaseBVType w)
y
       SymExpr sym (BaseBVType 1)
ov' <- sym
-> SymExpr sym BaseBoolType
-> NatRepr 1
-> IO (SymExpr sym (BaseBVType 1))
forall (w :: Natural).
(1 <= w) =>
sym -> SymExpr sym BaseBoolType -> NatRepr w -> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> Pred sym -> NatRepr w -> IO (SymBV sym w)
predToBV sym
sym SymExpr sym BaseBoolType
ov (forall (n :: Natural). KnownNat n => NatRepr n
knownNat @1)
       Assignment (RegValue' sym) ((EmptyCtx ::> BVType w) '::> BVType 1)
-> IO
     (Assignment
        (RegValue' sym) ((EmptyCtx ::> BVType w) '::> BVType 1))
forall a. a -> IO a
forall (m :: Type -> Type) a. Monad m => a -> m a
return (Assignment (RegValue' sym) EmptyCtx
forall {k} (ctx :: Ctx k) (f :: k -> Type).
(ctx ~ EmptyCtx) =>
Assignment f ctx
Empty Assignment (RegValue' sym) EmptyCtx
-> RegValue' sym (BVType w)
-> Assignment (RegValue' sym) (EmptyCtx ::> BVType w)
forall {k} (ctx' :: Ctx k) (f :: k -> Type) (ctx :: Ctx k)
       (tp :: k).
(ctx' ~ (ctx ::> tp)) =>
Assignment f ctx -> f tp -> Assignment f ctx'
:> RegValue sym (BVType w) -> RegValue' sym (BVType w)
forall sym (tp :: CrucibleType).
RegValue sym tp -> RegValue' sym tp
RV RegValue sym (BVType w)
SymExpr sym (BaseBVType w)
z Assignment (RegValue' sym) (EmptyCtx ::> BVType w)
-> RegValue' sym (BVType 1)
-> Assignment
     (RegValue' sym) ((EmptyCtx ::> BVType w) '::> BVType 1)
forall {k} (ctx' :: Ctx k) (f :: k -> Type) (ctx :: Ctx k)
       (tp :: k).
(ctx' ~ (ctx ::> tp)) =>
Assignment f ctx -> f tp -> Assignment f ctx'
:> RegValue sym (BVType 1) -> RegValue' sym (BVType 1)
forall sym (tp :: CrucibleType).
RegValue sym tp -> RegValue' sym tp
RV RegValue sym (BVType 1)
SymExpr sym (BaseBVType 1)
ov')

callUaddWithOverflow
  :: (1 <= w, IsSymBackend sym bak)
  => bak
  -> GlobalVar Mem
  -> RegEntry sym (BVType w)
  -> RegEntry sym (BVType w)
  -> OverrideSim p sym ext r args ret (RegValue sym (StructType (EmptyCtx ::> BVType w ::> BVType 1)))
callUaddWithOverflow :: forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
callUaddWithOverflow bak
bak GlobalVar Mem
_mvar
  (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
x)
  (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
y) = IO
  (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO
   (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
 -> OverrideSim
      p
      sym
      ext
      r
      args
      ret
      (RegValue
         sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1))))
-> IO
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
forall a b. (a -> b) -> a -> b
$
    do let sym :: sym
sym = bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak
       (SymExpr sym BaseBoolType
ov, SymExpr sym (BaseBVType w)
z) <- sym
-> SymExpr sym (BaseBVType w)
-> SymExpr sym (BaseBVType w)
-> IO (SymExpr sym BaseBoolType, SymExpr sym (BaseBVType w))
forall (w :: Natural).
(1 <= w) =>
sym
-> SymBV sym w
-> SymBV sym w
-> IO (SymExpr sym BaseBoolType, SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (Pred sym, SymBV sym w)
addUnsignedOF sym
sym RegValue sym (BVType w)
SymExpr sym (BaseBVType w)
x RegValue sym (BVType w)
SymExpr sym (BaseBVType w)
y
       SymExpr sym (BaseBVType 1)
ov' <- sym
-> SymExpr sym BaseBoolType
-> NatRepr 1
-> IO (SymExpr sym (BaseBVType 1))
forall (w :: Natural).
(1 <= w) =>
sym -> SymExpr sym BaseBoolType -> NatRepr w -> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> Pred sym -> NatRepr w -> IO (SymBV sym w)
predToBV sym
sym SymExpr sym BaseBoolType
ov (forall (n :: Natural). KnownNat n => NatRepr n
knownNat @1)
       Assignment (RegValue' sym) ((EmptyCtx ::> BVType w) '::> BVType 1)
-> IO
     (Assignment
        (RegValue' sym) ((EmptyCtx ::> BVType w) '::> BVType 1))
forall a. a -> IO a
forall (m :: Type -> Type) a. Monad m => a -> m a
return (Assignment (RegValue' sym) EmptyCtx
forall {k} (ctx :: Ctx k) (f :: k -> Type).
(ctx ~ EmptyCtx) =>
Assignment f ctx
Empty Assignment (RegValue' sym) EmptyCtx
-> RegValue' sym (BVType w)
-> Assignment (RegValue' sym) (EmptyCtx ::> BVType w)
forall {k} (ctx' :: Ctx k) (f :: k -> Type) (ctx :: Ctx k)
       (tp :: k).
(ctx' ~ (ctx ::> tp)) =>
Assignment f ctx -> f tp -> Assignment f ctx'
:> RegValue sym (BVType w) -> RegValue' sym (BVType w)
forall sym (tp :: CrucibleType).
RegValue sym tp -> RegValue' sym tp
RV RegValue sym (BVType w)
SymExpr sym (BaseBVType w)
z Assignment (RegValue' sym) (EmptyCtx ::> BVType w)
-> RegValue' sym (BVType 1)
-> Assignment
     (RegValue' sym) ((EmptyCtx ::> BVType w) '::> BVType 1)
forall {k} (ctx' :: Ctx k) (f :: k -> Type) (ctx :: Ctx k)
       (tp :: k).
(ctx' ~ (ctx ::> tp)) =>
Assignment f ctx -> f tp -> Assignment f ctx'
:> RegValue sym (BVType 1) -> RegValue' sym (BVType 1)
forall sym (tp :: CrucibleType).
RegValue sym tp -> RegValue' sym tp
RV RegValue sym (BVType 1)
SymExpr sym (BaseBVType 1)
ov')

callUsubWithOverflow
  :: (1 <= w, IsSymBackend sym bak)
  => bak
  -> GlobalVar Mem
  -> RegEntry sym (BVType w)
  -> RegEntry sym (BVType w)
  -> OverrideSim p sym ext r args ret (RegValue sym (StructType (EmptyCtx ::> BVType w ::> BVType 1)))
callUsubWithOverflow :: forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
callUsubWithOverflow bak
bak GlobalVar Mem
_mvar
  (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
x)
  (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
y) = IO
  (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO
   (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
 -> OverrideSim
      p
      sym
      ext
      r
      args
      ret
      (RegValue
         sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1))))
-> IO
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
forall a b. (a -> b) -> a -> b
$
    do let sym :: sym
sym = bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak
       (SymExpr sym BaseBoolType
ov, SymExpr sym (BaseBVType w)
z) <- sym
-> SymExpr sym (BaseBVType w)
-> SymExpr sym (BaseBVType w)
-> IO (SymExpr sym BaseBoolType, SymExpr sym (BaseBVType w))
forall (w :: Natural).
(1 <= w) =>
sym
-> SymBV sym w
-> SymBV sym w
-> IO (SymExpr sym BaseBoolType, SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (Pred sym, SymBV sym w)
subUnsignedOF sym
sym RegValue sym (BVType w)
SymExpr sym (BaseBVType w)
x RegValue sym (BVType w)
SymExpr sym (BaseBVType w)
y
       SymExpr sym (BaseBVType 1)
ov' <- sym
-> SymExpr sym BaseBoolType
-> NatRepr 1
-> IO (SymExpr sym (BaseBVType 1))
forall (w :: Natural).
(1 <= w) =>
sym -> SymExpr sym BaseBoolType -> NatRepr w -> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> Pred sym -> NatRepr w -> IO (SymBV sym w)
predToBV sym
sym SymExpr sym BaseBoolType
ov (forall (n :: Natural). KnownNat n => NatRepr n
knownNat @1)
       Assignment (RegValue' sym) ((EmptyCtx ::> BVType w) '::> BVType 1)
-> IO
     (Assignment
        (RegValue' sym) ((EmptyCtx ::> BVType w) '::> BVType 1))
forall a. a -> IO a
forall (m :: Type -> Type) a. Monad m => a -> m a
return (Assignment (RegValue' sym) EmptyCtx
forall {k} (ctx :: Ctx k) (f :: k -> Type).
(ctx ~ EmptyCtx) =>
Assignment f ctx
Empty Assignment (RegValue' sym) EmptyCtx
-> RegValue' sym (BVType w)
-> Assignment (RegValue' sym) (EmptyCtx ::> BVType w)
forall {k} (ctx' :: Ctx k) (f :: k -> Type) (ctx :: Ctx k)
       (tp :: k).
(ctx' ~ (ctx ::> tp)) =>
Assignment f ctx -> f tp -> Assignment f ctx'
:> RegValue sym (BVType w) -> RegValue' sym (BVType w)
forall sym (tp :: CrucibleType).
RegValue sym tp -> RegValue' sym tp
RV RegValue sym (BVType w)
SymExpr sym (BaseBVType w)
z Assignment (RegValue' sym) (EmptyCtx ::> BVType w)
-> RegValue' sym (BVType 1)
-> Assignment
     (RegValue' sym) ((EmptyCtx ::> BVType w) '::> BVType 1)
forall {k} (ctx' :: Ctx k) (f :: k -> Type) (ctx :: Ctx k)
       (tp :: k).
(ctx' ~ (ctx ::> tp)) =>
Assignment f ctx -> f tp -> Assignment f ctx'
:> RegValue sym (BVType 1) -> RegValue' sym (BVType 1)
forall sym (tp :: CrucibleType).
RegValue sym tp -> RegValue' sym tp
RV RegValue sym (BVType 1)
SymExpr sym (BaseBVType 1)
ov')

callSsubWithOverflow
  :: (1 <= w, IsSymBackend sym bak)
  => bak
  -> GlobalVar Mem
  -> RegEntry sym (BVType w)
  -> RegEntry sym (BVType w)
  -> OverrideSim p sym ext r args ret (RegValue sym (StructType (EmptyCtx ::> BVType w ::> BVType 1)))
callSsubWithOverflow :: forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
callSsubWithOverflow bak
bak GlobalVar Mem
_mvar
  (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
x)
  (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
y) = IO
  (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO
   (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
 -> OverrideSim
      p
      sym
      ext
      r
      args
      ret
      (RegValue
         sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1))))
-> IO
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
forall a b. (a -> b) -> a -> b
$
    do let sym :: sym
sym = bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak
       (SymExpr sym BaseBoolType
ov, SymExpr sym (BaseBVType w)
z) <- sym
-> SymExpr sym (BaseBVType w)
-> SymExpr sym (BaseBVType w)
-> IO (SymExpr sym BaseBoolType, SymExpr sym (BaseBVType w))
forall (w :: Natural).
(1 <= w) =>
sym
-> SymBV sym w
-> SymBV sym w
-> IO (SymExpr sym BaseBoolType, SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (Pred sym, SymBV sym w)
subSignedOF sym
sym RegValue sym (BVType w)
SymExpr sym (BaseBVType w)
x RegValue sym (BVType w)
SymExpr sym (BaseBVType w)
y
       SymExpr sym (BaseBVType 1)
ov' <- sym
-> SymExpr sym BaseBoolType
-> NatRepr 1
-> IO (SymExpr sym (BaseBVType 1))
forall (w :: Natural).
(1 <= w) =>
sym -> SymExpr sym BaseBoolType -> NatRepr w -> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> Pred sym -> NatRepr w -> IO (SymBV sym w)
predToBV sym
sym SymExpr sym BaseBoolType
ov (forall (n :: Natural). KnownNat n => NatRepr n
knownNat @1)
       Assignment (RegValue' sym) ((EmptyCtx ::> BVType w) '::> BVType 1)
-> IO
     (Assignment
        (RegValue' sym) ((EmptyCtx ::> BVType w) '::> BVType 1))
forall a. a -> IO a
forall (m :: Type -> Type) a. Monad m => a -> m a
return (Assignment (RegValue' sym) EmptyCtx
forall {k} (ctx :: Ctx k) (f :: k -> Type).
(ctx ~ EmptyCtx) =>
Assignment f ctx
Empty Assignment (RegValue' sym) EmptyCtx
-> RegValue' sym (BVType w)
-> Assignment (RegValue' sym) (EmptyCtx ::> BVType w)
forall {k} (ctx' :: Ctx k) (f :: k -> Type) (ctx :: Ctx k)
       (tp :: k).
(ctx' ~ (ctx ::> tp)) =>
Assignment f ctx -> f tp -> Assignment f ctx'
:> RegValue sym (BVType w) -> RegValue' sym (BVType w)
forall sym (tp :: CrucibleType).
RegValue sym tp -> RegValue' sym tp
RV RegValue sym (BVType w)
SymExpr sym (BaseBVType w)
z Assignment (RegValue' sym) (EmptyCtx ::> BVType w)
-> RegValue' sym (BVType 1)
-> Assignment
     (RegValue' sym) ((EmptyCtx ::> BVType w) '::> BVType 1)
forall {k} (ctx' :: Ctx k) (f :: k -> Type) (ctx :: Ctx k)
       (tp :: k).
(ctx' ~ (ctx ::> tp)) =>
Assignment f ctx -> f tp -> Assignment f ctx'
:> RegValue sym (BVType 1) -> RegValue' sym (BVType 1)
forall sym (tp :: CrucibleType).
RegValue sym tp -> RegValue' sym tp
RV RegValue sym (BVType 1)
SymExpr sym (BaseBVType 1)
ov')

callSmulWithOverflow
  :: (1 <= w, IsSymBackend sym bak)
  => bak
  -> GlobalVar Mem
  -> RegEntry sym (BVType w)
  -> RegEntry sym (BVType w)
  -> OverrideSim p sym ext r args ret (RegValue sym (StructType (EmptyCtx ::> BVType w ::> BVType 1)))
callSmulWithOverflow :: forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
callSmulWithOverflow bak
bak GlobalVar Mem
_mvar
  (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
x)
  (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
y) = IO
  (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO
   (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
 -> OverrideSim
      p
      sym
      ext
      r
      args
      ret
      (RegValue
         sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1))))
-> IO
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
forall a b. (a -> b) -> a -> b
$
    do let sym :: sym
sym = bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak
       (SymExpr sym BaseBoolType
ov, SymExpr sym (BaseBVType w)
z) <- sym
-> SymExpr sym (BaseBVType w)
-> SymExpr sym (BaseBVType w)
-> IO (SymExpr sym BaseBoolType, SymExpr sym (BaseBVType w))
forall (w :: Natural).
(1 <= w) =>
sym
-> SymBV sym w
-> SymBV sym w
-> IO (SymExpr sym BaseBoolType, SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (Pred sym, SymBV sym w)
mulSignedOF sym
sym RegValue sym (BVType w)
SymExpr sym (BaseBVType w)
x RegValue sym (BVType w)
SymExpr sym (BaseBVType w)
y
       SymExpr sym (BaseBVType 1)
ov' <- sym
-> SymExpr sym BaseBoolType
-> NatRepr 1
-> IO (SymExpr sym (BaseBVType 1))
forall (w :: Natural).
(1 <= w) =>
sym -> SymExpr sym BaseBoolType -> NatRepr w -> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> Pred sym -> NatRepr w -> IO (SymBV sym w)
predToBV sym
sym SymExpr sym BaseBoolType
ov (forall (n :: Natural). KnownNat n => NatRepr n
knownNat @1)
       Assignment (RegValue' sym) ((EmptyCtx ::> BVType w) '::> BVType 1)
-> IO
     (Assignment
        (RegValue' sym) ((EmptyCtx ::> BVType w) '::> BVType 1))
forall a. a -> IO a
forall (m :: Type -> Type) a. Monad m => a -> m a
return (Assignment (RegValue' sym) EmptyCtx
forall {k} (ctx :: Ctx k) (f :: k -> Type).
(ctx ~ EmptyCtx) =>
Assignment f ctx
Empty Assignment (RegValue' sym) EmptyCtx
-> RegValue' sym (BVType w)
-> Assignment (RegValue' sym) (EmptyCtx ::> BVType w)
forall {k} (ctx' :: Ctx k) (f :: k -> Type) (ctx :: Ctx k)
       (tp :: k).
(ctx' ~ (ctx ::> tp)) =>
Assignment f ctx -> f tp -> Assignment f ctx'
:> RegValue sym (BVType w) -> RegValue' sym (BVType w)
forall sym (tp :: CrucibleType).
RegValue sym tp -> RegValue' sym tp
RV RegValue sym (BVType w)
SymExpr sym (BaseBVType w)
z Assignment (RegValue' sym) (EmptyCtx ::> BVType w)
-> RegValue' sym (BVType 1)
-> Assignment
     (RegValue' sym) ((EmptyCtx ::> BVType w) '::> BVType 1)
forall {k} (ctx' :: Ctx k) (f :: k -> Type) (ctx :: Ctx k)
       (tp :: k).
(ctx' ~ (ctx ::> tp)) =>
Assignment f ctx -> f tp -> Assignment f ctx'
:> RegValue sym (BVType 1) -> RegValue' sym (BVType 1)
forall sym (tp :: CrucibleType).
RegValue sym tp -> RegValue' sym tp
RV RegValue sym (BVType 1)
SymExpr sym (BaseBVType 1)
ov')

callUmulWithOverflow
  :: (1 <= w, IsSymBackend sym bak)
  => bak
  -> GlobalVar Mem
  -> RegEntry sym (BVType w)
  -> RegEntry sym (BVType w)
  -> OverrideSim p sym ext r args ret (RegValue sym (StructType (EmptyCtx ::> BVType w ::> BVType 1)))
callUmulWithOverflow :: forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) ::> BVType 1)))
callUmulWithOverflow bak
bak GlobalVar Mem
_mvar
  (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
x)
  (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
y) = IO
  (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO
   (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
 -> OverrideSim
      p
      sym
      ext
      r
      args
      ret
      (RegValue
         sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1))))
-> IO
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (RegValue sym (StructType ((EmptyCtx ::> BVType w) '::> BVType 1)))
forall a b. (a -> b) -> a -> b
$
    do let sym :: sym
sym = bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak
       (SymExpr sym BaseBoolType
ov, SymExpr sym (BaseBVType w)
z) <- sym
-> SymExpr sym (BaseBVType w)
-> SymExpr sym (BaseBVType w)
-> IO (SymExpr sym BaseBoolType, SymExpr sym (BaseBVType w))
forall (w :: Natural).
(1 <= w) =>
sym
-> SymBV sym w
-> SymBV sym w
-> IO (SymExpr sym BaseBoolType, SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (Pred sym, SymBV sym w)
mulUnsignedOF sym
sym RegValue sym (BVType w)
SymExpr sym (BaseBVType w)
x RegValue sym (BVType w)
SymExpr sym (BaseBVType w)
y
       SymExpr sym (BaseBVType 1)
ov' <- sym
-> SymExpr sym BaseBoolType
-> NatRepr 1
-> IO (SymExpr sym (BaseBVType 1))
forall (w :: Natural).
(1 <= w) =>
sym -> SymExpr sym BaseBoolType -> NatRepr w -> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> Pred sym -> NatRepr w -> IO (SymBV sym w)
predToBV sym
sym SymExpr sym BaseBoolType
ov (forall (n :: Natural). KnownNat n => NatRepr n
knownNat @1)
       Assignment (RegValue' sym) ((EmptyCtx ::> BVType w) '::> BVType 1)
-> IO
     (Assignment
        (RegValue' sym) ((EmptyCtx ::> BVType w) '::> BVType 1))
forall a. a -> IO a
forall (m :: Type -> Type) a. Monad m => a -> m a
return (Assignment (RegValue' sym) EmptyCtx
forall {k} (ctx :: Ctx k) (f :: k -> Type).
(ctx ~ EmptyCtx) =>
Assignment f ctx
Empty Assignment (RegValue' sym) EmptyCtx
-> RegValue' sym (BVType w)
-> Assignment (RegValue' sym) (EmptyCtx ::> BVType w)
forall {k} (ctx' :: Ctx k) (f :: k -> Type) (ctx :: Ctx k)
       (tp :: k).
(ctx' ~ (ctx ::> tp)) =>
Assignment f ctx -> f tp -> Assignment f ctx'
:> RegValue sym (BVType w) -> RegValue' sym (BVType w)
forall sym (tp :: CrucibleType).
RegValue sym tp -> RegValue' sym tp
RV RegValue sym (BVType w)
SymExpr sym (BaseBVType w)
z Assignment (RegValue' sym) (EmptyCtx ::> BVType w)
-> RegValue' sym (BVType 1)
-> Assignment
     (RegValue' sym) ((EmptyCtx ::> BVType w) '::> BVType 1)
forall {k} (ctx' :: Ctx k) (f :: k -> Type) (ctx :: Ctx k)
       (tp :: k).
(ctx' ~ (ctx ::> tp)) =>
Assignment f ctx -> f tp -> Assignment f ctx'
:> RegValue sym (BVType 1) -> RegValue' sym (BVType 1)
forall sym (tp :: CrucibleType).
RegValue sym tp -> RegValue' sym tp
RV RegValue sym (BVType 1)
SymExpr sym (BaseBVType 1)
ov')

callUmax
  :: (1 <= w, IsSymBackend sym bak)
  => bak
  -> GlobalVar Mem
  -> RegEntry sym (BVType w)
  -> RegEntry sym (BVType w)
  -> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callUmax :: forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callUmax bak
bak GlobalVar Mem
_mvar (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
x) (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
y) = IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (RegValue sym (BVType w))
 -> OverrideSim p sym ext r args ret (RegValue sym (BVType w)))
-> IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a b. (a -> b) -> a -> b
$
  do let sym :: sym
sym = bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak
     SymExpr sym BaseBoolType
xGtY <- sym -> SymBV sym w -> SymBV sym w -> IO (SymExpr sym BaseBoolType)
forall (w :: Natural).
(1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (SymExpr sym BaseBoolType)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (Pred sym)
bvUgt sym
sym RegValue sym (BVType w)
SymBV sym w
x RegValue sym (BVType w)
SymBV sym w
y
     sym
-> SymExpr sym BaseBoolType
-> SymBV sym w
-> SymBV sym w
-> IO (SymBV sym w)
forall (w :: Natural).
(1 <= w) =>
sym
-> SymExpr sym BaseBoolType
-> SymBV sym w
-> SymBV sym w
-> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> Pred sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
bvIte sym
sym SymExpr sym BaseBoolType
xGtY RegValue sym (BVType w)
SymBV sym w
x RegValue sym (BVType w)
SymBV sym w
y

callUmin
  :: (1 <= w, IsSymBackend sym bak)
  => bak
  -> GlobalVar Mem
  -> RegEntry sym (BVType w)
  -> RegEntry sym (BVType w)
  -> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callUmin :: forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callUmin bak
bak GlobalVar Mem
_mvar (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
x) (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
y) = IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (RegValue sym (BVType w))
 -> OverrideSim p sym ext r args ret (RegValue sym (BVType w)))
-> IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a b. (a -> b) -> a -> b
$
  do let sym :: sym
sym = bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak
     SymExpr sym BaseBoolType
xLtY <- sym -> SymBV sym w -> SymBV sym w -> IO (SymExpr sym BaseBoolType)
forall (w :: Natural).
(1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (SymExpr sym BaseBoolType)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (Pred sym)
bvUlt sym
sym RegValue sym (BVType w)
SymBV sym w
x RegValue sym (BVType w)
SymBV sym w
y
     sym
-> SymExpr sym BaseBoolType
-> SymBV sym w
-> SymBV sym w
-> IO (SymBV sym w)
forall (w :: Natural).
(1 <= w) =>
sym
-> SymExpr sym BaseBoolType
-> SymBV sym w
-> SymBV sym w
-> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> Pred sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
bvIte sym
sym SymExpr sym BaseBoolType
xLtY RegValue sym (BVType w)
SymBV sym w
x RegValue sym (BVType w)
SymBV sym w
y

callSmax
  :: (1 <= w, IsSymBackend sym bak)
  => bak
  -> GlobalVar Mem
  -> RegEntry sym (BVType w)
  -> RegEntry sym (BVType w)
  -> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callSmax :: forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callSmax bak
bak GlobalVar Mem
_mvar (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
x) (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
y) = IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (RegValue sym (BVType w))
 -> OverrideSim p sym ext r args ret (RegValue sym (BVType w)))
-> IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a b. (a -> b) -> a -> b
$
  do let sym :: sym
sym = bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak
     SymExpr sym BaseBoolType
xGtY <- sym -> SymBV sym w -> SymBV sym w -> IO (SymExpr sym BaseBoolType)
forall (w :: Natural).
(1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (SymExpr sym BaseBoolType)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (Pred sym)
bvSgt sym
sym RegValue sym (BVType w)
SymBV sym w
x RegValue sym (BVType w)
SymBV sym w
y
     sym
-> SymExpr sym BaseBoolType
-> SymBV sym w
-> SymBV sym w
-> IO (SymBV sym w)
forall (w :: Natural).
(1 <= w) =>
sym
-> SymExpr sym BaseBoolType
-> SymBV sym w
-> SymBV sym w
-> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> Pred sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
bvIte sym
sym SymExpr sym BaseBoolType
xGtY RegValue sym (BVType w)
SymBV sym w
x RegValue sym (BVType w)
SymBV sym w
y

callSmin
  :: (1 <= w, IsSymBackend sym bak)
  => bak
  -> GlobalVar Mem
  -> RegEntry sym (BVType w)
  -> RegEntry sym (BVType w)
  -> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callSmin :: forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType w)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callSmin bak
bak GlobalVar Mem
_mvar (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
x) (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
y) = IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (RegValue sym (BVType w))
 -> OverrideSim p sym ext r args ret (RegValue sym (BVType w)))
-> IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a b. (a -> b) -> a -> b
$
  do let sym :: sym
sym = bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak
     SymExpr sym BaseBoolType
xLtY <- sym -> SymBV sym w -> SymBV sym w -> IO (SymExpr sym BaseBoolType)
forall (w :: Natural).
(1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (SymExpr sym BaseBoolType)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (Pred sym)
bvSlt sym
sym RegValue sym (BVType w)
SymBV sym w
x RegValue sym (BVType w)
SymBV sym w
y
     sym
-> SymExpr sym BaseBoolType
-> SymBV sym w
-> SymBV sym w
-> IO (SymBV sym w)
forall (w :: Natural).
(1 <= w) =>
sym
-> SymExpr sym BaseBoolType
-> SymBV sym w
-> SymBV sym w
-> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> Pred sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
bvIte sym
sym SymExpr sym BaseBoolType
xLtY RegValue sym (BVType w)
SymBV sym w
x RegValue sym (BVType w)
SymBV sym w
y


callCttz
  :: (1 <= w, IsSymBackend sym bak)
  => bak
  -> GlobalVar Mem
  -> RegEntry sym (BVType w)
  -> RegEntry sym (BVType 1)
  -> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callCttz :: forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> RegEntry sym (BVType 1)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callCttz bak
bak GlobalVar Mem
_mvar
  (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
val)
  (RegEntry sym (BVType 1) -> RegValue sym (BVType 1)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType 1)
isZeroUndef) = IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (RegValue sym (BVType w))
 -> OverrideSim p sym ext r args ret (RegValue sym (BVType w)))
-> IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a b. (a -> b) -> a -> b
$
    do let sym :: sym
sym = bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak
       SymExpr sym BaseBoolType
isNonzero <- sym -> SymBV sym w -> IO (SymExpr sym BaseBoolType)
forall (w :: Natural).
(1 <= w) =>
sym -> SymBV sym w -> IO (SymExpr sym BaseBoolType)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> IO (Pred sym)
bvIsNonzero sym
sym RegValue sym (BVType w)
SymBV sym w
val
       SymExpr sym BaseBoolType
zeroOK    <- sym -> SymExpr sym BaseBoolType -> IO (SymExpr sym BaseBoolType)
forall sym. IsExprBuilder sym => sym -> Pred sym -> IO (Pred sym)
notPred sym
sym (SymExpr sym BaseBoolType -> IO (SymExpr sym BaseBoolType))
-> IO (SymExpr sym BaseBoolType) -> IO (SymExpr sym BaseBoolType)
forall (m :: Type -> Type) a b. Monad m => (a -> m b) -> m a -> m b
=<< sym -> SymBV sym 1 -> IO (SymExpr sym BaseBoolType)
forall (w :: Natural).
(1 <= w) =>
sym -> SymBV sym w -> IO (SymExpr sym BaseBoolType)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> IO (Pred sym)
bvIsNonzero sym
sym RegValue sym (BVType 1)
SymBV sym 1
isZeroUndef
       SymExpr sym BaseBoolType
p <- sym
-> SymExpr sym BaseBoolType
-> SymExpr sym BaseBoolType
-> IO (SymExpr sym BaseBoolType)
forall sym.
IsExprBuilder sym =>
sym -> Pred sym -> Pred sym -> IO (Pred sym)
orPred sym
sym SymExpr sym BaseBoolType
isNonzero SymExpr sym BaseBoolType
zeroOK
       bak -> SymExpr sym BaseBoolType -> SimErrorReason -> IO ()
forall sym bak.
IsSymBackend sym bak =>
bak -> Pred sym -> SimErrorReason -> IO ()
assert bak
bak SymExpr sym BaseBoolType
p (String -> String -> SimErrorReason
AssertFailureSimError String
"Cttz called with disallowed zero value" String
"")
       sym -> SymBV sym w -> IO (SymBV sym w)
forall (w :: Natural).
(1 <= w) =>
sym -> SymBV sym w -> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> IO (SymBV sym w)
bvCountTrailingZeros sym
sym RegValue sym (BVType w)
SymBV sym w
val

callCtpop
  :: (1 <= w, IsSymBackend sym bak)
  => bak
  -> GlobalVar Mem
  -> RegEntry sym (BVType w)
  -> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callCtpop :: forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callCtpop bak
bak GlobalVar Mem
_mvar
  (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
val) = IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (RegValue sym (BVType w))
 -> OverrideSim p sym ext r args ret (RegValue sym (BVType w)))
-> IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a b. (a -> b) -> a -> b
$ sym -> SymBV sym w -> IO (SymBV sym w)
forall (w :: Natural).
(1 <= w) =>
sym -> SymBV sym w -> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> IO (SymBV sym w)
bvPopcount (bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak) RegValue sym (BVType w)
SymBV sym w
val

callBitreverse
  :: (1 <= w, IsSymBackend sym bak)
  => bak
  -> GlobalVar Mem
  -> RegEntry sym (BVType w)
  -> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callBitreverse :: forall (w :: Natural) sym bak p ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
(1 <= w, IsSymBackend sym bak) =>
bak
-> GlobalVar Mem
-> RegEntry sym (BVType w)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
callBitreverse bak
bak GlobalVar Mem
_mvar
  (RegEntry sym (BVType w) -> RegValue sym (BVType w)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType w)
val) = IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (RegValue sym (BVType w))
 -> OverrideSim p sym ext r args ret (RegValue sym (BVType w)))
-> IO (RegValue sym (BVType w))
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
forall a b. (a -> b) -> a -> b
$ sym -> SymBV sym w -> IO (SymBV sym w)
forall sym (w :: Natural).
(1 <= w, IsExprBuilder sym) =>
sym -> SymBV sym w -> IO (SymBV sym w)
bvBitreverse (bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak) RegValue sym (BVType w)
SymBV sym w
val

-- | Strictly speaking, this doesn't quite conform to the C99 description of
-- @copysign@, since @copysign(NaN, -1.0)@ should return @NaN@ with a negative
-- sign bit. @libBF@ does not provide a way to distinguish between @NaN@ values
-- with different sign bits, however, so @copysign@ will always turn a @NaN@
-- argument into a positive, \"quiet\" @NaN@.
callCopysign ::
  forall fi p sym bak ext r args ret.
  (IsSymBackend sym bak) =>
  bak ->
  RegEntry sym (FloatType fi) ->
  RegEntry sym (FloatType fi) ->
  OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
callCopysign :: forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
IsSymBackend sym bak =>
bak
-> RegEntry sym (FloatType fi)
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
callCopysign bak
bak
  (RegEntry sym (FloatType fi) -> RegValue sym (FloatType fi)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (FloatType fi)
x)
  (RegEntry sym (FloatType fi) -> RegValue sym (FloatType fi)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (FloatType fi)
y) = IO (RegValue sym (FloatType fi))
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (RegValue sym (FloatType fi))
 -> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi)))
-> IO (RegValue sym (FloatType fi))
-> OverrideSim p sym ext r args ret (RegValue sym (FloatType fi))
forall a b. (a -> b) -> a -> b
$ do
    let sym :: sym
sym = bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak
    SymExpr sym BaseBoolType
xIsNeg    <- forall sym (fi :: FloatInfo).
IsInterpretedFloatExprBuilder sym =>
sym -> SymInterpretedFloat sym fi -> IO (Pred sym)
iFloatIsNeg @_ @fi sym
sym RegValue sym (FloatType fi)
SymInterpretedFloat sym fi
x
    SymExpr sym BaseBoolType
yIsNeg    <- forall sym (fi :: FloatInfo).
IsInterpretedFloatExprBuilder sym =>
sym -> SymInterpretedFloat sym fi -> IO (Pred sym)
iFloatIsNeg @_ @fi sym
sym RegValue sym (FloatType fi)
SymInterpretedFloat sym fi
y
    SymExpr sym BaseBoolType
signsSame <- sym
-> SymExpr sym BaseBoolType
-> SymExpr sym BaseBoolType
-> IO (SymExpr sym BaseBoolType)
forall sym.
IsExprBuilder sym =>
sym -> Pred sym -> Pred sym -> IO (Pred sym)
eqPred sym
sym SymExpr sym BaseBoolType
xIsNeg SymExpr sym BaseBoolType
yIsNeg
    SymInterpretedFloat sym fi
xNegated  <- forall sym (fi :: FloatInfo).
IsInterpretedFloatExprBuilder sym =>
sym
-> SymInterpretedFloat sym fi -> IO (SymInterpretedFloat sym fi)
iFloatNeg @_ @fi sym
sym RegValue sym (FloatType fi)
SymInterpretedFloat sym fi
x
    forall sym (fi :: FloatInfo).
IsInterpretedFloatExprBuilder sym =>
sym
-> Pred sym
-> SymInterpretedFloat sym fi
-> SymInterpretedFloat sym fi
-> IO (SymInterpretedFloat sym fi)
iFloatIte @_ @fi sym
sym SymExpr sym BaseBoolType
signsSame RegValue sym (FloatType fi)
SymInterpretedFloat sym fi
x SymInterpretedFloat sym fi
xNegated

-- | An implementation of the @llvm.is.fpclass@ intrinsic. This essentially
-- combines several different floating-point checks (checking for @NaN@,
-- infinity, zero, etc.) into a single function. The second argument is a
-- bitmask that controls which properties to check of the first argument.
-- The different checks in the bitmask are described by the table here:
-- <https://llvm.org/docs/LangRef.html#id1566>
--
-- The specification requires being able to distinguish between signaling
-- @NaN@s (bit 0 of the bitmask) and quit @NaN@s (bit 1 of the bitmask), but
-- @crucible-llvm@ does not have the ability to do this. As a result, both
-- @NaN@ checks will always return true in this implementation, regardless of
-- whether they are signaling or quiet @NaN@s.
callIsFpclass ::
  forall fi p sym bak ext r args ret.
  IsSymBackend sym bak =>
  bak ->
  RegEntry sym (FloatType fi) ->
  RegEntry sym (BVType 32) ->
  OverrideSim p sym ext r args ret (RegValue sym (BVType 1))
callIsFpclass :: forall (fi :: FloatInfo) p sym bak ext r (args :: Ctx CrucibleType)
       (ret :: CrucibleType).
IsSymBackend sym bak =>
bak
-> RegEntry sym (FloatType fi)
-> RegEntry sym (BVType 32)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType 1))
callIsFpclass bak
bak regOp :: RegEntry sym (FloatType fi)
regOp@(RegEntry sym (FloatType fi) -> RegValue sym (FloatType fi)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (FloatType fi)
op) (RegEntry sym (BVType 32) -> RegValue sym (BVType 32)
forall sym (tp :: CrucibleType). RegEntry sym tp -> RegValue sym tp
regValue -> RegValue sym (BVType 32)
test) = do
  SymExpr sym (BaseBVType 1)
bvOne  <- IO (SymExpr sym (BaseBVType 1))
-> OverrideSim p sym ext r args ret (SymExpr sym (BaseBVType 1))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (SymExpr sym (BaseBVType 1))
 -> OverrideSim p sym ext r args ret (SymExpr sym (BaseBVType 1)))
-> IO (SymExpr sym (BaseBVType 1))
-> OverrideSim p sym ext r args ret (SymExpr sym (BaseBVType 1))
forall a b. (a -> b) -> a -> b
$ sym -> NatRepr 1 -> BV 1 -> IO (SymExpr sym (BaseBVType 1))
forall (w :: Natural).
(1 <= w) =>
sym -> NatRepr w -> BV w -> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> NatRepr w -> BV w -> IO (SymBV sym w)
bvLit sym
sym NatRepr 1
w1 (NatRepr 1 -> BV 1
forall (w :: Natural). (1 <= w) => NatRepr w -> BV w
BV.one NatRepr 1
w1)
  SymExpr sym (BaseBVType 1)
bvZero <- IO (SymExpr sym (BaseBVType 1))
-> OverrideSim p sym ext r args ret (SymExpr sym (BaseBVType 1))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (SymExpr sym (BaseBVType 1))
 -> OverrideSim p sym ext r args ret (SymExpr sym (BaseBVType 1)))
-> IO (SymExpr sym (BaseBVType 1))
-> OverrideSim p sym ext r args ret (SymExpr sym (BaseBVType 1))
forall a b. (a -> b) -> a -> b
$ sym -> NatRepr 1 -> BV 1 -> IO (SymExpr sym (BaseBVType 1))
forall (w :: Natural).
(1 <= w) =>
sym -> NatRepr w -> BV w -> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> NatRepr w -> BV w -> IO (SymBV sym w)
bvLit sym
sym NatRepr 1
w1 (NatRepr 1 -> BV 1
forall (w :: Natural). NatRepr w -> BV w
BV.zero NatRepr 1
w1)

  let negative :: SymExpr sym (BaseBVType 1) -> IO (SymExpr sym (BaseBVType 1))
negative SymExpr sym (BaseBVType 1)
bit = IO (SymExpr sym (BaseBVType 1)) -> IO (SymExpr sym (BaseBVType 1))
forall a. IO a -> IO a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (SymExpr sym (BaseBVType 1))
 -> IO (SymExpr sym (BaseBVType 1)))
-> IO (SymExpr sym (BaseBVType 1))
-> IO (SymExpr sym (BaseBVType 1))
forall a b. (a -> b) -> a -> b
$ do
        SymExpr sym BaseBoolType
isNeg <- forall sym (fi :: FloatInfo).
IsInterpretedFloatExprBuilder sym =>
sym -> SymInterpretedFloat sym fi -> IO (Pred sym)
iFloatIsNeg @_ @fi sym
sym RegValue sym (FloatType fi)
SymInterpretedFloat sym fi
op
        IO (SymExpr sym (BaseBVType 1)) -> IO (SymExpr sym (BaseBVType 1))
forall a. IO a -> IO a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (SymExpr sym (BaseBVType 1))
 -> IO (SymExpr sym (BaseBVType 1)))
-> IO (SymExpr sym (BaseBVType 1))
-> IO (SymExpr sym (BaseBVType 1))
forall a b. (a -> b) -> a -> b
$ sym
-> SymExpr sym BaseBoolType
-> SymExpr sym (BaseBVType 1)
-> SymExpr sym (BaseBVType 1)
-> IO (SymExpr sym (BaseBVType 1))
forall (w :: Natural).
(1 <= w) =>
sym
-> SymExpr sym BaseBoolType
-> SymBV sym w
-> SymBV sym w
-> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> Pred sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
bvIte sym
sym SymExpr sym BaseBoolType
isNeg SymExpr sym (BaseBVType 1)
bit SymExpr sym (BaseBVType 1)
bvZero

  let positive :: SymExpr sym (BaseBVType 1) -> IO (SymExpr sym (BaseBVType 1))
positive SymExpr sym (BaseBVType 1)
bit = IO (SymExpr sym (BaseBVType 1)) -> IO (SymExpr sym (BaseBVType 1))
forall a. IO a -> IO a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (SymExpr sym (BaseBVType 1))
 -> IO (SymExpr sym (BaseBVType 1)))
-> IO (SymExpr sym (BaseBVType 1))
-> IO (SymExpr sym (BaseBVType 1))
forall a b. (a -> b) -> a -> b
$ do
        SymExpr sym BaseBoolType
isPos <- forall sym (fi :: FloatInfo).
IsInterpretedFloatExprBuilder sym =>
sym -> SymInterpretedFloat sym fi -> IO (Pred sym)
iFloatIsPos @_ @fi sym
sym RegValue sym (FloatType fi)
SymInterpretedFloat sym fi
op
        IO (SymExpr sym (BaseBVType 1)) -> IO (SymExpr sym (BaseBVType 1))
forall a. IO a -> IO a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (SymExpr sym (BaseBVType 1))
 -> IO (SymExpr sym (BaseBVType 1)))
-> IO (SymExpr sym (BaseBVType 1))
-> IO (SymExpr sym (BaseBVType 1))
forall a b. (a -> b) -> a -> b
$ sym
-> SymExpr sym BaseBoolType
-> SymExpr sym (BaseBVType 1)
-> SymExpr sym (BaseBVType 1)
-> IO (SymExpr sym (BaseBVType 1))
forall (w :: Natural).
(1 <= w) =>
sym
-> SymExpr sym BaseBoolType
-> SymBV sym w
-> SymBV sym w
-> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> Pred sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
bvIte sym
sym SymExpr sym BaseBoolType
isPos SymExpr sym (BaseBVType 1)
bit SymExpr sym (BaseBVType 1)
bvZero

  let negAndPos :: IO (SymExpr sym (BaseBVType 1))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1))
negAndPos IO (SymExpr sym (BaseBVType 1))
doCheck = IO (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1))
 -> OverrideSim
      p
      sym
      ext
      r
      args
      ret
      (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1)))
-> IO (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1))
forall a b. (a -> b) -> a -> b
$ do
        SymExpr sym (BaseBVType 1)
check <- IO (SymExpr sym (BaseBVType 1))
doCheck
        SymExpr sym (BaseBVType 1)
checkN <- SymExpr sym (BaseBVType 1) -> IO (SymExpr sym (BaseBVType 1))
negative SymExpr sym (BaseBVType 1)
check
        SymExpr sym (BaseBVType 1)
checkP <- SymExpr sym (BaseBVType 1) -> IO (SymExpr sym (BaseBVType 1))
positive SymExpr sym (BaseBVType 1)
check
        (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1))
-> IO (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1))
forall a. a -> IO a
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure (SymExpr sym (BaseBVType 1)
checkN, SymExpr sym (BaseBVType 1)
checkP)

  let callIsInf :: SymInterpretedFloat sym fi -> IO (SymExpr sym (BaseBVType 1))
callIsInf SymInterpretedFloat sym fi
x = do
        SymExpr sym BaseBoolType
isInf <- forall sym (fi :: FloatInfo).
IsInterpretedFloatExprBuilder sym =>
sym -> SymInterpretedFloat sym fi -> IO (Pred sym)
iFloatIsInf @_ @fi sym
sym SymInterpretedFloat sym fi
x
        sym
-> SymExpr sym BaseBoolType
-> SymExpr sym (BaseBVType 1)
-> SymExpr sym (BaseBVType 1)
-> IO (SymExpr sym (BaseBVType 1))
forall (w :: Natural).
(1 <= w) =>
sym
-> SymExpr sym BaseBoolType
-> SymBV sym w
-> SymBV sym w
-> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> Pred sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
bvIte sym
sym SymExpr sym BaseBoolType
isInf SymExpr sym (BaseBVType 1)
bvOne SymExpr sym (BaseBVType 1)
bvZero

  let callIsNormal :: SymInterpretedFloat sym fi -> IO (SymExpr sym (BaseBVType 1))
callIsNormal SymInterpretedFloat sym fi
x = do
        SymExpr sym BaseBoolType
isNorm <- forall sym (fi :: FloatInfo).
IsInterpretedFloatExprBuilder sym =>
sym -> SymInterpretedFloat sym fi -> IO (Pred sym)
iFloatIsNorm @_ @fi sym
sym SymInterpretedFloat sym fi
x
        sym
-> SymExpr sym BaseBoolType
-> SymExpr sym (BaseBVType 1)
-> SymExpr sym (BaseBVType 1)
-> IO (SymExpr sym (BaseBVType 1))
forall (w :: Natural).
(1 <= w) =>
sym
-> SymExpr sym BaseBoolType
-> SymBV sym w
-> SymBV sym w
-> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> Pred sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
bvIte sym
sym SymExpr sym BaseBoolType
isNorm SymExpr sym (BaseBVType 1)
bvOne SymExpr sym (BaseBVType 1)
bvZero

  let callIsSubnormal :: SymInterpretedFloat sym fi -> IO (SymExpr sym (BaseBVType 1))
callIsSubnormal SymInterpretedFloat sym fi
x = do
        SymExpr sym BaseBoolType
isSubnorm <- forall sym (fi :: FloatInfo).
IsInterpretedFloatExprBuilder sym =>
sym -> SymInterpretedFloat sym fi -> IO (Pred sym)
iFloatIsSubnorm @_ @fi sym
sym SymInterpretedFloat sym fi
x
        sym
-> SymExpr sym BaseBoolType
-> SymExpr sym (BaseBVType 1)
-> SymExpr sym (BaseBVType 1)
-> IO (SymExpr sym (BaseBVType 1))
forall (w :: Natural).
(1 <= w) =>
sym
-> SymExpr sym BaseBoolType
-> SymBV sym w
-> SymBV sym w
-> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> Pred sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
bvIte sym
sym SymExpr sym BaseBoolType
isSubnorm SymExpr sym (BaseBVType 1)
bvOne SymExpr sym (BaseBVType 1)
bvZero

  let callIsZero :: SymInterpretedFloat sym fi -> IO (SymExpr sym (BaseBVType 1))
callIsZero SymInterpretedFloat sym fi
x = do
        SymExpr sym BaseBoolType
is0 <- forall sym (fi :: FloatInfo).
IsInterpretedFloatExprBuilder sym =>
sym -> SymInterpretedFloat sym fi -> IO (Pred sym)
iFloatIsZero @_ @fi sym
sym SymInterpretedFloat sym fi
x
        sym
-> SymExpr sym BaseBoolType
-> SymExpr sym (BaseBVType 1)
-> SymExpr sym (BaseBVType 1)
-> IO (SymExpr sym (BaseBVType 1))
forall (w :: Natural).
(1 <= w) =>
sym
-> SymExpr sym BaseBoolType
-> SymBV sym w
-> SymBV sym w
-> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> Pred sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
bvIte sym
sym SymExpr sym BaseBoolType
is0 SymExpr sym (BaseBVType 1)
bvOne SymExpr sym (BaseBVType 1)
bvZero

  SymExpr sym (BaseBVType 1)
isNan <- bak
-> NatRepr 1
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType 1))
forall (fi :: FloatInfo) (w :: Natural) p sym bak ext r
       (args :: Ctx CrucibleType) (ret :: CrucibleType).
(IsSymBackend sym bak, 1 <= w) =>
bak
-> NatRepr w
-> RegEntry sym (FloatType fi)
-> OverrideSim p sym ext r args ret (RegValue sym (BVType w))
Libc.callIsnan bak
bak NatRepr 1
w1 RegEntry sym (FloatType fi)
regOp
  (SymExpr sym (BaseBVType 1)
isInfN, SymExpr sym (BaseBVType 1)
isInfP) <- IO (SymExpr sym (BaseBVType 1))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1))
negAndPos (IO (SymExpr sym (BaseBVType 1))
 -> OverrideSim
      p
      sym
      ext
      r
      args
      ret
      (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1)))
-> IO (SymExpr sym (BaseBVType 1))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1))
forall a b. (a -> b) -> a -> b
$ SymInterpretedFloat sym fi -> IO (SymExpr sym (BaseBVType 1))
callIsInf RegValue sym (FloatType fi)
SymInterpretedFloat sym fi
op
  (SymExpr sym (BaseBVType 1)
isNormN, SymExpr sym (BaseBVType 1)
isNormP) <- IO (SymExpr sym (BaseBVType 1))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1))
negAndPos (IO (SymExpr sym (BaseBVType 1))
 -> OverrideSim
      p
      sym
      ext
      r
      args
      ret
      (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1)))
-> IO (SymExpr sym (BaseBVType 1))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1))
forall a b. (a -> b) -> a -> b
$ SymInterpretedFloat sym fi -> IO (SymExpr sym (BaseBVType 1))
callIsNormal RegValue sym (FloatType fi)
SymInterpretedFloat sym fi
op
  (SymExpr sym (BaseBVType 1)
isSubnormN, SymExpr sym (BaseBVType 1)
isSubnormP) <- IO (SymExpr sym (BaseBVType 1))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1))
negAndPos (IO (SymExpr sym (BaseBVType 1))
 -> OverrideSim
      p
      sym
      ext
      r
      args
      ret
      (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1)))
-> IO (SymExpr sym (BaseBVType 1))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1))
forall a b. (a -> b) -> a -> b
$ SymInterpretedFloat sym fi -> IO (SymExpr sym (BaseBVType 1))
callIsSubnormal RegValue sym (FloatType fi)
SymInterpretedFloat sym fi
op
  (SymExpr sym (BaseBVType 1)
isZeroN, SymExpr sym (BaseBVType 1)
isZeroP) <- IO (SymExpr sym (BaseBVType 1))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1))
negAndPos (IO (SymExpr sym (BaseBVType 1))
 -> OverrideSim
      p
      sym
      ext
      r
      args
      ret
      (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1)))
-> IO (SymExpr sym (BaseBVType 1))
-> OverrideSim
     p
     sym
     ext
     r
     args
     ret
     (SymExpr sym (BaseBVType 1), SymExpr sym (BaseBVType 1))
forall a b. (a -> b) -> a -> b
$ SymInterpretedFloat sym fi -> IO (SymExpr sym (BaseBVType 1))
callIsZero RegValue sym (FloatType fi)
SymInterpretedFloat sym fi
op

  (SymExpr sym (BaseBVType 1)
 -> (Natural, SymExpr sym (BaseBVType 1))
 -> OverrideSim p sym ext r args ret (SymExpr sym (BaseBVType 1)))
-> SymExpr sym (BaseBVType 1)
-> [(Natural, SymExpr sym (BaseBVType 1))]
-> OverrideSim p sym ext r args ret (SymExpr sym (BaseBVType 1))
forall (t :: Type -> Type) (m :: Type -> Type) b a.
(Foldable t, Monad m) =>
(b -> a -> m b) -> b -> t a -> m b
foldM
    (\SymExpr sym (BaseBVType 1)
bits (Natural
bitNum, SymExpr sym (BaseBVType 1)
check) -> IO (SymExpr sym (BaseBVType 1))
-> OverrideSim p sym ext r args ret (SymExpr sym (BaseBVType 1))
forall a. IO a -> OverrideSim p sym ext r args ret a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (SymExpr sym (BaseBVType 1))
 -> OverrideSim p sym ext r args ret (SymExpr sym (BaseBVType 1)))
-> IO (SymExpr sym (BaseBVType 1))
-> OverrideSim p sym ext r args ret (SymExpr sym (BaseBVType 1))
forall a b. (a -> b) -> a -> b
$ do
        SymExpr sym BaseBoolType
isBitSet <- IO (SymExpr sym BaseBoolType) -> IO (SymExpr sym BaseBoolType)
forall a. IO a -> IO a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (SymExpr sym BaseBoolType) -> IO (SymExpr sym BaseBoolType))
-> IO (SymExpr sym BaseBoolType) -> IO (SymExpr sym BaseBoolType)
forall a b. (a -> b) -> a -> b
$ sym -> Natural -> SymBV sym 32 -> IO (SymExpr sym BaseBoolType)
forall (w :: Natural).
(1 <= w) =>
sym -> Natural -> SymBV sym w -> IO (SymExpr sym BaseBoolType)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> Natural -> SymBV sym w -> IO (Pred sym)
testBitBV sym
sym Natural
bitNum RegValue sym (BVType 32)
SymBV sym 32
test
        SymExpr sym (BaseBVType 1)
newBit <- IO (SymExpr sym (BaseBVType 1)) -> IO (SymExpr sym (BaseBVType 1))
forall a. IO a -> IO a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (SymExpr sym (BaseBVType 1))
 -> IO (SymExpr sym (BaseBVType 1)))
-> IO (SymExpr sym (BaseBVType 1))
-> IO (SymExpr sym (BaseBVType 1))
forall a b. (a -> b) -> a -> b
$ sym
-> SymExpr sym BaseBoolType
-> SymExpr sym (BaseBVType 1)
-> SymExpr sym (BaseBVType 1)
-> IO (SymExpr sym (BaseBVType 1))
forall (w :: Natural).
(1 <= w) =>
sym
-> SymExpr sym BaseBoolType
-> SymBV sym w
-> SymBV sym w
-> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> Pred sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
bvIte sym
sym SymExpr sym BaseBoolType
isBitSet SymExpr sym (BaseBVType 1)
check SymExpr sym (BaseBVType 1)
bvZero
        IO (SymExpr sym (BaseBVType 1)) -> IO (SymExpr sym (BaseBVType 1))
forall a. IO a -> IO a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (SymExpr sym (BaseBVType 1))
 -> IO (SymExpr sym (BaseBVType 1)))
-> IO (SymExpr sym (BaseBVType 1))
-> IO (SymExpr sym (BaseBVType 1))
forall a b. (a -> b) -> a -> b
$ sym
-> SymExpr sym (BaseBVType 1)
-> SymExpr sym (BaseBVType 1)
-> IO (SymExpr sym (BaseBVType 1))
forall (w :: Natural).
(1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
forall sym (w :: Natural).
(IsExprBuilder sym, 1 <= w) =>
sym -> SymBV sym w -> SymBV sym w -> IO (SymBV sym w)
bvOrBits sym
sym SymExpr sym (BaseBVType 1)
newBit SymExpr sym (BaseBVType 1)
bits)
    SymExpr sym (BaseBVType 1)
bvZero
    [ (Natural
0, SymExpr sym (BaseBVType 1)
isNan)      -- Signaling NaN
    , (Natural
1, SymExpr sym (BaseBVType 1)
isNan)      -- Quiet NaN
    , (Natural
2, SymExpr sym (BaseBVType 1)
isInfN)     -- Negative infinity
    , (Natural
3, SymExpr sym (BaseBVType 1)
isNormN)    -- Negative normal
    , (Natural
4, SymExpr sym (BaseBVType 1)
isSubnormN) -- Negative subnormal
    , (Natural
5, SymExpr sym (BaseBVType 1)
isZeroN)    -- Negative zero
    , (Natural
6, SymExpr sym (BaseBVType 1)
isZeroP)    -- Positive zero
    , (Natural
7, SymExpr sym (BaseBVType 1)
isSubnormP) -- Positive subnormal
    , (Natural
8, SymExpr sym (BaseBVType 1)
isNormP)    -- Positive normal
    , (Natural
9, SymExpr sym (BaseBVType 1)
isInfP)     -- Positive infinity
    ]
  where
    sym :: sym
sym = bak -> sym
forall sym bak. HasSymInterface sym bak => bak -> sym
backendGetSym bak
bak
    w1 :: NatRepr 1
w1 = forall (n :: Natural). KnownNat n => NatRepr n
knownNat @1