htcc-0.0.0.1: The full scratch implementation of tiny C compiler (x86_64)
Copyright(c) roki 2019
LicenseMIT
Maintainerfalgon53@yahoo.co.jp
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Htcc.Asm.Intrinsic.Operand

Description

Types and classes of the x86_64 operands

Synopsis

The operand classes and types.

class Show a => IsOperand a where Source #

IsOperand class has an operand type as instances.

Minimal complete definition

Nothing

Methods

oadd :: IsOperand b => a -> b -> Operand Source #

The operation of add.

osub :: IsOperand b => a -> b -> Operand Source #

The operation of sub.

omul :: IsOperand b => a -> b -> Operand Source #

The operation of mul.

Instances

Instances details
IsOperand Int Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

oadd :: IsOperand b => Int -> b -> Operand Source #

osub :: IsOperand b => Int -> b -> Operand Source #

omul :: IsOperand b => Int -> b -> Operand Source #

IsOperand Integer Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

oadd :: IsOperand b => Integer -> b -> Operand Source #

osub :: IsOperand b => Integer -> b -> Operand Source #

omul :: IsOperand b => Integer -> b -> Operand Source #

IsOperand Register Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

oadd :: IsOperand b => Register -> b -> Operand Source #

osub :: IsOperand b => Register -> b -> Operand Source #

omul :: IsOperand b => Register -> b -> Operand Source #

IsOperand Operand Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

oadd :: IsOperand b => Operand -> b -> Operand Source #

osub :: IsOperand b => Operand -> b -> Operand Source #

omul :: IsOperand b => Operand -> b -> Operand Source #

newtype Operand Source #

The operand type.

Constructors

Operand String

The constructor of Operand.

Instances

Instances details
Eq Operand Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

(==) :: Operand -> Operand -> Bool #

(/=) :: Operand -> Operand -> Bool #

Ord Operand Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Show Operand Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Generic Operand Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Associated Types

type Rep Operand :: Type -> Type #

Methods

from :: Operand -> Rep Operand x #

to :: Rep Operand x -> Operand #

Semigroup Operand Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Monoid Operand Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

IsOperand Operand Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

oadd :: IsOperand b => Operand -> b -> Operand Source #

osub :: IsOperand b => Operand -> b -> Operand Source #

omul :: IsOperand b => Operand -> b -> Operand Source #

type Rep Operand Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

