{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_HADDOCK hide, prune, not-home #-}

module MLIR.AST.Dialect.Generated.Arith where

import Prelude (Int, Double, Maybe(..), Bool(..), (++), (<$>), ($), (<>), Show)
import qualified Prelude
import Data.Int (Int64)
import qualified Data.Maybe
import Data.Array (Ix)
import qualified Data.Array.IArray as IArray
import qualified Data.ByteString as BS
import qualified Data.Map.Strict as M
import qualified Control.Monad

import MLIR.AST ( Attribute(..), Type(..), AbstractOperation(..), ResultTypes(..)
                , Location(..), Signedness(..), DenseElements(..)
                , NamedAttributes, Name
                , pattern NoAttrs )
import qualified MLIR.AST as AST
import MLIR.AST.Builder (Value, EndOfBlock, MonadBlockBuilder, RegionBuilderT)
import qualified MLIR.AST.Builder as AST
import qualified MLIR.AST.IStorableArray as AST
import qualified MLIR.AST.PatternUtil as PatternUtil
import qualified MLIR.AST.Dialect.Affine as Affine

-- * addf
-- $addf
-- 
-- The @addf@ operation takes two operands and returns one result, each of
-- these is required to be the same type. This type may be a floating point
-- scalar type, a vector whose element type is a floating point type, or a
-- floating point tensor.
-- 
-- Example:
-- 
-- @
-- // Scalar addition.
-- %a = arith.addf %b, %c : f64
-- 
-- // SIMD vector addition, e.g. for Intel SSE.
-- %f = arith.addf %g, %h : vector\<4xf32>
-- 
-- // Tensor addition.
-- %x = arith.addf %y, %z : tensor\<4x?xbf16>
-- @
-- 
-- TODO: In the distant future, this will accept optional attributes for fast
-- math, contraction, rounding mode, and other controls.
--   

-- | A pattern for @arith.addf@.
pattern AddF :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bAddF :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mAddF :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
AddF loc ty lhs_ rhs_  = Operation
          { opName = "arith.addf"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.addf@.
addf :: () => MonadBlockBuilder m => Value -> Value -> m Value
addf :: Value -> Value -> m Value
addf  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.addf"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * addi
-- $addi
-- 
-- Performs N-bit addition on the operands. The operands are interpreted as 
-- unsigned bitvectors. The result is represented by a bitvector containing the 
-- mathematical value of the addition modulo 2^n, where @n@ is the bitwidth. 
-- Because @arith@ integers use a two\'s complement representation, this operation 
-- is applicable on both signed and unsigned integer operands.
-- 
-- The @addi@ operation takes two operands and returns one result, each of
-- these is required to be the same type. This type may be an integer scalar type, 
-- a vector whose element type is integer, or a tensor of integers.
-- 
-- This op supports @nuw@/@nsw@ overflow flags which stands stand for
-- \"No Unsigned Wrap\" and \"No Signed Wrap\", respectively. If the @nuw@ and/or
-- @nsw@ flags are present, and an unsigned/signed overflow occurs
-- (respectively), the result is poison.
-- 
-- Example:
-- 
-- @
-- // Scalar addition.
-- %a = arith.addi %b, %c : i64
-- 
-- // Scalar addition with overflow flags.
-- %a = arith.addi %b, %c overflow\<nsw, nuw> : i64
-- 
-- // SIMD vector element-wise addition.
-- %f = arith.addi %g, %h : vector\<4xi32>
-- 
-- // Tensor element-wise addition.
-- %x = arith.addi %y, %z : tensor\<4x?xi8>
-- @
--   

-- | A pattern for @arith.addi@.
pattern AddI :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bAddI :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mAddI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
AddI loc ty lhs_ rhs_  = Operation
          { opName = "arith.addi"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.addi@.
addi :: () => MonadBlockBuilder m => Value -> Value -> m Value
addi :: Value -> Value -> m Value
addi  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.addi"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * addui_extended
-- $addui_extended
-- 
-- Performs (N+1)-bit addition on zero-extended operands. Returns two results:
-- the N-bit sum (same type as both operands), and the overflow bit
-- (boolean-like), where @1@ indicates unsigned addition overflow, while @0@
-- indicates no overflow.
-- 
-- Example:
-- 
-- @
-- // Scalar addition.
-- %sum, %overflow = arith.addui_extended %b, %c : i64, i1
-- 
-- // Vector element-wise addition.
-- %d:2 = arith.addui_extended %e, %f : vector\<4xi32>, vector\<4xi1>
-- 
-- // Tensor element-wise addition.
-- %x:2 = arith.addui_extended %y, %z : tensor\<4x?xi8>, tensor\<4x?xi1>
-- @
--   

-- | A pattern for @arith.addui_extended@.
pattern AddUIExtended :: () => () => Location -> Type -> Type -> operand -> operand -> AbstractOperation operand
pattern $bAddUIExtended :: Location
-> Type -> Type -> operand -> operand -> AbstractOperation operand
$mAddUIExtended :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
AddUIExtended loc ty0 ty1 lhs_ rhs_  = Operation
          { opName = "arith.addui_extended"
          , opLocation = loc
          , opResultTypes = Explicit [ty0, ty1]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.addui_extended@.
addui_extended :: () => MonadBlockBuilder m => Type -> Type -> Value -> Value -> m [Value]
addui_extended :: Type -> Type -> Value -> Value -> m [Value]
addui_extended Type
ty0 Type
ty1 Value
lhs_ Value
rhs_   = do
  (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.addui_extended"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [Type
ty0, Type
ty1]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * andi
-- $andi
-- 
-- The @andi@ operation takes two operands and returns one result, each of
-- these is required to be the same type. This type may be an integer scalar
-- type, a vector whose element type is integer, or a tensor of integers. It
-- has no standard attributes.
-- 
-- Example:
-- 
-- @
-- // Scalar integer bitwise and.
-- %a = arith.andi %b, %c : i64
-- 
-- // SIMD vector element-wise bitwise integer and.
-- %f = arith.andi %g, %h : vector\<4xi32>
-- 
-- // Tensor element-wise bitwise integer and.
-- %x = arith.andi %y, %z : tensor\<4x?xi8>
-- @
--   

-- | A pattern for @arith.andi@.
pattern AndI :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bAndI :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mAndI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
AndI loc ty lhs_ rhs_  = Operation
          { opName = "arith.andi"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.andi@.
andi :: () => MonadBlockBuilder m => Value -> Value -> m Value
andi :: Value -> Value -> m Value
andi  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.andi"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * bitcast
-- $bitcast
-- 
-- Bitcast an integer or floating point value to an integer or floating point
-- value of equal bit width. When operating on vectors, casts elementwise.
-- 
-- Note that this implements a logical bitcast independent of target
-- endianness. This allows constant folding without target information and is
-- consitent with the bitcast constant folders in LLVM (see
-- https://github.com/llvm/llvm-project/blob/18c19414eb/llvm/lib/IR/ConstantFold.cpp\#L168)
-- For targets where the source and target type have the same endianness (which
-- is the standard), this cast will also change no bits at runtime, but it may
-- still require an operation, for example if the machine has different
-- floating point and integer register files. For targets that have a different
-- endianness for the source and target types (e.g. float is big-endian and
-- integer is little-endian) a proper lowering would add operations to swap the
-- order of words in addition to the bitcast.
--   

-- | A pattern for @arith.bitcast@.
pattern Bitcast :: () => () => Location -> Type -> operand -> AbstractOperation operand
pattern $bBitcast :: Location -> Type -> operand -> AbstractOperation operand
$mBitcast :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> r) -> (Void# -> r) -> r
Bitcast loc ty0 in__  = Operation
          { opName = "arith.bitcast"
          , opLocation = loc
          , opResultTypes = Explicit [ty0]
          , opOperands = [in__]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.bitcast@.
bitcast :: () => MonadBlockBuilder m => Type -> Value -> m Value
bitcast :: Type -> Value -> m Value
bitcast Type
ty0 Value
in__   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.bitcast"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [Type
ty0]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
in__)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * ceildivsi
-- $ceildivsi
-- 
-- Signed integer division. Rounds towards positive infinity, i.e. @7 / -2 = -3@.
-- 
-- Divison by zero, or signed division overflow (minimum value divided by -1) 
-- is undefined behavior. When applied to @vector@ and @tensor@ values, the 
-- behavior is undefined if _any_ of its elements are divided by zero or has a 
-- signed division overflow.
-- 
-- Example:
-- 
-- @
-- // Scalar signed integer division.
-- %a = arith.ceildivsi %b, %c : i64
-- @
--   

-- | A pattern for @arith.ceildivsi@.
pattern CeilDivSI :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bCeilDivSI :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mCeilDivSI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
CeilDivSI loc ty lhs_ rhs_  = Operation
          { opName = "arith.ceildivsi"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.ceildivsi@.
ceildivsi :: () => MonadBlockBuilder m => Value -> Value -> m Value
ceildivsi :: Value -> Value -> m Value
ceildivsi  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.ceildivsi"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * ceildivui
-- $ceildivui
-- 
-- Unsigned integer division. Rounds towards positive infinity. Treats the
-- leading bit as the most significant, i.e. for @i16@ given two\'s complement
-- representation, @6 / -2 = 6 / (2^16 - 2) = 1@. 
-- 
-- Division by zero is undefined behavior. When applied to @vector@ and 
-- @tensor@ values, the behavior is undefined if _any_ elements are divided by 
-- zero.
-- 
-- Example:
-- 
-- @
-- // Scalar unsigned integer division.
-- %a = arith.ceildivui %b, %c : i64
-- @
--   

-- | A pattern for @arith.ceildivui@.
pattern CeilDivUI :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bCeilDivUI :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mCeilDivUI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
CeilDivUI loc ty lhs_ rhs_  = Operation
          { opName = "arith.ceildivui"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.ceildivui@.
ceildivui :: () => MonadBlockBuilder m => Value -> Value -> m Value
ceildivui :: Value -> Value -> m Value
ceildivui  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.ceildivui"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * cmpf
-- $cmpf
-- 
-- The @cmpf@ operation compares its two operands according to the float
-- comparison rules and the predicate specified by the respective attribute.
-- The predicate defines the type of comparison: (un)orderedness, (in)equality
-- and signed less/greater than (or equal to) as well as predicates that are
-- always true or false.  The operands must have the same type, and this type
-- must be a float type, or a vector or tensor thereof.  The result is an i1,
-- or a vector/tensor thereof having the same shape as the inputs. Unlike cmpi,
-- the operands are always treated as signed. The u prefix indicates
-- *unordered* comparison, not unsigned comparison, so \"une\" means unordered or
-- not equal. For the sake of readability by humans, custom assembly form for
-- the operation uses a string-typed attribute for the predicate.  The value of
-- this attribute corresponds to lower-cased name of the predicate constant,
-- e.g., \"one\" means \"ordered not equal\".  The string representation of the
-- attribute is merely a syntactic sugar and is converted to an integer
-- attribute by the parser.
-- 
-- Example:
-- 
-- @
-- %r1 = arith.cmpf oeq, %0, %1 : f32
-- %r2 = arith.cmpf ult, %0, %1 : tensor\<42x42xf64>
-- %r3 = \"arith.cmpf\"(%0, %1) {predicate: 0} : (f8, f8) -> i1
-- @
--   

-- * cmpi
-- $cmpi
-- 
-- The @cmpi@ operation is a generic comparison for integer-like types. Its two
-- arguments can be integers, vectors or tensors thereof as long as their types
-- match. The operation produces an i1 for the former case, a vector or a
-- tensor of i1 with the same shape as inputs in the other cases.
-- 
-- Its first argument is an attribute that defines which type of comparison is
-- performed. The following comparisons are supported:
-- 
-- -   equal (mnemonic: @\"eq\"@; integer value: @0@)
-- -   not equal (mnemonic: @\"ne\"@; integer value: @1@)
-- -   signed less than (mnemonic: @\"slt\"@; integer value: @2@)
-- -   signed less than or equal (mnemonic: @\"sle\"@; integer value: @3@)
-- -   signed greater than (mnemonic: @\"sgt\"@; integer value: @4@)
-- -   signed greater than or equal (mnemonic: @\"sge\"@; integer value: @5@)
-- -   unsigned less than (mnemonic: @\"ult\"@; integer value: @6@)
-- -   unsigned less than or equal (mnemonic: @\"ule\"@; integer value: @7@)
-- -   unsigned greater than (mnemonic: @\"ugt\"@; integer value: @8@)
-- -   unsigned greater than or equal (mnemonic: @\"uge\"@; integer value: @9@)
-- 
-- The result is @1@ if the comparison is true and @0@ otherwise. For vector or
-- tensor operands, the comparison is performed elementwise and the element of
-- the result indicates whether the comparison is true for the operand elements
-- with the same indices as those of the result.
-- 
-- Note: while the custom assembly form uses strings, the actual underlying
-- attribute has integer type (or rather enum class in C++ code) as seen from
-- the generic assembly form. String literals are used to improve readability
-- of the IR by humans.
-- 
-- This operation only applies to integer-like operands, but not floats. The
-- main reason being that comparison operations have diverging sets of
-- attributes: integers require sign specification while floats require various
-- floating point-related particularities, e.g., @-ffast-math@ behavior,
-- IEEE754 compliance, etc
-- (rationale.
-- The type of comparison is specified as attribute to avoid introducing ten
-- similar operations, taking into account that they are often implemented
-- using the same operation downstream
-- (rationale. The
-- separation between signed and unsigned order comparisons is necessary
-- because of integers being signless. The comparison operation must know how
-- to interpret values with the foremost bit being set: negatives in two\'s
-- complement or large positives
-- (rationale.
-- 
-- Example:
-- 
-- @
-- // Custom form of scalar \"signed less than\" comparison.
-- %x = arith.cmpi slt, %lhs, %rhs : i32
-- 
-- // Generic form of the same operation.
-- %x = \"arith.cmpi\"(%lhs, %rhs) {predicate = 2 : i64} : (i32, i32) -> i1
-- 
-- // Custom form of vector equality comparison.
-- %x = arith.cmpi eq, %lhs, %rhs : vector\<4xi64>
-- 
-- // Generic form of the same operation.
-- %x = \"arith.cmpi\"(%lhs, %rhs) {predicate = 0 : i64}
--     : (vector\<4xi64>, vector\<4xi64>) -> vector\<4xi1>
-- @
--   

-- * constant
-- $constant
-- 
-- The @constant@ operation produces an SSA value equal to some integer or
-- floating-point constant specified by an attribute. This is the way MLIR
-- forms simple integer and floating point constants.
-- 
-- Example:
-- 
-- @
-- // Integer constant
-- %1 = arith.constant 42 : i32
-- 
-- // Equivalent generic form
-- %1 = \"arith.constant\"() {value = 42 : i32} : () -> i32
-- @
--   

pattern InternalConstantOpAttributes :: () => () => Attribute -> NamedAttributes
pattern $bInternalConstantOpAttributes :: Attribute -> Map Name Attribute
$mInternalConstantOpAttributes :: forall r.
Map Name Attribute -> (Attribute -> r) -> (Void# -> r) -> r
InternalConstantOpAttributes value_ <- ((\m -> (M.lookup "value" m)) -> (Just (value_)))
  where InternalConstantOpAttributes Attribute
value_ = [(Name, Attribute)] -> Map Name Attribute
forall k a. Ord k => [(k, a)] -> Map k a
M.fromList ([(Name, Attribute)] -> Map Name Attribute)
-> [(Name, Attribute)] -> Map Name Attribute
forall a b. (a -> b) -> a -> b
$ [(Name
"value", Attribute
value_)]

-- | A pattern for @arith.constant@.
pattern Constant :: () => () => Location -> Type -> Attribute -> AbstractOperation operand
pattern $bConstant :: Location -> Type -> Attribute -> AbstractOperation operand
$mConstant :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> Attribute -> r) -> (Void# -> r) -> r
Constant loc ty0  value_ = Operation
          { opName = "arith.constant"
          , opLocation = loc
          , opResultTypes = Explicit [ty0]
          , opOperands = []
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (InternalConstantOpAttributes value_)
          }

-- | A builder for @arith.constant@.
constant :: () => MonadBlockBuilder m => Type -> Attribute -> m Value
constant :: Type -> Attribute -> m Value
constant Type
ty0  Attribute
value_  = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.constant"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [Type
ty0]
          , opOperands :: [Name]
opOperands = []
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Attribute -> Map Name Attribute
InternalConstantOpAttributes Attribute
value_)
          }))

-- | A pattern for @arith.divf@.
pattern DivF :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bDivF :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mDivF :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
DivF loc ty lhs_ rhs_  = Operation
          { opName = "arith.divf"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.divf@.
divf :: () => MonadBlockBuilder m => Value -> Value -> m Value
divf :: Value -> Value -> m Value
divf  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.divf"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * divsi
-- $divsi
-- 
-- Signed integer division. Rounds towards zero. Treats the leading bit as
-- sign, i.e. @6 / -2 = -3@.
-- 
-- Divison by zero, or signed division overflow (minimum value divided by -1) 
-- is undefined behavior. When applied to @vector@ and @tensor@ values, the 
-- behavior is undefined if _any_ of its elements are divided by zero or has a 
-- signed division overflow.
-- 
-- Example:
-- 
-- @
-- // Scalar signed integer division.
-- %a = arith.divsi %b, %c : i64
-- 
-- // SIMD vector element-wise division.
-- %f = arith.divsi %g, %h : vector\<4xi32>
-- 
-- // Tensor element-wise integer division.
-- %x = arith.divsi %y, %z : tensor\<4x?xi8>
-- @
--   

-- | A pattern for @arith.divsi@.
pattern DivSI :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bDivSI :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mDivSI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
DivSI loc ty lhs_ rhs_  = Operation
          { opName = "arith.divsi"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.divsi@.
divsi :: () => MonadBlockBuilder m => Value -> Value -> m Value
divsi :: Value -> Value -> m Value
divsi  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.divsi"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * divui
-- $divui
-- 
-- Unsigned integer division. Rounds towards zero. Treats the leading bit as
-- the most significant, i.e. for @i16@ given two\'s complement representation,
-- @6 / -2 = 6 / (2^16 - 2) = 0@.
-- 
-- Division by zero is undefined behavior. When applied to @vector@ and 
-- @tensor@ values, the behavior is undefined if _any_ elements are divided by 
-- zero.
-- 
-- Example:
-- 
-- @
-- // Scalar unsigned integer division.
-- %a = arith.divui %b, %c : i64
-- 
-- // SIMD vector element-wise division.
-- %f = arith.divui %g, %h : vector\<4xi32>
-- 
-- // Tensor element-wise integer division.
-- %x = arith.divui %y, %z : tensor\<4x?xi8>
-- @
--   

-- | A pattern for @arith.divui@.
pattern DivUI :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bDivUI :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mDivUI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
DivUI loc ty lhs_ rhs_  = Operation
          { opName = "arith.divui"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.divui@.
divui :: () => MonadBlockBuilder m => Value -> Value -> m Value
divui :: Value -> Value -> m Value
divui  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.divui"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * extf
-- $extf
-- 
-- Cast a floating-point value to a larger floating-point-typed value.
-- The destination type must to be strictly wider than the source type.
-- When operating on vectors, casts elementwise.
--   

-- | A pattern for @arith.extf@.
pattern ExtF :: () => () => Location -> Type -> operand -> AbstractOperation operand
pattern $bExtF :: Location -> Type -> operand -> AbstractOperation operand
$mExtF :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> r) -> (Void# -> r) -> r
ExtF loc ty0 in__  = Operation
          { opName = "arith.extf"
          , opLocation = loc
          , opResultTypes = Explicit [ty0]
          , opOperands = [in__]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.extf@.
extf :: () => MonadBlockBuilder m => Type -> Value -> m Value
extf :: Type -> Value -> m Value
extf Type
ty0 Value
in__   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.extf"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [Type
ty0]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
in__)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * extsi
-- $extsi
-- 
-- The integer sign extension operation takes an integer input of
-- width M and an integer destination type of width N. The destination
-- bit-width must be larger than the input bit-width (N > M).
-- The top-most (N - M) bits of the output are filled with copies
-- of the most-significant bit of the input.
-- 
-- Example:
-- 
-- @
-- %1 = arith.constant 5 : i3      // %1 is 0b101
-- %2 = arith.extsi %1 : i3 to i6  // %2 is 0b111101
-- %3 = arith.constant 2 : i3      // %3 is 0b010
-- %4 = arith.extsi %3 : i3 to i6  // %4 is 0b000010
-- 
-- %5 = arith.extsi %0 : vector\<2 x i32> to vector\<2 x i64>
-- @
--   

-- | A pattern for @arith.extsi@.
pattern ExtSI :: () => () => Location -> Type -> operand -> AbstractOperation operand
pattern $bExtSI :: Location -> Type -> operand -> AbstractOperation operand
$mExtSI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> r) -> (Void# -> r) -> r
ExtSI loc ty0 in__  = Operation
          { opName = "arith.extsi"
          , opLocation = loc
          , opResultTypes = Explicit [ty0]
          , opOperands = [in__]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.extsi@.
extsi :: () => MonadBlockBuilder m => Type -> Value -> m Value
extsi :: Type -> Value -> m Value
extsi Type
ty0 Value
in__   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.extsi"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [Type
ty0]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
in__)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * extui
-- $extui
-- 
-- The integer zero extension operation takes an integer input of
-- width M and an integer destination type of width N. The destination
-- bit-width must be larger than the input bit-width (N > M).
-- The top-most (N - M) bits of the output are filled with zeros.
-- 
-- Example:
-- 
-- @
--   %1 = arith.constant 5 : i3      // %1 is 0b101
--   %2 = arith.extui %1 : i3 to i6  // %2 is 0b000101
--   %3 = arith.constant 2 : i3      // %3 is 0b010
--   %4 = arith.extui %3 : i3 to i6  // %4 is 0b000010
-- 
--   %5 = arith.extui %0 : vector\<2 x i32> to vector\<2 x i64>
-- @
--   

-- | A pattern for @arith.extui@.
pattern ExtUI :: () => () => Location -> Type -> operand -> AbstractOperation operand
pattern $bExtUI :: Location -> Type -> operand -> AbstractOperation operand
$mExtUI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> r) -> (Void# -> r) -> r
ExtUI loc ty0 in__  = Operation
          { opName = "arith.extui"
          , opLocation = loc
          , opResultTypes = Explicit [ty0]
          , opOperands = [in__]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.extui@.
extui :: () => MonadBlockBuilder m => Type -> Value -> m Value
extui :: Type -> Value -> m Value
extui Type
ty0 Value
in__   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.extui"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [Type
ty0]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
in__)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * fptosi
-- $fptosi
-- 
-- Cast from a value interpreted as floating-point to the nearest (rounding
-- towards zero) signed integer value. When operating on vectors, casts
-- elementwise.
--   

-- | A pattern for @arith.fptosi@.
pattern FPToSI :: () => () => Location -> Type -> operand -> AbstractOperation operand
pattern $bFPToSI :: Location -> Type -> operand -> AbstractOperation operand
$mFPToSI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> r) -> (Void# -> r) -> r
FPToSI loc ty0 in__  = Operation
          { opName = "arith.fptosi"
          , opLocation = loc
          , opResultTypes = Explicit [ty0]
          , opOperands = [in__]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.fptosi@.
fptosi :: () => MonadBlockBuilder m => Type -> Value -> m Value
fptosi :: Type -> Value -> m Value
fptosi Type
ty0 Value
in__   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.fptosi"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [Type
ty0]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
in__)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * fptoui
-- $fptoui
-- 
-- Cast from a value interpreted as floating-point to the nearest (rounding
-- towards zero) unsigned integer value. When operating on vectors, casts
-- elementwise.
--   

-- | A pattern for @arith.fptoui@.
pattern FPToUI :: () => () => Location -> Type -> operand -> AbstractOperation operand
pattern $bFPToUI :: Location -> Type -> operand -> AbstractOperation operand
$mFPToUI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> r) -> (Void# -> r) -> r
FPToUI loc ty0 in__  = Operation
          { opName = "arith.fptoui"
          , opLocation = loc
          , opResultTypes = Explicit [ty0]
          , opOperands = [in__]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.fptoui@.
fptoui :: () => MonadBlockBuilder m => Type -> Value -> m Value
fptoui :: Type -> Value -> m Value
fptoui Type
ty0 Value
in__   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.fptoui"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [Type
ty0]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
in__)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * floordivsi
-- $floordivsi
-- 
-- Signed integer division. Rounds towards negative infinity, i.e. @5 / -2 = -3@.
-- 
-- Divison by zero, or signed division overflow (minimum value divided by -1) 
-- is undefined behavior. When applied to @vector@ and @tensor@ values, the 
-- behavior is undefined if _any_ of its elements are divided by zero or has a 
-- signed division overflow.
-- 
-- Example:
-- 
-- @
-- // Scalar signed integer division.
-- %a = arith.floordivsi %b, %c : i64
-- 
-- @
--   

-- | A pattern for @arith.floordivsi@.
pattern FloorDivSI :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bFloorDivSI :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mFloorDivSI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
FloorDivSI loc ty lhs_ rhs_  = Operation
          { opName = "arith.floordivsi"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.floordivsi@.
floordivsi :: () => MonadBlockBuilder m => Value -> Value -> m Value
floordivsi :: Value -> Value -> m Value
floordivsi  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.floordivsi"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * index_cast
-- $index_cast
-- 
-- Casts between scalar or vector integers and corresponding \'index\' scalar or
-- vectors. Index is an integer of platform-specific bit width. If casting to
-- a wider integer, the value is sign-extended. If casting to a narrower
-- integer, the value is truncated.
--   

-- | A pattern for @arith.index_cast@.
pattern IndexCast :: () => () => Location -> Type -> operand -> AbstractOperation operand
pattern $bIndexCast :: Location -> Type -> operand -> AbstractOperation operand
$mIndexCast :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> r) -> (Void# -> r) -> r
IndexCast loc ty0 in__  = Operation
          { opName = "arith.index_cast"
          , opLocation = loc
          , opResultTypes = Explicit [ty0]
          , opOperands = [in__]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.index_cast@.
index_cast :: () => MonadBlockBuilder m => Type -> Value -> m Value
index_cast :: Type -> Value -> m Value
index_cast Type
ty0 Value
in__   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.index_cast"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [Type
ty0]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
in__)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * index_castui
-- $index_castui
-- 
-- Casts between scalar or vector integers and corresponding \'index\' scalar or
-- vectors. Index is an integer of platform-specific bit width. If casting to
-- a wider integer, the value is zero-extended. If casting to a narrower
-- integer, the value is truncated.
--   

-- | A pattern for @arith.index_castui@.
pattern IndexCastUI :: () => () => Location -> Type -> operand -> AbstractOperation operand
pattern $bIndexCastUI :: Location -> Type -> operand -> AbstractOperation operand
$mIndexCastUI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> r) -> (Void# -> r) -> r
IndexCastUI loc ty0 in__  = Operation
          { opName = "arith.index_castui"
          , opLocation = loc
          , opResultTypes = Explicit [ty0]
          , opOperands = [in__]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.index_castui@.
index_castui :: () => MonadBlockBuilder m => Type -> Value -> m Value
index_castui :: Type -> Value -> m Value
index_castui Type
ty0 Value
in__   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.index_castui"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [Type
ty0]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
in__)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * maxnumf
-- $maxnumf
-- 
-- Returns the maximum of the two arguments.
-- If the arguments are -0.0 and +0.0, then the result is either of them.
-- If one of the arguments is NaN, then the result is the other argument.
-- 
-- Example:
-- 
-- @
-- // Scalar floating-point maximum.
-- %a = arith.maxnumf %b, %c : f64
-- @
--   

-- | A pattern for @arith.maxnumf@.
pattern MaxNumF :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bMaxNumF :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mMaxNumF :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
MaxNumF loc ty lhs_ rhs_  = Operation
          { opName = "arith.maxnumf"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.maxnumf@.
maxnumf :: () => MonadBlockBuilder m => Value -> Value -> m Value
maxnumf :: Value -> Value -> m Value
maxnumf  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.maxnumf"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- | A pattern for @arith.maxsi@.
pattern MaxSI :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bMaxSI :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mMaxSI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
MaxSI loc ty lhs_ rhs_  = Operation
          { opName = "arith.maxsi"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.maxsi@.
maxsi :: () => MonadBlockBuilder m => Value -> Value -> m Value
maxsi :: Value -> Value -> m Value
maxsi  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.maxsi"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- | A pattern for @arith.maxui@.
pattern MaxUI :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bMaxUI :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mMaxUI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
MaxUI loc ty lhs_ rhs_  = Operation
          { opName = "arith.maxui"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.maxui@.
maxui :: () => MonadBlockBuilder m => Value -> Value -> m Value
maxui :: Value -> Value -> m Value
maxui  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.maxui"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * maximumf
-- $maximumf
-- 
-- Returns the maximum of the two arguments, treating -0.0 as less than +0.0.
-- If one of the arguments is NaN, then the result is also NaN.
-- 
-- Example:
-- 
-- @
-- // Scalar floating-point maximum.
-- %a = arith.maximumf %b, %c : f64
-- @
--   

-- | A pattern for @arith.maximumf@.
pattern MaximumF :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bMaximumF :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mMaximumF :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
MaximumF loc ty lhs_ rhs_  = Operation
          { opName = "arith.maximumf"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.maximumf@.
maximumf :: () => MonadBlockBuilder m => Value -> Value -> m Value
maximumf :: Value -> Value -> m Value
maximumf  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.maximumf"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * minnumf
-- $minnumf
-- 
-- Returns the minimum of the two arguments.
-- If the arguments are -0.0 and +0.0, then the result is either of them.
-- If one of the arguments is NaN, then the result is the other argument.
-- 
-- Example:
-- 
-- @
-- // Scalar floating-point minimum.
-- %a = arith.minnumf %b, %c : f64
-- @
--   

-- | A pattern for @arith.minnumf@.
pattern MinNumF :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bMinNumF :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mMinNumF :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
MinNumF loc ty lhs_ rhs_  = Operation
          { opName = "arith.minnumf"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.minnumf@.
minnumf :: () => MonadBlockBuilder m => Value -> Value -> m Value
minnumf :: Value -> Value -> m Value
minnumf  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.minnumf"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- | A pattern for @arith.minsi@.
pattern MinSI :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bMinSI :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mMinSI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
MinSI loc ty lhs_ rhs_  = Operation
          { opName = "arith.minsi"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.minsi@.
minsi :: () => MonadBlockBuilder m => Value -> Value -> m Value
minsi :: Value -> Value -> m Value
minsi  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.minsi"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- | A pattern for @arith.minui@.
pattern MinUI :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bMinUI :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mMinUI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
MinUI loc ty lhs_ rhs_  = Operation
          { opName = "arith.minui"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.minui@.
minui :: () => MonadBlockBuilder m => Value -> Value -> m Value
minui :: Value -> Value -> m Value
minui  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.minui"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * minimumf
-- $minimumf
-- 
-- Returns the minimum of the two arguments, treating -0.0 as less than +0.0.
-- If one of the arguments is NaN, then the result is also NaN.
-- 
-- Example:
-- 
-- @
-- // Scalar floating-point minimum.
-- %a = arith.minimumf %b, %c : f64
-- @
--   

-- | A pattern for @arith.minimumf@.
pattern MinimumF :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bMinimumF :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mMinimumF :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
MinimumF loc ty lhs_ rhs_  = Operation
          { opName = "arith.minimumf"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.minimumf@.
minimumf :: () => MonadBlockBuilder m => Value -> Value -> m Value
minimumf :: Value -> Value -> m Value
minimumf  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.minimumf"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * mulf
-- $mulf
-- 
-- The @mulf@ operation takes two operands and returns one result, each of
-- these is required to be the same type. This type may be a floating point
-- scalar type, a vector whose element type is a floating point type, or a
-- floating point tensor.
-- 
-- Example:
-- 
-- @
-- // Scalar multiplication.
-- %a = arith.mulf %b, %c : f64
-- 
-- // SIMD pointwise vector multiplication, e.g. for Intel SSE.
-- %f = arith.mulf %g, %h : vector\<4xf32>
-- 
-- // Tensor pointwise multiplication.
-- %x = arith.mulf %y, %z : tensor\<4x?xbf16>
-- @
-- 
-- TODO: In the distant future, this will accept optional attributes for fast
-- math, contraction, rounding mode, and other controls.
--   

-- | A pattern for @arith.mulf@.
pattern MulF :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bMulF :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mMulF :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
MulF loc ty lhs_ rhs_  = Operation
          { opName = "arith.mulf"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.mulf@.
mulf :: () => MonadBlockBuilder m => Value -> Value -> m Value
mulf :: Value -> Value -> m Value
mulf  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.mulf"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * muli
-- $muli
-- 
-- Performs N-bit multiplication on the operands. The operands are interpreted as
-- unsigned bitvectors. The result is represented by a bitvector containing the
-- mathematical value of the multiplication modulo 2^n, where @n@ is the bitwidth.
-- Because @arith@ integers use a two\'s complement representation, this operation is
-- applicable on both signed and unsigned integer operands.
-- 
-- The @muli@ operation takes two operands and returns one result, each of
-- these is required to be the same type. This type may be an integer scalar type,
-- a vector whose element type is integer, or a tensor of integers.
-- 
-- This op supports @nuw@/@nsw@ overflow flags which stands stand for
-- \"No Unsigned Wrap\" and \"No Signed Wrap\", respectively. If the @nuw@ and/or
-- @nsw@ flags are present, and an unsigned/signed overflow occurs
-- (respectively), the result is poison.
-- 
-- Example:
-- 
-- @
-- // Scalar multiplication.
-- %a = arith.muli %b, %c : i64
-- 
-- // Scalar multiplication with overflow flags.
-- %a = arith.muli %b, %c overflow\<nsw, nuw> : i64
-- 
-- // SIMD vector element-wise multiplication.
-- %f = arith.muli %g, %h : vector\<4xi32>
-- 
-- // Tensor element-wise multiplication.
-- %x = arith.muli %y, %z : tensor\<4x?xi8>
-- @
--   

-- | A pattern for @arith.muli@.
pattern MulI :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bMulI :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mMulI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
MulI loc ty lhs_ rhs_  = Operation
          { opName = "arith.muli"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.muli@.
muli :: () => MonadBlockBuilder m => Value -> Value -> m Value
muli :: Value -> Value -> m Value
muli  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.muli"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * mulsi_extended
-- $mulsi_extended
-- 
-- Performs (2*N)-bit multiplication on sign-extended operands. Returns two
-- N-bit results: the low and the high halves of the product. The low half has
-- the same value as the result of regular multiplication @arith.muli@ with
-- the same operands.
-- 
-- Example:
-- 
-- @
-- // Scalar multiplication.
-- %low, %high = arith.mulsi_extended %a, %b : i32
-- 
-- // Vector element-wise multiplication.
-- %c:2 = arith.mulsi_extended %d, %e : vector\<4xi32>
-- 
-- // Tensor element-wise multiplication.
-- %x:2 = arith.mulsi_extended %y, %z : tensor\<4x?xi8>
-- @
--   

-- | A pattern for @arith.mulsi_extended@.
pattern MulSIExtended :: () => () => Location -> Type -> Type -> operand -> operand -> AbstractOperation operand
pattern $bMulSIExtended :: Location
-> Type -> Type -> operand -> operand -> AbstractOperation operand
$mMulSIExtended :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
MulSIExtended loc ty0 ty1 lhs_ rhs_  = Operation
          { opName = "arith.mulsi_extended"
          , opLocation = loc
          , opResultTypes = Explicit [ty0, ty1]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.mulsi_extended@.
mulsi_extended :: () => MonadBlockBuilder m => Type -> Type -> Value -> Value -> m [Value]
mulsi_extended :: Type -> Type -> Value -> Value -> m [Value]
mulsi_extended Type
ty0 Type
ty1 Value
lhs_ Value
rhs_   = do
  (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.mulsi_extended"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [Type
ty0, Type
ty1]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * mului_extended
-- $mului_extended
-- 
-- Performs (2*N)-bit multiplication on zero-extended operands. Returns two
-- N-bit results: the low and the high halves of the product. The low half has
-- the same value as the result of regular multiplication @arith.muli@ with
-- the same operands.
-- 
-- Example:
-- 
-- @
-- // Scalar multiplication.
-- %low, %high = arith.mului_extended %a, %b : i32
-- 
-- // Vector element-wise multiplication.
-- %c:2 = arith.mului_extended %d, %e : vector\<4xi32>
-- 
-- // Tensor element-wise multiplication.
-- %x:2 = arith.mului_extended %y, %z : tensor\<4x?xi8>
-- @
--   

-- | A pattern for @arith.mului_extended@.
pattern MulUIExtended :: () => () => Location -> Type -> Type -> operand -> operand -> AbstractOperation operand
pattern $bMulUIExtended :: Location
-> Type -> Type -> operand -> operand -> AbstractOperation operand
$mMulUIExtended :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
MulUIExtended loc ty0 ty1 lhs_ rhs_  = Operation
          { opName = "arith.mului_extended"
          , opLocation = loc
          , opResultTypes = Explicit [ty0, ty1]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.mului_extended@.
mului_extended :: () => MonadBlockBuilder m => Type -> Type -> Value -> Value -> m [Value]
mului_extended :: Type -> Type -> Value -> Value -> m [Value]
mului_extended Type
ty0 Type
ty1 Value
lhs_ Value
rhs_   = do
  (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.mului_extended"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [Type
ty0, Type
ty1]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * negf
-- $negf
-- 
-- The @negf@ operation computes the negation of a given value. It takes one
-- operand and returns one result of the same type. This type may be a float
-- scalar type, a vector whose element type is float, or a tensor of floats.
-- It has no standard attributes.
-- 
-- Example:
-- 
-- @
-- // Scalar negation value.
-- %a = arith.negf %b : f64
-- 
-- // SIMD vector element-wise negation value.
-- %f = arith.negf %g : vector\<4xf32>
-- 
-- // Tensor element-wise negation value.
-- %x = arith.negf %y : tensor\<4x?xf8>
-- @
--   

-- | A pattern for @arith.negf@.
pattern NegF :: () => () => Location -> Type -> operand -> AbstractOperation operand
pattern $bNegF :: Location -> Type -> operand -> AbstractOperation operand
$mNegF :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> r) -> (Void# -> r) -> r
NegF loc ty operand_  = Operation
          { opName = "arith.negf"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [operand_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.negf@.
negf :: () => MonadBlockBuilder m => Value -> m Value
negf :: Value -> m Value
negf  Value
operand_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.negf"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
operand_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
operand_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * ori
-- $ori
-- 
-- The @ori@ operation takes two operands and returns one result, each of these
-- is required to be the same type. This type may be an integer scalar type, a
-- vector whose element type is integer, or a tensor of integers. It has no
-- standard attributes.
-- 
-- Example:
-- 
-- @
-- // Scalar integer bitwise or.
-- %a = arith.ori %b, %c : i64
-- 
-- // SIMD vector element-wise bitwise integer or.
-- %f = arith.ori %g, %h : vector\<4xi32>
-- 
-- // Tensor element-wise bitwise integer or.
-- %x = arith.ori %y, %z : tensor\<4x?xi8>
-- @
--   

-- | A pattern for @arith.ori@.
pattern OrI :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bOrI :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mOrI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
OrI loc ty lhs_ rhs_  = Operation
          { opName = "arith.ori"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.ori@.
ori :: () => MonadBlockBuilder m => Value -> Value -> m Value
ori :: Value -> Value -> m Value
ori  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.ori"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * remf
-- $remf
-- 
-- Returns the floating point division remainder.
-- The remainder has the same sign as the dividend (lhs operand).
--   

-- | A pattern for @arith.remf@.
pattern RemF :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bRemF :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mRemF :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
RemF loc ty lhs_ rhs_  = Operation
          { opName = "arith.remf"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.remf@.
remf :: () => MonadBlockBuilder m => Value -> Value -> m Value
remf :: Value -> Value -> m Value
remf  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.remf"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * remsi
-- $remsi
-- 
-- Signed integer division remainder. Treats the leading bit as sign, i.e. @6 %
-- -2 = 0@.
-- 
-- Division by zero is undefined behavior. When applied to @vector@ and 
-- @tensor@ values, the behavior is undefined if _any_ elements are divided by 
-- zero.
-- 
-- Example:
-- 
-- @
-- // Scalar signed integer division remainder.
-- %a = arith.remsi %b, %c : i64
-- 
-- // SIMD vector element-wise division remainder.
-- %f = arith.remsi %g, %h : vector\<4xi32>
-- 
-- // Tensor element-wise integer division remainder.
-- %x = arith.remsi %y, %z : tensor\<4x?xi8>
-- @
--   

-- | A pattern for @arith.remsi@.
pattern RemSI :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bRemSI :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mRemSI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
RemSI loc ty lhs_ rhs_  = Operation
          { opName = "arith.remsi"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.remsi@.
remsi :: () => MonadBlockBuilder m => Value -> Value -> m Value
remsi :: Value -> Value -> m Value
remsi  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.remsi"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * remui
-- $remui
-- 
-- Unsigned integer division remainder. Treats the leading bit as the most
-- significant, i.e. for @i16@, @6 % -2 = 6 % (2^16 - 2) = 6@.
-- 
-- Division by zero is undefined behavior. When applied to @vector@ and 
-- @tensor@ values, the behavior is undefined if _any_ elements are divided by 
-- zero.
-- 
-- Example:
-- 
-- @
-- // Scalar unsigned integer division remainder.
-- %a = arith.remui %b, %c : i64
-- 
-- // SIMD vector element-wise division remainder.
-- %f = arith.remui %g, %h : vector\<4xi32>
-- 
-- // Tensor element-wise integer division remainder.
-- %x = arith.remui %y, %z : tensor\<4x?xi8>
-- @
--   

-- | A pattern for @arith.remui@.
pattern RemUI :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bRemUI :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mRemUI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
RemUI loc ty lhs_ rhs_  = Operation
          { opName = "arith.remui"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.remui@.
remui :: () => MonadBlockBuilder m => Value -> Value -> m Value
remui :: Value -> Value -> m Value
remui  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.remui"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * sitofp
-- $sitofp
-- 
-- Cast from a value interpreted as a signed integer to the corresponding
-- floating-point value. If the value cannot be exactly represented, it is
-- rounded using the default rounding mode. When operating on vectors, casts
-- elementwise.
--   

-- | A pattern for @arith.sitofp@.
pattern SIToFP :: () => () => Location -> Type -> operand -> AbstractOperation operand
pattern $bSIToFP :: Location -> Type -> operand -> AbstractOperation operand
$mSIToFP :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> r) -> (Void# -> r) -> r
SIToFP loc ty0 in__  = Operation
          { opName = "arith.sitofp"
          , opLocation = loc
          , opResultTypes = Explicit [ty0]
          , opOperands = [in__]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.sitofp@.
sitofp :: () => MonadBlockBuilder m => Type -> Value -> m Value
sitofp :: Type -> Value -> m Value
sitofp Type
ty0 Value
in__   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.sitofp"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [Type
ty0]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
in__)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * shli
-- $shli
-- 
-- The @shli@ operation shifts the integer value of the first operand to the left 
-- by the integer value of the second operand. The second operand is interpreted as 
-- unsigned. The low order bits are filled with zeros. If the value of the second 
-- operand is greater or equal than the bitwidth of the first operand, then the
-- operation returns poison.
-- 
-- This op supports @nuw@/@nsw@ overflow flags which stands stand for
-- \"No Unsigned Wrap\" and \"No Signed Wrap\", respectively. If the @nuw@ and/or
-- @nsw@ flags are present, and an unsigned/signed overflow occurs
-- (respectively), the result is poison.
-- 
-- Example:
-- 
-- @
-- %1 = arith.constant 5 : i8  // %1 is 0b00000101
-- %2 = arith.constant 3 : i8
-- %3 = arith.shli %1, %2 : i8 // %3 is 0b00101000
-- %4 = arith.shli %1, %2 overflow\<nsw, nuw> : i8  
-- @
--   

-- | A pattern for @arith.shli@.
pattern ShLI :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bShLI :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mShLI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
ShLI loc ty lhs_ rhs_  = Operation
          { opName = "arith.shli"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.shli@.
shli :: () => MonadBlockBuilder m => Value -> Value -> m Value
shli :: Value -> Value -> m Value
shli  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.shli"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * shrsi
-- $shrsi
-- 
-- The @shrsi@ operation shifts an integer value of the first operand to the right 
-- by the value of the second operand. The first operand is interpreted as signed, 
-- and the second operand is interpreter as unsigned. The high order bits in the 
-- output are filled with copies of the most-significant bit of the shifted value 
-- (which means that the sign of the value is preserved). If the value of the second 
-- operand is greater or equal than bitwidth of the first operand, then the operation
-- returns poison.
-- 
-- Example:
-- 
-- @
-- %1 = arith.constant 160 : i8               // %1 is 0b10100000
-- %2 = arith.constant 3 : i8
-- %3 = arith.shrsi %1, %2 : (i8, i8) -> i8   // %3 is 0b11110100
-- %4 = arith.constant 96 : i8                   // %4 is 0b01100000
-- %5 = arith.shrsi %4, %2 : (i8, i8) -> i8   // %5 is 0b00001100
-- @
--   

-- | A pattern for @arith.shrsi@.
pattern ShRSI :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bShRSI :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mShRSI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
ShRSI loc ty lhs_ rhs_  = Operation
          { opName = "arith.shrsi"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.shrsi@.
shrsi :: () => MonadBlockBuilder m => Value -> Value -> m Value
shrsi :: Value -> Value -> m Value
shrsi  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.shrsi"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * shrui
-- $shrui
-- 
-- The @shrui@ operation shifts an integer value of the first operand to the right 
-- by the value of the second operand. The first operand is interpreted as unsigned,
-- and the second operand is interpreted as unsigned. The high order bits are always 
-- filled with zeros. If the value of the second operand is greater or equal than the
-- bitwidth of the first operand, then the operation returns poison.
-- 
-- Example:
-- 
-- @
-- %1 = arith.constant 160 : i8               // %1 is 0b10100000
-- %2 = arith.constant 3 : i8
-- %3 = arith.shrui %1, %2 : (i8, i8) -> i8   // %3 is 0b00010100
-- @
--   

-- | A pattern for @arith.shrui@.
pattern ShRUI :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bShRUI :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mShRUI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
ShRUI loc ty lhs_ rhs_  = Operation
          { opName = "arith.shrui"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.shrui@.
shrui :: () => MonadBlockBuilder m => Value -> Value -> m Value
shrui :: Value -> Value -> m Value
shrui  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.shrui"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * subf
-- $subf
-- 
-- The @subf@ operation takes two operands and returns one result, each of
-- these is required to be the same type. This type may be a floating point
-- scalar type, a vector whose element type is a floating point type, or a
-- floating point tensor.
-- 
-- Example:
-- 
-- @
-- // Scalar subtraction.
-- %a = arith.subf %b, %c : f64
-- 
-- // SIMD vector subtraction, e.g. for Intel SSE.
-- %f = arith.subf %g, %h : vector\<4xf32>
-- 
-- // Tensor subtraction.
-- %x = arith.subf %y, %z : tensor\<4x?xbf16>
-- @
-- 
-- TODO: In the distant future, this will accept optional attributes for fast
-- math, contraction, rounding mode, and other controls.
--   

-- | A pattern for @arith.subf@.
pattern SubF :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bSubF :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mSubF :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
SubF loc ty lhs_ rhs_  = Operation
          { opName = "arith.subf"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.subf@.
subf :: () => MonadBlockBuilder m => Value -> Value -> m Value
subf :: Value -> Value -> m Value
subf  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.subf"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * subi
-- $subi
-- 
-- Performs N-bit subtraction on the operands. The operands are interpreted as unsigned
-- bitvectors. The result is represented by a bitvector containing the mathematical
-- value of the subtraction modulo 2^n, where @n@ is the bitwidth. Because @arith@
-- integers use a two\'s complement representation, this operation is applicable on
-- both signed and unsigned integer operands.
-- 
-- The @subi@ operation takes two operands and returns one result, each of
-- these is required to be the same type. This type may be an integer scalar type,
-- a vector whose element type is integer, or a tensor of integers.
-- 
-- This op supports @nuw@/@nsw@ overflow flags which stands stand for
-- \"No Unsigned Wrap\" and \"No Signed Wrap\", respectively. If the @nuw@ and/or
-- @nsw@ flags are present, and an unsigned/signed overflow occurs
-- (respectively), the result is poison.
-- 
-- Example:
-- 
-- @
-- // Scalar subtraction.
-- %a = arith.subi %b, %c : i64
-- 
-- // Scalar subtraction with overflow flags.
-- %a = arith.subi %b, %c overflow\<nsw, nuw> : i64
-- 
-- // SIMD vector element-wise subtraction.
-- %f = arith.subi %g, %h : vector\<4xi32>
-- 
-- // Tensor element-wise subtraction.
-- %x = arith.subi %y, %z : tensor\<4x?xi8>
-- @
--   

-- | A pattern for @arith.subi@.
pattern SubI :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bSubI :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mSubI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
SubI loc ty lhs_ rhs_  = Operation
          { opName = "arith.subi"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.subi@.
subi :: () => MonadBlockBuilder m => Value -> Value -> m Value
subi :: Value -> Value -> m Value
subi  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.subi"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * truncf
-- $truncf
-- 
-- Truncate a floating-point value to a smaller floating-point-typed value.
-- The destination type must be strictly narrower than the source type.
-- If the value cannot be exactly represented, it is rounded using the
-- provided rounding mode or the default one if no rounding mode is provided.
-- When operating on vectors, casts elementwise.
--   

-- | A pattern for @arith.truncf@.
pattern TruncF :: () => () => Location -> Type -> operand -> AbstractOperation operand
pattern $bTruncF :: Location -> Type -> operand -> AbstractOperation operand
$mTruncF :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> r) -> (Void# -> r) -> r
TruncF loc ty0 in__  = Operation
          { opName = "arith.truncf"
          , opLocation = loc
          , opResultTypes = Explicit [ty0]
          , opOperands = [in__]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.truncf@.
truncf :: () => MonadBlockBuilder m => Type -> Value -> m Value
truncf :: Type -> Value -> m Value
truncf Type
ty0 Value
in__   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.truncf"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [Type
ty0]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
in__)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * trunci
-- $trunci
-- 
-- The integer truncation operation takes an integer input of
-- width M and an integer destination type of width N. The destination
-- bit-width must be smaller than the input bit-width (N \< M).
-- The top-most (N - M) bits of the input are discarded.
-- 
-- Example:
-- 
-- @
--   %1 = arith.constant 21 : i5     // %1 is 0b10101
--   %2 = arith.trunci %1 : i5 to i4 // %2 is 0b0101
--   %3 = arith.trunci %1 : i5 to i3 // %3 is 0b101
-- 
--   %5 = arith.trunci %0 : vector\<2 x i32> to vector\<2 x i16>
-- @
--   

-- | A pattern for @arith.trunci@.
pattern TruncI :: () => () => Location -> Type -> operand -> AbstractOperation operand
pattern $bTruncI :: Location -> Type -> operand -> AbstractOperation operand
$mTruncI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> r) -> (Void# -> r) -> r
TruncI loc ty0 in__  = Operation
          { opName = "arith.trunci"
          , opLocation = loc
          , opResultTypes = Explicit [ty0]
          , opOperands = [in__]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.trunci@.
trunci :: () => MonadBlockBuilder m => Type -> Value -> m Value
trunci :: Type -> Value -> m Value
trunci Type
ty0 Value
in__   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.trunci"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [Type
ty0]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
in__)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * uitofp
-- $uitofp
-- 
-- Cast from a value interpreted as unsigned integer to the corresponding
-- floating-point value. If the value cannot be exactly represented, it is
-- rounded using the default rounding mode. When operating on vectors, casts
-- elementwise.
--   

-- | A pattern for @arith.uitofp@.
pattern UIToFP :: () => () => Location -> Type -> operand -> AbstractOperation operand
pattern $bUIToFP :: Location -> Type -> operand -> AbstractOperation operand
$mUIToFP :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> r) -> (Void# -> r) -> r
UIToFP loc ty0 in__  = Operation
          { opName = "arith.uitofp"
          , opLocation = loc
          , opResultTypes = Explicit [ty0]
          , opOperands = [in__]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.uitofp@.
uitofp :: () => MonadBlockBuilder m => Type -> Value -> m Value
uitofp :: Type -> Value -> m Value
uitofp Type
ty0 Value
in__   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.uitofp"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [Type
ty0]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
in__)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * xori
-- $xori
-- 
-- The @xori@ operation takes two operands and returns one result, each of
-- these is required to be the same type. This type may be an integer scalar
-- type, a vector whose element type is integer, or a tensor of integers. It
-- has no standard attributes.
-- 
-- Example:
-- 
-- @
-- // Scalar integer bitwise xor.
-- %a = arith.xori %b, %c : i64
-- 
-- // SIMD vector element-wise bitwise integer xor.
-- %f = arith.xori %g, %h : vector\<4xi32>
-- 
-- // Tensor element-wise bitwise integer xor.
-- %x = arith.xori %y, %z : tensor\<4x?xi8>
-- @
--   

-- | A pattern for @arith.xori@.
pattern XOrI :: () => () => Location -> Type -> operand -> operand -> AbstractOperation operand
pattern $bXOrI :: Location -> Type -> operand -> operand -> AbstractOperation operand
$mXOrI :: forall r operand.
AbstractOperation operand
-> (Location -> Type -> operand -> operand -> r)
-> (Void# -> r)
-> r
XOrI loc ty lhs_ rhs_  = Operation
          { opName = "arith.xori"
          , opLocation = loc
          , opResultTypes = Explicit [ty]
          , opOperands = [lhs_, rhs_]
          , opRegions = []
          , opSuccessors = []
          , opAttributes = (NoAttrs)
          }

-- | A builder for @arith.xori@.
xori :: () => MonadBlockBuilder m => Value -> Value -> m Value
xori :: Value -> Value -> m Value
xori  Value
lhs_ Value
rhs_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.xori"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [(Value -> Type
AST.typeOf Value
lhs_)]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
lhs_), (Value -> Name
AST.operand Value
rhs_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))

-- * select
-- $select
-- 
-- The @arith.select@ operation chooses one value based on a binary condition
-- supplied as its first operand.
-- 
-- If the value of the first operand (the condition) is @1@, then the second
-- operand is returned, and the third operand is ignored, even if it was poison.
-- 
-- If the value of the first operand (the condition) is @0@, then the third
-- operand is returned, and the second operand is ignored, even if it was poison.
-- 
-- If the value of the first operand (the condition) is poison, then the
-- operation returns poison.
-- 
-- The operation applies to vectors and tensors elementwise given the _shape_
-- of all operands is identical. The choice is made for each element
-- individually based on the value at the same position as the element in the
-- condition operand. If an i1 is provided as the condition, the entire vector
-- or tensor is chosen.
-- 
-- Example:
-- 
-- @
-- // Custom form of scalar selection.
-- %x = arith.select %cond, %true, %false : i32
-- 
-- // Generic form of the same operation.
-- %x = \"arith.select\"(%cond, %true, %false) : (i1, i32, i32) -> i32
-- 
-- // Element-wise vector selection.
-- %vx = arith.select %vcond, %vtrue, %vfalse : vector\<42xi1>, vector\<42xf32>
-- 
-- // Full vector selection.
-- %vx = arith.select %cond, %vtrue, %vfalse : vector\<42xf32>
-- @
--   

-- | A builder for @arith.select@.
select :: () => MonadBlockBuilder m => Type -> Value -> Value -> Value -> m Value
select :: Type -> Value -> Value -> Value -> m Value
select Type
ty0 Value
condition_ Value
true_value_ Value
false_value_   = do
  ([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
          { opName :: Name
opName = Name
"arith.select"
          , opLocation :: Location
opLocation = Location
UnknownLocation
          , opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit [Type
ty0]
          , opOperands :: [Name]
opOperands = [(Value -> Name
AST.operand Value
condition_), (Value -> Name
AST.operand Value
true_value_), (Value -> Name
AST.operand Value
false_value_)]
          , opRegions :: [Region]
opRegions = []
          , opSuccessors :: [Name]
opSuccessors = []
          , opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
          }))