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

module Data.SpirV.Enum.AddressingModel where

import Data.Word (Word32)
import Foreign.Storable (Storable)

newtype AddressingModel = AddressingModel Word32
  deriving newtype (AddressingModel -> AddressingModel -> Bool
(AddressingModel -> AddressingModel -> Bool)
-> (AddressingModel -> AddressingModel -> Bool)
-> Eq AddressingModel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddressingModel -> AddressingModel -> Bool
== :: AddressingModel -> AddressingModel -> Bool
$c/= :: AddressingModel -> AddressingModel -> Bool
/= :: AddressingModel -> AddressingModel -> Bool
Eq, Eq AddressingModel
Eq AddressingModel =>
(AddressingModel -> AddressingModel -> Ordering)
-> (AddressingModel -> AddressingModel -> Bool)
-> (AddressingModel -> AddressingModel -> Bool)
-> (AddressingModel -> AddressingModel -> Bool)
-> (AddressingModel -> AddressingModel -> Bool)
-> (AddressingModel -> AddressingModel -> AddressingModel)
-> (AddressingModel -> AddressingModel -> AddressingModel)
-> Ord AddressingModel
AddressingModel -> AddressingModel -> Bool
AddressingModel -> AddressingModel -> Ordering
AddressingModel -> AddressingModel -> AddressingModel
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 :: AddressingModel -> AddressingModel -> Ordering
compare :: AddressingModel -> AddressingModel -> Ordering
$c< :: AddressingModel -> AddressingModel -> Bool
< :: AddressingModel -> AddressingModel -> Bool
$c<= :: AddressingModel -> AddressingModel -> Bool
<= :: AddressingModel -> AddressingModel -> Bool
$c> :: AddressingModel -> AddressingModel -> Bool
> :: AddressingModel -> AddressingModel -> Bool
$c>= :: AddressingModel -> AddressingModel -> Bool
>= :: AddressingModel -> AddressingModel -> Bool
$cmax :: AddressingModel -> AddressingModel -> AddressingModel
max :: AddressingModel -> AddressingModel -> AddressingModel
$cmin :: AddressingModel -> AddressingModel -> AddressingModel
min :: AddressingModel -> AddressingModel -> AddressingModel
Ord, Ptr AddressingModel -> IO AddressingModel
Ptr AddressingModel -> Int -> IO AddressingModel
Ptr AddressingModel -> Int -> AddressingModel -> IO ()
Ptr AddressingModel -> AddressingModel -> IO ()
AddressingModel -> Int
(AddressingModel -> Int)
-> (AddressingModel -> Int)
-> (Ptr AddressingModel -> Int -> IO AddressingModel)
-> (Ptr AddressingModel -> Int -> AddressingModel -> IO ())
-> (forall b. Ptr b -> Int -> IO AddressingModel)
-> (forall b. Ptr b -> Int -> AddressingModel -> IO ())
-> (Ptr AddressingModel -> IO AddressingModel)
-> (Ptr AddressingModel -> AddressingModel -> IO ())
-> Storable AddressingModel
forall b. Ptr b -> Int -> IO AddressingModel
forall b. Ptr b -> Int -> AddressingModel -> 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 :: AddressingModel -> Int
sizeOf :: AddressingModel -> Int
$calignment :: AddressingModel -> Int
alignment :: AddressingModel -> Int
$cpeekElemOff :: Ptr AddressingModel -> Int -> IO AddressingModel
peekElemOff :: Ptr AddressingModel -> Int -> IO AddressingModel
$cpokeElemOff :: Ptr AddressingModel -> Int -> AddressingModel -> IO ()
pokeElemOff :: Ptr AddressingModel -> Int -> AddressingModel -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO AddressingModel
peekByteOff :: forall b. Ptr b -> Int -> IO AddressingModel
$cpokeByteOff :: forall b. Ptr b -> Int -> AddressingModel -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> AddressingModel -> IO ()
$cpeek :: Ptr AddressingModel -> IO AddressingModel
peek :: Ptr AddressingModel -> IO AddressingModel
$cpoke :: Ptr AddressingModel -> AddressingModel -> IO ()
poke :: Ptr AddressingModel -> AddressingModel -> IO ()
Storable)

instance Show AddressingModel where
  showsPrec :: Int -> AddressingModel -> ShowS
showsPrec Int
p (AddressingModel Word32
v) = case Word32
v of
    Word32
0 -> String -> ShowS
showString String
"Logical"
    Word32
1 -> String -> ShowS
showString String
"Physical32"
    Word32
2 -> String -> ShowS
showString String
"Physical64"
    Word32
5348 -> String -> ShowS
showString String
"PhysicalStorageBuffer64"
    Word32
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Int
10) (ShowS -> ShowS) -> ShowS -> ShowS
forall a b. (a -> b) -> a -> b
$ String -> ShowS
showString String
"AddressingModel " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Word32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec (Int
p Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
1) Word32
x

pattern Logical :: AddressingModel
pattern $mLogical :: forall {r}. AddressingModel -> ((# #) -> r) -> ((# #) -> r) -> r
$bLogical :: AddressingModel
Logical = AddressingModel 0

pattern Physical32 :: AddressingModel
pattern $mPhysical32 :: forall {r}. AddressingModel -> ((# #) -> r) -> ((# #) -> r) -> r
$bPhysical32 :: AddressingModel
Physical32 = AddressingModel 1

pattern Physical64 :: AddressingModel
pattern $mPhysical64 :: forall {r}. AddressingModel -> ((# #) -> r) -> ((# #) -> r) -> r
$bPhysical64 :: AddressingModel
Physical64 = AddressingModel 2

pattern PhysicalStorageBuffer64 :: AddressingModel
pattern $mPhysicalStorageBuffer64 :: forall {r}. AddressingModel -> ((# #) -> r) -> ((# #) -> r) -> r
$bPhysicalStorageBuffer64 :: AddressingModel
PhysicalStorageBuffer64 = AddressingModel 5348

pattern PhysicalStorageBuffer64EXT :: AddressingModel
pattern $mPhysicalStorageBuffer64EXT :: forall {r}. AddressingModel -> ((# #) -> r) -> ((# #) -> r) -> r
$bPhysicalStorageBuffer64EXT :: AddressingModel
PhysicalStorageBuffer64EXT = AddressingModel 5348