Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Defines the expression abstraction to express arithmetic and logic
operations within the formal description of RISC-V instructions. The
abstraction is just a non-monadic algebraic data type called Expr
.
In addition to the the data type definition, this module also provides
several smart constructors for utilzing the expression lanuage, these
are generated using template-haskell.
Synopsis
- data Expr a
- = FromImm a
- | FromInt Int Integer
- | ZExt Int (Expr a)
- | SExt Int (Expr a)
- | Extract Int Int (Expr a)
- | Add (Expr a) (Expr a)
- | Sub (Expr a) (Expr a)
- | Eq (Expr a) (Expr a)
- | Slt (Expr a) (Expr a)
- | Sge (Expr a) (Expr a)
- | Ult (Expr a) (Expr a)
- | Uge (Expr a) (Expr a)
- | And (Expr a) (Expr a)
- | Or (Expr a) (Expr a)
- | Xor (Expr a) (Expr a)
- | LShl (Expr a) (Expr a)
- | LShr (Expr a) (Expr a)
- | AShr (Expr a) (Expr a)
- | Mul (Expr a) (Expr a)
- | UDiv (Expr a) (Expr a)
- | SDiv (Expr a) (Expr a)
- | URem (Expr a) (Expr a)
- | SRem (Expr a) (Expr a)
- and :: a -> a -> Expr a
- or :: a -> a -> Expr a
- xor :: a -> a -> Expr a
- slt :: a -> a -> Expr a
- sge :: a -> a -> Expr a
- sdiv :: a -> a -> Expr a
- srem :: a -> a -> Expr a
- ashr :: a -> a -> Expr a
- eq :: a -> a -> Expr a
- add :: a -> a -> Expr a
- mul :: a -> a -> Expr a
- regShamt :: Int -> Expr a -> Expr a
- zextImm :: Int -> a -> Expr a
- sextImm :: Int -> a -> Expr a
- addImm :: a -> a -> Expr a
- subImm :: a -> a -> Expr a
- eqImm :: a -> a -> Expr a
- sltImm :: a -> a -> Expr a
- sgeImm :: a -> a -> Expr a
- ultImm :: a -> a -> Expr a
- ugeImm :: a -> a -> Expr a
- andImm :: a -> a -> Expr a
- orImm :: a -> a -> Expr a
- xorImm :: a -> a -> Expr a
- lshlImm :: a -> a -> Expr a
- lshrImm :: a -> a -> Expr a
- ashrImm :: a -> a -> Expr a
- mulImm :: a -> a -> Expr a
- udivImm :: a -> a -> Expr a
- sdivImm :: a -> a -> Expr a
- uremImm :: a -> a -> Expr a
- sremImm :: a -> a -> Expr a
- sub :: a -> a -> Expr a
- ult :: a -> a -> Expr a
- uge :: a -> a -> Expr a
- lshl :: a -> a -> Expr a
- lshr :: a -> a -> Expr a
- udiv :: a -> a -> Expr a
- urem :: a -> a -> Expr a
Documentation
FromImm a | Create a new |
FromInt Int Integer | Create an expression from a concrete |
ZExt Int (Expr a) | Zero extend an expression by adding the given amount of bits to it, for example, an 8-bit value can be zero-extended to 32-bit by passing 24 as the first argument. |
SExt Int (Expr a) | Same as |
Extract Int Int (Expr a) | Extract a specified amount of bits from an expression. The first argument specifies the first bit which should be extracted, the second specifies the amount of bits to extract. |
Add (Expr a) (Expr a) | |
Sub (Expr a) (Expr a) | |
Eq (Expr a) (Expr a) | |
Slt (Expr a) (Expr a) | |
Sge (Expr a) (Expr a) | |
Ult (Expr a) (Expr a) | |
Uge (Expr a) (Expr a) | |
And (Expr a) (Expr a) | |
Or (Expr a) (Expr a) | |
Xor (Expr a) (Expr a) | |
LShl (Expr a) (Expr a) | |
LShr (Expr a) (Expr a) | |
AShr (Expr a) (Expr a) | |
Mul (Expr a) (Expr a) | |
UDiv (Expr a) (Expr a) | |
SDiv (Expr a) (Expr a) | |
URem (Expr a) (Expr a) | |
SRem (Expr a) (Expr a) |