type Rep Operand = D1 ('MetaData "Operand" "Htcc.Asm.Intrinsic.Operand" "htcc-0.0.0.1-I8tHuOdNzco4DzUthNftqr" 'True) (C1 ('MetaCons "Operand" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))

newtype Ref a Source #

The type that specifies that register values are considered address values. e.g.:

>>> Ref rax
[rax]
>>> Ref rsp
[rsp]
>>> import qualified Data.Text as T
>>> T.putStr $ mov rax (Ref rsp) <> add rsp 8
     mov rax, [rsp]
     add rsp, 8

Constructors

Ref

The constructor of Ref.

Fields

Instances

Instances details
Monad Ref Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

(>>=) :: Ref a -> (a -> Ref b) -> Ref b #

(>>) :: Ref a -> Ref b -> Ref b #

return :: a -> Ref a #

Functor Ref Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

fmap :: (a -> b) -> Ref a -> Ref b #

(<$) :: a -> Ref b -> Ref a #

MonadFix Ref Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

mfix :: (a -> Ref a) -> Ref a #

Applicative Ref Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

pure :: a -> Ref a #

(<*>) :: Ref (a -> b) -> Ref a -> Ref b #

liftA2 :: (a -> b -> c) -> Ref a -> Ref b -> Ref c #

(*>) :: Ref a -> Ref b -> Ref b #

(<*) :: Ref a -> Ref b -> Ref a #

MonadZip Ref Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

mzip :: Ref a -> Ref b -> Ref (a, b) #

mzipWith :: (a -> b -> c) -> Ref a -> Ref b -> Ref c #

munzip :: Ref (a, b) -> (Ref a, Ref b) #

Bounded a => Bounded (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

minBound :: Ref a #

maxBound :: Ref a #

Enum a => Enum (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

succ :: Ref a -> Ref a #

pred :: Ref a -> Ref a #

toEnum :: Int -> Ref a #

fromEnum :: Ref a -> Int #

enumFrom :: Ref a -> [Ref a] #

enumFromThen :: Ref a -> Ref a -> [Ref a] #

enumFromTo :: Ref a -> Ref a -> [Ref a] #

enumFromThenTo :: Ref a -> Ref a -> Ref a -> [Ref a] #

Eq a => Eq (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

(==) :: Ref a -> Ref a -> Bool #

(/=) :: Ref a -> Ref a -> Bool #

Floating a => Floating (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

pi :: Ref a #

exp :: Ref a -> Ref a #

log :: Ref a -> Ref a #

sqrt :: Ref a -> Ref a #

(**) :: Ref a -> Ref a -> Ref a #

logBase :: Ref a -> Ref a -> Ref a #

sin :: Ref a -> Ref a #

cos :: Ref a -> Ref a #

tan :: Ref a -> Ref a #

asin :: Ref a -> Ref a #

acos :: Ref a -> Ref a #

atan :: Ref a -> Ref a #

sinh :: Ref a -> Ref a #

cosh :: Ref a -> Ref a #

tanh :: Ref a -> Ref a #

asinh :: Ref a -> Ref a #

acosh :: Ref a -> Ref a #

atanh :: Ref a -> Ref a #

log1p :: Ref a -> Ref a #

expm1 :: Ref a -> Ref a #

log1pexp :: Ref a -> Ref a #

log1mexp :: Ref a -> Ref a #

Fractional a => Fractional (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

(/) :: Ref a -> Ref a -> Ref a #

recip :: Ref a -> Ref a #

fromRational :: Rational -> Ref a #

Integral a => Integral (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

quot :: Ref a -> Ref a -> Ref a #

rem :: Ref a -> Ref a -> Ref a #

div :: Ref a -> Ref a -> Ref a #

mod :: Ref a -> Ref a -> Ref a #

quotRem :: Ref a -> Ref a -> (Ref a, Ref a) #

divMod :: Ref a -> Ref a -> (Ref a, Ref a) #

toInteger :: Ref a -> Integer #

Num a => Num (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

(+) :: Ref a -> Ref a -> Ref a #

(-) :: Ref a -> Ref a -> Ref a #

(*) :: Ref a -> Ref a -> Ref a #

negate :: Ref a -> Ref a #

abs :: Ref a -> Ref a #

signum :: Ref a -> Ref a #

fromInteger :: Integer -> Ref a #

Ord a => Ord (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

compare :: Ref a -> Ref a -> Ordering #

(<) :: Ref a -> Ref a -> Bool #

(<=) :: Ref a -> Ref a -> Bool #

(>) :: Ref a -> Ref a -> Bool #

(>=) :: Ref a -> Ref a -> Bool #

max :: Ref a -> Ref a -> Ref a #

min :: Ref a -> Ref a -> Ref a #

Real a => Real (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

toRational :: Ref a -> Rational #

RealFloat a => RealFloat (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

floatRadix :: Ref a -> Integer #

floatDigits :: Ref a -> Int #

floatRange :: Ref a -> (Int, Int) #

decodeFloat :: Ref a -> (Integer, Int) #

encodeFloat :: Integer -> Int -> Ref a #

exponent :: Ref a -> Int #

significand :: Ref a -> Ref a #

scaleFloat :: Int -> Ref a -> Ref a #

isNaN :: Ref a -> Bool #

isInfinite :: Ref a -> Bool #

isDenormalized :: Ref a -> Bool #

isNegativeZero :: Ref a -> Bool #

isIEEE :: Ref a -> Bool #

atan2 :: Ref a -> Ref a -> Ref a #

RealFrac a => RealFrac (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

properFraction :: Integral b => Ref a -> (b, Ref a) #

truncate :: Integral b => Ref a -> b #

round :: Integral b => Ref a -> b #

ceiling :: Integral b => Ref a -> b #

floor :: Integral b => Ref a -> b #

IsOperand a => Show (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

showsPrec :: Int -> Ref a -> ShowS #

show :: Ref a -> String #

showList :: [Ref a] -> ShowS #

Ix a => Ix (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

range :: (Ref a, Ref a) -> [Ref a] #

index :: (Ref a, Ref a) -> Ref a -> Int #

unsafeIndex :: (Ref a, Ref a) -> Ref a -> Int #

inRange :: (Ref a, Ref a) -> Ref a -> Bool #

rangeSize :: (Ref a, Ref a) -> Int #

unsafeRangeSize :: (Ref a, Ref a) -> Int #

Generic (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Associated Types

type Rep (Ref a) :: Type -> Type #

Methods

from :: Ref a -> Rep (Ref a) x #

to :: Rep (Ref a) x -> Ref a #

Semigroup a => Semigroup (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

(<>) :: Ref a -> Ref a -> Ref a #

sconcat :: NonEmpty (Ref a) -> Ref a #

stimes :: Integral b => b -> Ref a -> Ref a #

Monoid a => Monoid (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

mempty :: Ref a #

mappend :: Ref a -> Ref a -> Ref a #

mconcat :: [Ref a] -> Ref a #

Storable a => Storable (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

sizeOf :: Ref a -> Int #

alignment :: Ref a -> Int #

peekElemOff :: Ptr (Ref a) -> Int -> IO (Ref a) #

pokeElemOff :: Ptr (Ref a) -> Int -> Ref a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Ref a) #

pokeByteOff :: Ptr b -> Int -> Ref a -> IO () #

peek :: Ptr (Ref a) -> IO (Ref a) #

poke :: Ptr (Ref a) -> Ref a -> IO () #

Bits a => Bits (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Methods

(.&.) :: Ref a -> Ref a -> Ref a #

(.|.) :: Ref a -> Ref a -> Ref a #

xor :: Ref a -> Ref a -> Ref a #

complement :: Ref a -> Ref a #

shift :: Ref a -> Int -> Ref a #

rotate :: Ref a -> Int -> Ref a #

zeroBits :: Ref a #

bit :: Int -> Ref a #

setBit :: Ref a -> Int -> Ref a #

clearBit :: Ref a -> Int -> Ref a #

complementBit :: Ref a -> Int -> Ref a #

testBit :: Ref a -> Int -> Bool #

bitSizeMaybe :: Ref a -> Maybe Int #

bitSize :: Ref a -> Int #

isSigned :: Ref a -> Bool #

shiftL :: Ref a -> Int -> Ref a #

unsafeShiftL :: Ref a -> Int -> Ref a #

shiftR :: Ref a -> Int -> Ref a #

unsafeShiftR :: Ref a -> Int -> Ref a #

rotateL :: Ref a -> Int -> Ref a #

rotateR :: Ref a -> Int -> Ref a #

popCount :: Ref a -> Int #

FiniteBits a => FiniteBits (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

IsOperand a => BinaryInstruction (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Structure.Section.Text.Instruction

IsOperand a => UnaryInstruction (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Structure.Section.Text.Instruction

Generic1 Ref Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

Associated Types

type Rep1 Ref :: k -> Type #

Methods

from1 :: forall (a :: k). Ref a -> Rep1 Ref a #

to1 :: forall (a :: k). Rep1 Ref a -> Ref a #

type Rep (Ref a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

type Rep (Ref a) = D1 ('MetaData "Ref" "Htcc.Asm.Intrinsic.Operand" "htcc-0.0.0.1-I8tHuOdNzco4DzUthNftqr" 'True) (C1 ('MetaCons "Ref" 'PrefixI 'True) (S1 ('MetaSel ('Just "runRef") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))
type Rep1 Ref Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Operand

type Rep1 Ref = D1 ('MetaData "Ref" "Htcc.Asm.Intrinsic.Operand" "htcc-0.0.0.1-I8tHuOdNzco4DzUthNftqr" 'True) (C1 ('MetaCons "Ref" 'PrefixI 'True) (S1 ('MetaSel ('Just "runRef") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))