{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE TypeSynonymInstances #-}

module Data.SpirV.Enum.LoopControl where

import Data.Bits (Bits, FiniteBits, (.|.))
import Data.Word (Word32)
import Foreign.Storable (Storable)

type LoopControl = LoopControlBits

newtype LoopControlBits = LoopControlBits Word32
  deriving newtype (LoopControlBits -> LoopControlBits -> Bool
(LoopControlBits -> LoopControlBits -> Bool)
-> (LoopControlBits -> LoopControlBits -> Bool)
-> Eq LoopControlBits
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LoopControlBits -> LoopControlBits -> Bool
== :: LoopControlBits -> LoopControlBits -> Bool
$c/= :: LoopControlBits -> LoopControlBits -> Bool
/= :: LoopControlBits -> LoopControlBits -> Bool
Eq, Eq LoopControlBits
Eq LoopControlBits =>
(LoopControlBits -> LoopControlBits -> Ordering)
-> (LoopControlBits -> LoopControlBits -> Bool)
-> (LoopControlBits -> LoopControlBits -> Bool)
-> (LoopControlBits -> LoopControlBits -> Bool)
-> (LoopControlBits -> LoopControlBits -> Bool)
-> (LoopControlBits -> LoopControlBits -> LoopControlBits)
-> (LoopControlBits -> LoopControlBits -> LoopControlBits)
-> Ord LoopControlBits
LoopControlBits -> LoopControlBits -> Bool
LoopControlBits -> LoopControlBits -> Ordering
LoopControlBits -> LoopControlBits -> LoopControlBits
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: LoopControlBits -> LoopControlBits -> Ordering
compare :: LoopControlBits -> LoopControlBits -> Ordering
$c< :: LoopControlBits -> LoopControlBits -> Bool
< :: LoopControlBits -> LoopControlBits -> Bool
$c<= :: LoopControlBits -> LoopControlBits -> Bool
<= :: LoopControlBits -> LoopControlBits -> Bool
$c> :: LoopControlBits -> LoopControlBits -> Bool
> :: LoopControlBits -> LoopControlBits -> Bool
$c>= :: LoopControlBits -> LoopControlBits -> Bool
>= :: LoopControlBits -> LoopControlBits -> Bool
$cmax :: LoopControlBits -> LoopControlBits -> LoopControlBits
max :: LoopControlBits -> LoopControlBits -> LoopControlBits
$cmin :: LoopControlBits -> LoopControlBits -> LoopControlBits
min :: LoopControlBits -> LoopControlBits -> LoopControlBits
Ord, Ptr LoopControlBits -> IO LoopControlBits
Ptr LoopControlBits -> Int -> IO LoopControlBits
Ptr LoopControlBits -> Int -> LoopControlBits -> IO ()
Ptr LoopControlBits -> LoopControlBits -> IO ()
LoopControlBits -> Int
(LoopControlBits -> Int)
-> (LoopControlBits -> Int)
-> (Ptr LoopControlBits -> Int -> IO LoopControlBits)
-> (Ptr LoopControlBits -> Int -> LoopControlBits -> IO ())
-> (forall b. Ptr b -> Int -> IO LoopControlBits)
-> (forall b. Ptr b -> Int -> LoopControlBits -> IO ())
-> (Ptr LoopControlBits -> IO LoopControlBits)
-> (Ptr LoopControlBits -> LoopControlBits -> IO ())
-> Storable LoopControlBits
forall b. Ptr b -> Int -> IO LoopControlBits
forall b. Ptr b -> Int -> LoopControlBits -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: LoopControlBits -> Int
sizeOf :: LoopControlBits -> Int
$calignment :: LoopControlBits -> Int
alignment :: LoopControlBits -> Int
$cpeekElemOff :: Ptr LoopControlBits -> Int -> IO LoopControlBits
peekElemOff :: Ptr LoopControlBits -> Int -> IO LoopControlBits
$cpokeElemOff :: Ptr LoopControlBits -> Int -> LoopControlBits -> IO ()
pokeElemOff :: Ptr LoopControlBits -> Int -> LoopControlBits -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO LoopControlBits
peekByteOff :: forall b. Ptr b -> Int -> IO LoopControlBits
$cpokeByteOff :: forall b. Ptr b -> Int -> LoopControlBits -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> LoopControlBits -> IO ()
$cpeek :: Ptr LoopControlBits -> IO LoopControlBits
peek :: Ptr LoopControlBits -> IO LoopControlBits
$cpoke :: Ptr LoopControlBits -> LoopControlBits -> IO ()
poke :: Ptr LoopControlBits -> LoopControlBits -> IO ()
Storable, Eq LoopControlBits
LoopControlBits
Eq LoopControlBits =>
(LoopControlBits -> LoopControlBits -> LoopControlBits)
-> (LoopControlBits -> LoopControlBits -> LoopControlBits)
-> (LoopControlBits -> LoopControlBits -> LoopControlBits)
-> (LoopControlBits -> LoopControlBits)
-> (LoopControlBits -> Int -> LoopControlBits)
-> (LoopControlBits -> Int -> LoopControlBits)
-> LoopControlBits
-> (Int -> LoopControlBits)
-> (LoopControlBits -> Int -> LoopControlBits)
-> (LoopControlBits -> Int -> LoopControlBits)
-> (LoopControlBits -> Int -> LoopControlBits)
-> (LoopControlBits -> Int -> Bool)
-> (LoopControlBits -> Maybe Int)
-> (LoopControlBits -> Int)
-> (LoopControlBits -> Bool)
-> (LoopControlBits -> Int -> LoopControlBits)
-> (LoopControlBits -> Int -> LoopControlBits)
-> (LoopControlBits -> Int -> LoopControlBits)
-> (LoopControlBits -> Int -> LoopControlBits)
-> (LoopControlBits -> Int -> LoopControlBits)
-> (LoopControlBits -> Int -> LoopControlBits)
-> (LoopControlBits -> Int)
-> Bits LoopControlBits
Int -> LoopControlBits
LoopControlBits -> Bool
LoopControlBits -> Int
LoopControlBits -> Maybe Int
LoopControlBits -> LoopControlBits
LoopControlBits -> Int -> Bool
LoopControlBits -> Int -> LoopControlBits
LoopControlBits -> LoopControlBits -> LoopControlBits
forall a.
Eq a =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
$c.&. :: LoopControlBits -> LoopControlBits -> LoopControlBits
.&. :: LoopControlBits -> LoopControlBits -> LoopControlBits
$c.|. :: LoopControlBits -> LoopControlBits -> LoopControlBits
.|. :: LoopControlBits -> LoopControlBits -> LoopControlBits
$cxor :: LoopControlBits -> LoopControlBits -> LoopControlBits
xor :: LoopControlBits -> LoopControlBits -> LoopControlBits
$ccomplement :: LoopControlBits -> LoopControlBits
complement :: LoopControlBits -> LoopControlBits
$cshift :: LoopControlBits -> Int -> LoopControlBits
shift :: LoopControlBits -> Int -> LoopControlBits
$crotate :: LoopControlBits -> Int -> LoopControlBits
rotate :: LoopControlBits -> Int -> LoopControlBits
$czeroBits :: LoopControlBits
zeroBits :: LoopControlBits
$cbit :: Int -> LoopControlBits
bit :: Int -> LoopControlBits
$csetBit :: LoopControlBits -> Int -> LoopControlBits
setBit :: LoopControlBits -> Int -> LoopControlBits
$cclearBit :: LoopControlBits -> Int -> LoopControlBits
clearBit :: LoopControlBits -> Int -> LoopControlBits
$ccomplementBit :: LoopControlBits -> Int -> LoopControlBits
complementBit :: LoopControlBits -> Int -> LoopControlBits
$ctestBit :: LoopControlBits -> Int -> Bool
testBit :: LoopControlBits -> Int -> Bool
$cbitSizeMaybe :: LoopControlBits -> Maybe Int
bitSizeMaybe :: LoopControlBits -> Maybe Int
$cbitSize :: LoopControlBits -> Int
bitSize :: LoopControlBits -> Int
$cisSigned :: LoopControlBits -> Bool
isSigned :: LoopControlBits -> Bool
$cshiftL :: LoopControlBits -> Int -> LoopControlBits
shiftL :: LoopControlBits -> Int -> LoopControlBits
$cunsafeShiftL :: LoopControlBits -> Int -> LoopControlBits
unsafeShiftL :: LoopControlBits -> Int -> LoopControlBits
$cshiftR :: LoopControlBits -> Int -> LoopControlBits
shiftR :: LoopControlBits -> Int -> LoopControlBits
$cunsafeShiftR :: LoopControlBits -> Int -> LoopControlBits
unsafeShiftR :: LoopControlBits -> Int -> LoopControlBits
$crotateL :: LoopControlBits -> Int -> LoopControlBits
rotateL :: LoopControlBits -> Int -> LoopControlBits
$crotateR :: LoopControlBits -> Int -> LoopControlBits
rotateR :: LoopControlBits -> Int -> LoopControlBits
$cpopCount :: LoopControlBits -> Int
popCount :: LoopControlBits -> Int
Bits, Bits LoopControlBits
Bits LoopControlBits =>
(LoopControlBits -> Int)
-> (LoopControlBits -> Int)
-> (LoopControlBits -> Int)
-> FiniteBits LoopControlBits
LoopControlBits -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
$cfiniteBitSize :: LoopControlBits -> Int
finiteBitSize :: LoopControlBits -> Int
$ccountLeadingZeros :: LoopControlBits -> Int
countLeadingZeros :: LoopControlBits -> Int
$ccountTrailingZeros :: LoopControlBits -> Int
countTrailingZeros :: LoopControlBits -> Int
FiniteBits)

instance Semigroup LoopControl where
  (LoopControlBits Word32
a) <> :: LoopControlBits -> LoopControlBits -> LoopControlBits
<> (LoopControlBits Word32
b) = Word32 -> LoopControlBits
LoopControlBits (Word32
a Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
.|. Word32
b)

instance Monoid LoopControl where
  mempty :: LoopControlBits
mempty = Word32 -> LoopControlBits
LoopControlBits Word32
0

pattern Unroll :: LoopControlBits
pattern $mUnroll :: forall {r}. LoopControlBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bUnroll :: LoopControlBits
Unroll = LoopControlBits 0x00000001

pattern DontUnroll :: LoopControlBits
pattern $mDontUnroll :: forall {r}. LoopControlBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bDontUnroll :: LoopControlBits
DontUnroll = LoopControlBits 0x00000002

pattern DependencyInfinite :: LoopControlBits
pattern $mDependencyInfinite :: forall {r}. LoopControlBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bDependencyInfinite :: LoopControlBits
DependencyInfinite = LoopControlBits 0x00000004

pattern DependencyLength :: LoopControlBits
pattern $mDependencyLength :: forall {r}. LoopControlBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bDependencyLength :: LoopControlBits
DependencyLength = LoopControlBits 0x00000008

pattern MinIterations :: LoopControlBits
pattern $mMinIterations :: forall {r}. LoopControlBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bMinIterations :: LoopControlBits
MinIterations = LoopControlBits 0x00000010

pattern MaxIterations :: LoopControlBits
pattern $mMaxIterations :: forall {r}. LoopControlBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bMaxIterations :: LoopControlBits
MaxIterations = LoopControlBits 0x00000020

pattern IterationMultiple :: LoopControlBits
pattern $mIterationMultiple :: forall {r}. LoopControlBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bIterationMultiple :: LoopControlBits
IterationMultiple = LoopControlBits 0x00000040

pattern PeelCount :: LoopControlBits
pattern $mPeelCount :: forall {r}. LoopControlBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bPeelCount :: LoopControlBits
PeelCount = LoopControlBits 0x00000080

pattern PartialCount :: LoopControlBits
pattern $mPartialCount :: forall {r}. LoopControlBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bPartialCount :: LoopControlBits
PartialCount = LoopControlBits 0x00000100

pattern InitiationIntervalINTEL :: LoopControlBits
pattern $mInitiationIntervalINTEL :: forall {r}. LoopControlBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bInitiationIntervalINTEL :: LoopControlBits
InitiationIntervalINTEL = LoopControlBits 0x00010000

pattern MaxConcurrencyINTEL :: LoopControlBits
pattern $mMaxConcurrencyINTEL :: forall {r}. LoopControlBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bMaxConcurrencyINTEL :: LoopControlBits
MaxConcurrencyINTEL = LoopControlBits 0x00020000

pattern DependencyArrayINTEL :: LoopControlBits
pattern $mDependencyArrayINTEL :: forall {r}. LoopControlBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bDependencyArrayINTEL :: LoopControlBits
DependencyArrayINTEL = LoopControlBits 0x00040000

pattern PipelineEnableINTEL :: LoopControlBits
pattern $mPipelineEnableINTEL :: forall {r}. LoopControlBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bPipelineEnableINTEL :: LoopControlBits
PipelineEnableINTEL = LoopControlBits 0x00080000

pattern LoopCoalesceINTEL :: LoopControlBits
pattern $mLoopCoalesceINTEL :: forall {r}. LoopControlBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bLoopCoalesceINTEL :: LoopControlBits
LoopCoalesceINTEL = LoopControlBits 0x00100000

pattern MaxInterleavingINTEL :: LoopControlBits
pattern $mMaxInterleavingINTEL :: forall {r}. LoopControlBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bMaxInterleavingINTEL :: LoopControlBits
MaxInterleavingINTEL = LoopControlBits 0x00200000

pattern SpeculatedIterationsINTEL :: LoopControlBits
pattern $mSpeculatedIterationsINTEL :: forall {r}. LoopControlBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bSpeculatedIterationsINTEL :: LoopControlBits
SpeculatedIterationsINTEL = LoopControlBits 0x00400000

pattern NoFusionINTEL :: LoopControlBits
pattern $mNoFusionINTEL :: forall {r}. LoopControlBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bNoFusionINTEL :: LoopControlBits
NoFusionINTEL = LoopControlBits 0x00800000

pattern LoopCountINTEL :: LoopControlBits
pattern $mLoopCountINTEL :: forall {r}. LoopControlBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bLoopCountINTEL :: LoopControlBits
LoopCountINTEL = LoopControlBits 0x01000000

pattern MaxReinvocationDelayINTEL :: LoopControlBits
pattern $mMaxReinvocationDelayINTEL :: forall {r}. LoopControlBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bMaxReinvocationDelayINTEL :: LoopControlBits
MaxReinvocationDelayINTEL = LoopControlBits 0x02000000