{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE MultiWayIf #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
module GHC.StgToJS.Prim
( genPrim
)
where
import GHC.Prelude
import GHC.JS.Syntax hiding (JUOp (..))
import GHC.JS.Make
import GHC.StgToJS.Heap
import GHC.StgToJS.Types
import GHC.StgToJS.Profiling
import GHC.StgToJS.Regs
import GHC.Core.Type
import GHC.Builtin.PrimOps
import GHC.Tc.Utils.TcType (isBoolTy)
import GHC.Utils.Encoding (zEncodeString)
import GHC.Data.FastString
import GHC.Utils.Outputable (renderWithContext, defaultSDocContext, ppr)
import Data.Maybe
genPrim :: Bool
-> Bool
-> Type
-> PrimOp
-> [JExpr]
-> [JExpr]
-> PrimRes
genPrim :: Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
op = case PrimOp
op of
PrimOp
CharGtOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.>. JExpr
y)
PrimOp
CharGeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.>=. JExpr
y)
PrimOp
CharEqOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.===. JExpr
y)
PrimOp
CharNeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.!==. JExpr
y)
PrimOp
CharLtOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.<. JExpr
y)
PrimOp
CharLeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.<=. JExpr
y)
PrimOp
OrdOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x
PrimOp
Int8ToWord8Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
mask8 JExpr
x
PrimOp
Word8ToInt8Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend8 JExpr
x
PrimOp
Int16ToWord16Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
mask16 JExpr
x
PrimOp
Word16ToInt16Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend16 JExpr
x
PrimOp
Int32ToWord32Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x JExpr -> JExpr -> JExpr
.>>>. JExpr
zero_
PrimOp
Word32ToInt32Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toI32 JExpr
x
PrimOp
IntAddOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toI32 (JExpr -> JExpr -> JExpr
Add JExpr
x JExpr
y)
PrimOp
IntSubOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toI32 (JExpr -> JExpr -> JExpr
Sub JExpr
x JExpr
y)
PrimOp
IntMulOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$mulInt32" [JExpr
x, JExpr
y]
PrimOp
IntMul2Op -> \[JExpr
c,JExpr
hr,JExpr
lr] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
c,JExpr
hr,JExpr
lr] FastString
"h$hs_timesInt2" [JExpr
x, JExpr
y]
PrimOp
IntMulMayOfloOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JStat) -> JStat
forall a. ToSat a => a -> JStat
jVar \JExpr
tmp -> [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
tmp JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
Mul JExpr
x JExpr
y
, JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if01 (JExpr
tmp JExpr -> JExpr -> JExpr
.===. JExpr -> JExpr
toI32 JExpr
tmp)
]
PrimOp
IntQuotOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toI32 (JExpr -> JExpr -> JExpr
Div JExpr
x JExpr
y)
PrimOp
IntRemOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
Mod JExpr
x JExpr
y
PrimOp
IntQuotRemOp -> \[JExpr
q,JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
q JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toI32 (JExpr -> JExpr -> JExpr
Div JExpr
x JExpr
y)
, JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x JExpr -> JExpr -> JExpr
`Sub` (JExpr -> JExpr -> JExpr
Mul JExpr
y JExpr
q)
]
PrimOp
IntAndOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
BAnd JExpr
x JExpr
y
PrimOp
IntOrOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
BOr JExpr
x JExpr
y
PrimOp
IntXorOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
BXor JExpr
x JExpr
y
PrimOp
IntNotOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
BNot JExpr
x
PrimOp
IntNegOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toI32 (JExpr -> JExpr
Negate JExpr
x)
PrimOp
IntAddCOp -> \[JExpr
r,JExpr
overf] [JExpr
x,JExpr
y] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JStat) -> JStat
forall a. ToSat a => a -> JStat
jVar \JExpr
rt -> [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
rt JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
Add JExpr
x JExpr
y
, JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toI32 JExpr
rt
, JExpr
overf JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
r JExpr -> JExpr -> JExpr
.!=. JExpr
rt)
]
PrimOp
IntSubCOp -> \[JExpr
r,JExpr
overf] [JExpr
x,JExpr
y] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JStat) -> JStat
forall a. ToSat a => a -> JStat
jVar \JExpr
rt -> [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
rt JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
Sub JExpr
x JExpr
y
, JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toI32 JExpr
rt
, JExpr
overf JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
r JExpr -> JExpr -> JExpr
.!=. JExpr
rt)
]
PrimOp
IntGtOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.>. JExpr
y)
PrimOp
IntGeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.>=. JExpr
y)
PrimOp
IntEqOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.===. JExpr
y)
PrimOp
IntNeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10(JExpr
x JExpr -> JExpr -> JExpr
.!==. JExpr
y)
PrimOp
IntLtOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.<. JExpr
y)
PrimOp
IntLeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.<=. JExpr
y)
PrimOp
ChrOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x
PrimOp
IntToWordOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x JExpr -> JExpr -> JExpr
.>>>. JExpr
0
PrimOp
IntToFloatOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x
PrimOp
IntToDoubleOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x
PrimOp
IntSllOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x JExpr -> JExpr -> JExpr
.<<. JExpr
y
PrimOp
IntSraOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x JExpr -> JExpr -> JExpr
.>>. JExpr
y
PrimOp
IntSrlOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toI32 (JExpr
x JExpr -> JExpr -> JExpr
.>>>. JExpr
y)
PrimOp
Int8ToIntOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x
PrimOp
IntToInt8Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend8 JExpr
x
PrimOp
Int8NegOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend8 (JExpr -> JExpr
Negate JExpr
x)
PrimOp
Int8AddOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend8 (JExpr -> JExpr -> JExpr
Add JExpr
x JExpr
y)
PrimOp
Int8SubOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend8 (JExpr -> JExpr -> JExpr
Sub JExpr
x JExpr
y)
PrimOp
Int8MulOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend8 (JExpr -> JExpr -> JExpr
Mul JExpr
x JExpr
y)
PrimOp
Int8QuotOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend8 (Int -> JExpr -> JExpr -> JExpr
quotShortInt Int
8 JExpr
x JExpr
y)
PrimOp
Int8RemOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend8 (Int -> JExpr -> JExpr -> JExpr
remShortInt Int
8 JExpr
x JExpr
y)
PrimOp
Int8QuotRemOp -> \[JExpr
r1,JExpr
r2] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
r1 JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend8 (Int -> JExpr -> JExpr -> JExpr
quotShortInt Int
8 JExpr
x JExpr
y)
, JExpr
r2 JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend8 (Int -> JExpr -> JExpr -> JExpr
remShortInt Int
8 JExpr
x JExpr
y)
]
PrimOp
Int8EqOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.===. JExpr
y)
PrimOp
Int8GeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 ((JExpr
x JExpr -> JExpr -> JExpr
.<<. (Integer -> JExpr
Int Integer
24)) JExpr -> JExpr -> JExpr
.>=. (JExpr
y JExpr -> JExpr -> JExpr
.<<. (Integer -> JExpr
Int Integer
24)))
PrimOp
Int8GtOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 ((JExpr
x JExpr -> JExpr -> JExpr
.<<. (Integer -> JExpr
Int Integer
24)) JExpr -> JExpr -> JExpr
.>. (JExpr
y JExpr -> JExpr -> JExpr
.<<. (Integer -> JExpr
Int Integer
24)))
PrimOp
Int8LeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 ((JExpr
x JExpr -> JExpr -> JExpr
.<<. (Integer -> JExpr
Int Integer
24)) JExpr -> JExpr -> JExpr
.<=. (JExpr
y JExpr -> JExpr -> JExpr
.<<. (Integer -> JExpr
Int Integer
24)))
PrimOp
Int8LtOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 ((JExpr
x JExpr -> JExpr -> JExpr
.<<. (Integer -> JExpr
Int Integer
24)) JExpr -> JExpr -> JExpr
.<. (JExpr
y JExpr -> JExpr -> JExpr
.<<. (Integer -> JExpr
Int Integer
24)))
PrimOp
Int8NeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.!==. JExpr
y)
PrimOp
Int8SraOp -> \[JExpr
r] [JExpr
x,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x JExpr -> JExpr -> JExpr
.>>. JExpr
i
PrimOp
Int8SrlOp -> \[JExpr
r] [JExpr
x,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend8 (JExpr -> JExpr
mask8 JExpr
x JExpr -> JExpr -> JExpr
.>>>. JExpr
i)
PrimOp
Int8SllOp -> \[JExpr
r] [JExpr
x,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend8 (JExpr -> JExpr
mask8 (JExpr
x JExpr -> JExpr -> JExpr
.<<. JExpr
i))
PrimOp
Word8ToWordOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
mask8 JExpr
x
PrimOp
WordToWord8Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
mask8 JExpr
x
PrimOp
Word8AddOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
mask8 (JExpr -> JExpr -> JExpr
Add JExpr
x JExpr
y)
PrimOp
Word8SubOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
mask8 (JExpr -> JExpr -> JExpr
Sub JExpr
x JExpr
y)
PrimOp
Word8MulOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
mask8 (JExpr -> JExpr -> JExpr
Mul JExpr
x JExpr
y)
PrimOp
Word8QuotOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
mask8 (JExpr -> JExpr -> JExpr
Div JExpr
x JExpr
y)
PrimOp
Word8RemOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
Mod JExpr
x JExpr
y
PrimOp
Word8QuotRemOp -> \[JExpr
r1,JExpr
r2] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
r1 JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toI32 (JExpr -> JExpr -> JExpr
Div JExpr
x JExpr
y)
, JExpr
r2 JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
Mod JExpr
x JExpr
y
]
PrimOp
Word8EqOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.===. JExpr
y)
PrimOp
Word8GeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.>=. JExpr
y)
PrimOp
Word8GtOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.>. JExpr
y)
PrimOp
Word8LeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.<=. JExpr
y)
PrimOp
Word8LtOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.<. JExpr
y)
PrimOp
Word8NeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.!==. JExpr
y)
PrimOp
Word8AndOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
BAnd JExpr
x JExpr
y
PrimOp
Word8OrOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
BOr JExpr
x JExpr
y
PrimOp
Word8XorOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
BXor JExpr
x JExpr
y
PrimOp
Word8NotOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
BXor JExpr
x (Integer -> JExpr
Int Integer
0xff)
PrimOp
Word8SllOp -> \[JExpr
r] [JExpr
x,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
mask8 (JExpr
x JExpr -> JExpr -> JExpr
.<<. JExpr
i)
PrimOp
Word8SrlOp -> \[JExpr
r] [JExpr
x,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x JExpr -> JExpr -> JExpr
.>>>. JExpr
i
PrimOp
Int16ToIntOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x
PrimOp
IntToInt16Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend16 JExpr
x
PrimOp
Int16NegOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend16 (JExpr -> JExpr
Negate JExpr
x)
PrimOp
Int16AddOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend16 (JExpr -> JExpr -> JExpr
Add JExpr
x JExpr
y)
PrimOp
Int16SubOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend16 (JExpr -> JExpr -> JExpr
Sub JExpr
x JExpr
y)
PrimOp
Int16MulOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend16 (JExpr -> JExpr -> JExpr
Mul JExpr
x JExpr
y)
PrimOp
Int16QuotOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend16 (Int -> JExpr -> JExpr -> JExpr
quotShortInt Int
16 JExpr
x JExpr
y)
PrimOp
Int16RemOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend16 (Int -> JExpr -> JExpr -> JExpr
remShortInt Int
16 JExpr
x JExpr
y)
PrimOp
Int16QuotRemOp -> \[JExpr
r1,JExpr
r2] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
r1 JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend16 (Int -> JExpr -> JExpr -> JExpr
quotShortInt Int
16 JExpr
x JExpr
y)
, JExpr
r2 JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend16 (Int -> JExpr -> JExpr -> JExpr
remShortInt Int
16 JExpr
x JExpr
y)
]
PrimOp
Int16EqOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.===. JExpr
y)
PrimOp
Int16GeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 ((JExpr
x JExpr -> JExpr -> JExpr
.<<. (Integer -> JExpr
Int Integer
16)) JExpr -> JExpr -> JExpr
.>=. (JExpr
y JExpr -> JExpr -> JExpr
.<<. (Integer -> JExpr
Int Integer
16)))
PrimOp
Int16GtOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 ((JExpr
x JExpr -> JExpr -> JExpr
.<<. (Integer -> JExpr
Int Integer
16)) JExpr -> JExpr -> JExpr
.>. (JExpr
y JExpr -> JExpr -> JExpr
.<<. (Integer -> JExpr
Int Integer
16)))
PrimOp
Int16LeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 ((JExpr
x JExpr -> JExpr -> JExpr
.<<. (Integer -> JExpr
Int Integer
16)) JExpr -> JExpr -> JExpr
.<=. (JExpr
y JExpr -> JExpr -> JExpr
.<<. (Integer -> JExpr
Int Integer
16)))
PrimOp
Int16LtOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 ((JExpr
x JExpr -> JExpr -> JExpr
.<<. (Integer -> JExpr
Int Integer
16)) JExpr -> JExpr -> JExpr
.<. (JExpr
y JExpr -> JExpr -> JExpr
.<<. (Integer -> JExpr
Int Integer
16)))
PrimOp
Int16NeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.!==. JExpr
y)
PrimOp
Int16SraOp -> \[JExpr
r] [JExpr
x,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x JExpr -> JExpr -> JExpr
.>>. JExpr
i
PrimOp
Int16SrlOp -> \[JExpr
r] [JExpr
x,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend16 (JExpr -> JExpr
mask16 JExpr
x JExpr -> JExpr -> JExpr
.>>>. JExpr
i)
PrimOp
Int16SllOp -> \[JExpr
r] [JExpr
x,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend16 (JExpr
x JExpr -> JExpr -> JExpr
.<<. JExpr
i)
PrimOp
Word16ToWordOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x
PrimOp
WordToWord16Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
mask16 JExpr
x
PrimOp
Word16AddOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
mask16 (JExpr -> JExpr -> JExpr
Add JExpr
x JExpr
y)
PrimOp
Word16SubOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
mask16 (JExpr -> JExpr -> JExpr
Sub JExpr
x JExpr
y)
PrimOp
Word16MulOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
mask16 (JExpr -> JExpr -> JExpr
Mul JExpr
x JExpr
y)
PrimOp
Word16QuotOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
mask16 (JExpr -> JExpr -> JExpr
Div JExpr
x JExpr
y)
PrimOp
Word16RemOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
Mod JExpr
x JExpr
y
PrimOp
Word16QuotRemOp -> \[JExpr
r1,JExpr
r2] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
r1 JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toI32 (JExpr -> JExpr -> JExpr
Div JExpr
x JExpr
y)
, JExpr
r2 JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
Mod JExpr
x JExpr
y
]
PrimOp
Word16EqOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.===. JExpr
y)
PrimOp
Word16GeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.>=. JExpr
y)
PrimOp
Word16GtOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.>. JExpr
y)
PrimOp
Word16LeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.<=. JExpr
y)
PrimOp
Word16LtOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.<. JExpr
y)
PrimOp
Word16NeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.!==. JExpr
y)
PrimOp
Word16AndOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
BAnd JExpr
x JExpr
y
PrimOp
Word16OrOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
BOr JExpr
x JExpr
y
PrimOp
Word16XorOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
BXor JExpr
x JExpr
y
PrimOp
Word16NotOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
BXor JExpr
x (Integer -> JExpr
Int Integer
0xffff)
PrimOp
Word16SllOp -> \[JExpr
r] [JExpr
x,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
mask16 (JExpr
x JExpr -> JExpr -> JExpr
.<<. JExpr
i)
PrimOp
Word16SrlOp -> \[JExpr
r] [JExpr
x,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x JExpr -> JExpr -> JExpr
.>>>. JExpr
i
PrimOp
Int32ToIntOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x
PrimOp
IntToInt32Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x
PrimOp
Int32NegOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
IntNegOp [JExpr]
rs [JExpr]
xs
PrimOp
Int32AddOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
IntAddOp [JExpr]
rs [JExpr]
xs
PrimOp
Int32SubOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
IntSubOp [JExpr]
rs [JExpr]
xs
PrimOp
Int32MulOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
IntMulOp [JExpr]
rs [JExpr]
xs
PrimOp
Int32QuotOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
IntQuotOp [JExpr]
rs [JExpr]
xs
PrimOp
Int32RemOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
IntRemOp [JExpr]
rs [JExpr]
xs
PrimOp
Int32QuotRemOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
IntQuotRemOp [JExpr]
rs [JExpr]
xs
PrimOp
Int32EqOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
IntEqOp [JExpr]
rs [JExpr]
xs
PrimOp
Int32GeOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
IntGeOp [JExpr]
rs [JExpr]
xs
PrimOp
Int32GtOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
IntGtOp [JExpr]
rs [JExpr]
xs
PrimOp
Int32LeOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
IntLeOp [JExpr]
rs [JExpr]
xs
PrimOp
Int32LtOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
IntLtOp [JExpr]
rs [JExpr]
xs
PrimOp
Int32NeOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
IntNeOp [JExpr]
rs [JExpr]
xs
PrimOp
Int32SraOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
IntSraOp [JExpr]
rs [JExpr]
xs
PrimOp
Int32SrlOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
IntSrlOp [JExpr]
rs [JExpr]
xs
PrimOp
Int32SllOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
IntSllOp [JExpr]
rs [JExpr]
xs
PrimOp
Word32ToWordOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x
PrimOp
WordToWord32Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x
PrimOp
Word32AddOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
WordAddOp [JExpr]
rs [JExpr]
xs
PrimOp
Word32SubOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
WordSubOp [JExpr]
rs [JExpr]
xs
PrimOp
Word32MulOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
WordMulOp [JExpr]
rs [JExpr]
xs
PrimOp
Word32QuotOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
WordQuotOp [JExpr]
rs [JExpr]
xs
PrimOp
Word32RemOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
WordRemOp [JExpr]
rs [JExpr]
xs
PrimOp
Word32QuotRemOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
WordQuotRemOp [JExpr]
rs [JExpr]
xs
PrimOp
Word32EqOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
WordEqOp [JExpr]
rs [JExpr]
xs
PrimOp
Word32GeOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
WordGeOp [JExpr]
rs [JExpr]
xs
PrimOp
Word32GtOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
WordGtOp [JExpr]
rs [JExpr]
xs
PrimOp
Word32LeOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
WordLeOp [JExpr]
rs [JExpr]
xs
PrimOp
Word32LtOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
WordLtOp [JExpr]
rs [JExpr]
xs
PrimOp
Word32NeOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
WordNeOp [JExpr]
rs [JExpr]
xs
PrimOp
Word32AndOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
WordAndOp [JExpr]
rs [JExpr]
xs
PrimOp
Word32OrOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
WordOrOp [JExpr]
rs [JExpr]
xs
PrimOp
Word32XorOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
WordXorOp [JExpr]
rs [JExpr]
xs
PrimOp
Word32NotOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
WordNotOp [JExpr]
rs [JExpr]
xs
PrimOp
Word32SllOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
WordSllOp [JExpr]
rs [JExpr]
xs
PrimOp
Word32SrlOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
WordSrlOp [JExpr]
rs [JExpr]
xs
PrimOp
Int64ToIntOp -> \[JExpr
r] [JExpr
_h,JExpr
l] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toI32 JExpr
l
PrimOp
Int64NegOp -> \[JExpr
r_h,JExpr
r_l] [JExpr
h,JExpr
l] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
r_l JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 (JExpr -> JExpr
BNot JExpr
l JExpr -> JExpr -> JExpr
forall a. Num a => a -> a -> a
+ JExpr
1)
, JExpr
r_h JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toI32 (JExpr -> JExpr
BNot JExpr
h JExpr -> JExpr -> JExpr
forall a. Num a => a -> a -> a
+ JExpr -> JExpr
Not JExpr
r_l)
]
PrimOp
Int64AddOp -> \[JExpr
hr,JExpr
lr] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
hr,JExpr
lr] FastString
"h$hs_plusInt64" [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1]
PrimOp
Int64SubOp -> \[JExpr
hr,JExpr
lr] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
hr,JExpr
lr] FastString
"h$hs_minusInt64" [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1]
PrimOp
Int64MulOp -> \[JExpr
hr,JExpr
lr] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
hr,JExpr
lr] FastString
"h$hs_timesInt64" [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1]
PrimOp
Int64QuotOp -> \[JExpr
hr,JExpr
lr] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
hr,JExpr
lr] FastString
"h$hs_quotInt64" [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1]
PrimOp
Int64RemOp -> \[JExpr
hr,JExpr
lr] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
hr,JExpr
lr] FastString
"h$hs_remInt64" [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1]
PrimOp
Int64SllOp -> \[JExpr
hr,JExpr
lr] [JExpr
h,JExpr
l,JExpr
n] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
hr,JExpr
lr] FastString
"h$hs_uncheckedShiftLLInt64" [JExpr
h,JExpr
l,JExpr
n]
PrimOp
Int64SraOp -> \[JExpr
hr,JExpr
lr] [JExpr
h,JExpr
l,JExpr
n] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
hr,JExpr
lr] FastString
"h$hs_uncheckedShiftRAInt64" [JExpr
h,JExpr
l,JExpr
n]
PrimOp
Int64SrlOp -> \[JExpr
hr,JExpr
lr] [JExpr
h,JExpr
l,JExpr
n] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
hr,JExpr
lr] FastString
"h$hs_uncheckedShiftRLInt64" [JExpr
h,JExpr
l,JExpr
n]
PrimOp
Int64ToWord64Op -> \[JExpr
r1,JExpr
r2] [JExpr
x1,JExpr
x2] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
r1 JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 JExpr
x1
, JExpr
r2 JExpr -> JExpr -> JStat
|= JExpr
x2
]
PrimOp
IntToInt64Op -> \[JExpr
r1,JExpr
r2] [JExpr
x] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
r1 JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr -> JExpr
if_ (JExpr
x JExpr -> JExpr -> JExpr
.<. JExpr
0) (-JExpr
1) JExpr
0
, JExpr
r2 JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 JExpr
x
]
PrimOp
Int64EqOp -> \[JExpr
r] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr -> JExpr -> JExpr
LAnd (JExpr
l0 JExpr -> JExpr -> JExpr
.===. JExpr
l1) (JExpr
h0 JExpr -> JExpr -> JExpr
.===. JExpr
h1))
PrimOp
Int64NeOp -> \[JExpr
r] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr -> JExpr -> JExpr
LOr (JExpr
l0 JExpr -> JExpr -> JExpr
.!==. JExpr
l1) (JExpr
h0 JExpr -> JExpr -> JExpr
.!==. JExpr
h1))
PrimOp
Int64GeOp -> \[JExpr
r] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr -> JExpr -> JExpr
LOr (JExpr
h0 JExpr -> JExpr -> JExpr
.>. JExpr
h1) (JExpr -> JExpr -> JExpr
LAnd (JExpr
h0 JExpr -> JExpr -> JExpr
.===. JExpr
h1) (JExpr
l0 JExpr -> JExpr -> JExpr
.>=. JExpr
l1)))
PrimOp
Int64GtOp -> \[JExpr
r] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr -> JExpr -> JExpr
LOr (JExpr
h0 JExpr -> JExpr -> JExpr
.>. JExpr
h1) (JExpr -> JExpr -> JExpr
LAnd (JExpr
h0 JExpr -> JExpr -> JExpr
.===. JExpr
h1) (JExpr
l0 JExpr -> JExpr -> JExpr
.>. JExpr
l1)))
PrimOp
Int64LeOp -> \[JExpr
r] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr -> JExpr -> JExpr
LOr (JExpr
h0 JExpr -> JExpr -> JExpr
.<. JExpr
h1) (JExpr -> JExpr -> JExpr
LAnd (JExpr
h0 JExpr -> JExpr -> JExpr
.===. JExpr
h1) (JExpr
l0 JExpr -> JExpr -> JExpr
.<=. JExpr
l1)))
PrimOp
Int64LtOp -> \[JExpr
r] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr -> JExpr -> JExpr
LOr (JExpr
h0 JExpr -> JExpr -> JExpr
.<. JExpr
h1) (JExpr -> JExpr -> JExpr
LAnd (JExpr
h0 JExpr -> JExpr -> JExpr
.===. JExpr
h1) (JExpr
l0 JExpr -> JExpr -> JExpr
.<. JExpr
l1)))
PrimOp
Word64ToWordOp -> \[JExpr
r] [JExpr
_x1,JExpr
x2] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x2
PrimOp
WordToWord64Op -> \[JExpr
rh,JExpr
rl] [JExpr
x] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
rh JExpr -> JExpr -> JStat
|= JExpr
0
, JExpr
rl JExpr -> JExpr -> JStat
|= JExpr
x
]
PrimOp
Word64ToInt64Op -> \[JExpr
r1,JExpr
r2] [JExpr
x1,JExpr
x2] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
r1 JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toI32 JExpr
x1
, JExpr
r2 JExpr -> JExpr -> JStat
|= JExpr
x2
]
PrimOp
Word64EqOp -> \[JExpr
r] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr -> JExpr -> JExpr
LAnd (JExpr
l0 JExpr -> JExpr -> JExpr
.===. JExpr
l1) (JExpr
h0 JExpr -> JExpr -> JExpr
.===. JExpr
h1))
PrimOp
Word64NeOp -> \[JExpr
r] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr -> JExpr -> JExpr
LOr (JExpr
l0 JExpr -> JExpr -> JExpr
.!==. JExpr
l1) (JExpr
h0 JExpr -> JExpr -> JExpr
.!==. JExpr
h1))
PrimOp
Word64GeOp -> \[JExpr
r] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr -> JExpr -> JExpr
LOr (JExpr
h0 JExpr -> JExpr -> JExpr
.>. JExpr
h1) (JExpr -> JExpr -> JExpr
LAnd (JExpr
h0 JExpr -> JExpr -> JExpr
.===. JExpr
h1) (JExpr
l0 JExpr -> JExpr -> JExpr
.>=. JExpr
l1)))
PrimOp
Word64GtOp -> \[JExpr
r] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr -> JExpr -> JExpr
LOr (JExpr
h0 JExpr -> JExpr -> JExpr
.>. JExpr
h1) (JExpr -> JExpr -> JExpr
LAnd (JExpr
h0 JExpr -> JExpr -> JExpr
.===. JExpr
h1) (JExpr
l0 JExpr -> JExpr -> JExpr
.>. JExpr
l1)))
PrimOp
Word64LeOp -> \[JExpr
r] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr -> JExpr -> JExpr
LOr (JExpr
h0 JExpr -> JExpr -> JExpr
.<. JExpr
h1) (JExpr -> JExpr -> JExpr
LAnd (JExpr
h0 JExpr -> JExpr -> JExpr
.===. JExpr
h1) (JExpr
l0 JExpr -> JExpr -> JExpr
.<=. JExpr
l1)))
PrimOp
Word64LtOp -> \[JExpr
r] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr -> JExpr -> JExpr
LOr (JExpr
h0 JExpr -> JExpr -> JExpr
.<. JExpr
h1) (JExpr -> JExpr -> JExpr
LAnd (JExpr
h0 JExpr -> JExpr -> JExpr
.===. JExpr
h1) (JExpr
l0 JExpr -> JExpr -> JExpr
.<. JExpr
l1)))
PrimOp
Word64SllOp -> \[JExpr
hr,JExpr
lr] [JExpr
h,JExpr
l,JExpr
n] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
hr,JExpr
lr] FastString
"h$hs_uncheckedShiftLWord64" [JExpr
h,JExpr
l,JExpr
n]
PrimOp
Word64SrlOp -> \[JExpr
hr,JExpr
lr] [JExpr
h,JExpr
l,JExpr
n] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
hr,JExpr
lr] FastString
"h$hs_uncheckedShiftRWord64" [JExpr
h,JExpr
l,JExpr
n]
PrimOp
Word64OrOp -> \[JExpr
hr,JExpr
hl] [JExpr
h0, JExpr
l0, JExpr
h1, JExpr
l1] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
hr JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 (JExpr -> JExpr -> JExpr
BOr JExpr
h0 JExpr
h1)
, JExpr
hl JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 (JExpr -> JExpr -> JExpr
BOr JExpr
l0 JExpr
l1)
]
PrimOp
Word64AndOp -> \[JExpr
hr,JExpr
hl] [JExpr
h0, JExpr
l0, JExpr
h1, JExpr
l1] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
hr JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 (JExpr -> JExpr -> JExpr
BAnd JExpr
h0 JExpr
h1)
, JExpr
hl JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 (JExpr -> JExpr -> JExpr
BAnd JExpr
l0 JExpr
l1)
]
PrimOp
Word64XorOp -> \[JExpr
hr,JExpr
hl] [JExpr
h0, JExpr
l0, JExpr
h1, JExpr
l1] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
hr JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 (JExpr -> JExpr -> JExpr
BXor JExpr
h0 JExpr
h1)
, JExpr
hl JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 (JExpr -> JExpr -> JExpr
BXor JExpr
l0 JExpr
l1)
]
PrimOp
Word64NotOp -> \[JExpr
hr,JExpr
hl] [JExpr
h, JExpr
l] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
hr JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 (JExpr -> JExpr
BNot JExpr
h)
, JExpr
hl JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 (JExpr -> JExpr
BNot JExpr
l)
]
PrimOp
Word64AddOp -> \[JExpr
hr,JExpr
lr] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
hr,JExpr
lr] FastString
"h$hs_plusWord64" [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1]
PrimOp
Word64SubOp -> \[JExpr
hr,JExpr
lr] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
hr,JExpr
lr] FastString
"h$hs_minusWord64" [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1]
PrimOp
Word64MulOp -> \[JExpr
hr,JExpr
lr] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
hr,JExpr
lr] FastString
"h$hs_timesWord64" [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1]
PrimOp
Word64QuotOp -> \[JExpr
hr,JExpr
lr] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
hr,JExpr
lr] FastString
"h$hs_quotWord64" [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1]
PrimOp
Word64RemOp -> \[JExpr
hr,JExpr
lr] [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
hr,JExpr
lr] FastString
"h$hs_remWord64" [JExpr
h0,JExpr
l0,JExpr
h1,JExpr
l1]
PrimOp
WordAddOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= (JExpr
x JExpr -> JExpr -> JExpr
`Add` JExpr
y) JExpr -> JExpr -> JExpr
.>>>. JExpr
zero_
PrimOp
WordAddCOp -> \[JExpr
r,JExpr
c] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$
(JExpr -> JStat) -> JStat
forall a. ToSat a => a -> JStat
jVar \JExpr
t -> [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
t JExpr -> JExpr -> JStat
|= JExpr
x JExpr -> JExpr -> JExpr
`Add` JExpr
y
, JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 JExpr
t
, JExpr
c JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
t JExpr -> JExpr -> JExpr
.!==. JExpr
r)
]
PrimOp
WordSubCOp -> \[JExpr
r,JExpr
c] [JExpr
x,JExpr
y] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 (JExpr -> JExpr -> JExpr
Sub JExpr
x JExpr
y)
, JExpr
c JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
y JExpr -> JExpr -> JExpr
.>. JExpr
x)
]
PrimOp
WordAdd2Op -> \[JExpr
h,JExpr
l] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
h,JExpr
l] FastString
"h$wordAdd2" [JExpr
x,JExpr
y]
PrimOp
WordSubOp -> \ [JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 (JExpr -> JExpr -> JExpr
Sub JExpr
x JExpr
y)
PrimOp
WordMulOp -> \ [JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$mulWord32" [JExpr
x, JExpr
y]
PrimOp
WordMul2Op -> \[JExpr
h,JExpr
l] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
h,JExpr
l] FastString
"h$mul2Word32" [JExpr
x,JExpr
y]
PrimOp
WordQuotOp -> \ [JExpr
q] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
q JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$quotWord32" [JExpr
x,JExpr
y]
PrimOp
WordRemOp -> \ [JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$remWord32" [JExpr
x,JExpr
y]
PrimOp
WordQuotRemOp -> \[JExpr
q,JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
q,JExpr
r] FastString
"h$quotRemWord32" [JExpr
x,JExpr
y]
PrimOp
WordQuotRem2Op -> \[JExpr
q,JExpr
r] [JExpr
xh,JExpr
xl,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
q,JExpr
r] FastString
"h$quotRem2Word32" [JExpr
xh,JExpr
xl,JExpr
y]
PrimOp
WordAndOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 (JExpr -> JExpr -> JExpr
BAnd JExpr
x JExpr
y)
PrimOp
WordOrOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 (JExpr -> JExpr -> JExpr
BOr JExpr
x JExpr
y)
PrimOp
WordXorOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 (JExpr -> JExpr -> JExpr
BXor JExpr
x JExpr
y)
PrimOp
WordNotOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 (JExpr -> JExpr
BNot JExpr
x)
PrimOp
WordSllOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 (JExpr
x JExpr -> JExpr -> JExpr
.<<. JExpr
y)
PrimOp
WordSrlOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x JExpr -> JExpr -> JExpr
.>>>. JExpr
y
PrimOp
WordToIntOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toI32 JExpr
x
PrimOp
WordGtOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.>. JExpr
y)
PrimOp
WordGeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.>=. JExpr
y)
PrimOp
WordEqOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.===. JExpr
y)
PrimOp
WordNeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.!==. JExpr
y)
PrimOp
WordLtOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.<. JExpr
y)
PrimOp
WordLeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.<=. JExpr
y)
PrimOp
WordToDoubleOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x
PrimOp
WordToFloatOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [JExpr
x]
PrimOp
PopCnt8Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> JExpr
var FastString
"h$popCntTab" JExpr -> JExpr -> JExpr
.! (JExpr -> JExpr
mask8 JExpr
x)
PrimOp
PopCnt16Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
Add (FastString -> JExpr
var FastString
"h$popCntTab" JExpr -> JExpr -> JExpr
.! (JExpr -> JExpr
mask8 JExpr
x))
(FastString -> JExpr
var FastString
"h$popCntTab" JExpr -> JExpr -> JExpr
.! (JExpr -> JExpr
mask8 (JExpr
x JExpr -> JExpr -> JExpr
.>>>. Integer -> JExpr
Int Integer
8)))
PrimOp
PopCnt32Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$popCnt32" [JExpr
x]
PrimOp
PopCnt64Op -> \[JExpr
r] [JExpr
x1,JExpr
x2] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$popCnt64" [JExpr
x1,JExpr
x2]
PrimOp
PopCntOp -> \[JExpr
r] [JExpr
x] -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
PopCnt32Op [JExpr
r] [JExpr
x]
PrimOp
Pdep8Op -> \[JExpr
r] [JExpr
s,JExpr
m] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$pdep8" [JExpr
s,JExpr
m]
PrimOp
Pdep16Op -> \[JExpr
r] [JExpr
s,JExpr
m] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$pdep16" [JExpr
s,JExpr
m]
PrimOp
Pdep32Op -> \[JExpr
r] [JExpr
s,JExpr
m] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$pdep32" [JExpr
s,JExpr
m]
PrimOp
Pdep64Op -> \[JExpr
ra,JExpr
rb] [JExpr
sa,JExpr
sb,JExpr
ma,JExpr
mb] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
ra,JExpr
rb] FastString
"h$pdep64" [JExpr
sa,JExpr
sb,JExpr
ma,JExpr
mb]
PrimOp
PdepOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
Pdep32Op [JExpr]
rs [JExpr]
xs
PrimOp
Pext8Op -> \[JExpr
r] [JExpr
s,JExpr
m] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$pext8" [JExpr
s,JExpr
m]
PrimOp
Pext16Op -> \[JExpr
r] [JExpr
s,JExpr
m] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$pext16" [JExpr
s,JExpr
m]
PrimOp
Pext32Op -> \[JExpr
r] [JExpr
s,JExpr
m] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$pext32" [JExpr
s,JExpr
m]
PrimOp
Pext64Op -> \[JExpr
ra,JExpr
rb] [JExpr
sa,JExpr
sb,JExpr
ma,JExpr
mb] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
ra,JExpr
rb] FastString
"h$pext64" [JExpr
sa,JExpr
sb,JExpr
ma,JExpr
mb]
PrimOp
PextOp -> \[JExpr]
rs [JExpr]
xs -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
Pext32Op [JExpr]
rs [JExpr]
xs
PrimOp
ClzOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$clz32" [JExpr
x]
PrimOp
Clz8Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$clz8" [JExpr
x]
PrimOp
Clz16Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$clz16" [JExpr
x]
PrimOp
Clz32Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$clz32" [JExpr
x]
PrimOp
Clz64Op -> \[JExpr
r] [JExpr
x1,JExpr
x2] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$clz64" [JExpr
x1,JExpr
x2]
PrimOp
CtzOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$ctz32" [JExpr
x]
PrimOp
Ctz8Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$ctz8" [JExpr
x]
PrimOp
Ctz16Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$ctz16" [JExpr
x]
PrimOp
Ctz32Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$ctz32" [JExpr
x]
PrimOp
Ctz64Op -> \[JExpr
r] [JExpr
x1,JExpr
x2] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$ctz64" [JExpr
x1,JExpr
x2]
PrimOp
BSwap16Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$
JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
BOr ((JExpr -> JExpr
mask8 JExpr
x) JExpr -> JExpr -> JExpr
.<<. (Integer -> JExpr
Int Integer
8))
(JExpr -> JExpr
mask8 (JExpr
x JExpr -> JExpr -> JExpr
.>>>. (Integer -> JExpr
Int Integer
8)))
PrimOp
BSwap32Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$
JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 ((JExpr
x JExpr -> JExpr -> JExpr
.<<. (Integer -> JExpr
Int Integer
24))
JExpr -> JExpr -> JExpr
`BOr` ((JExpr -> JExpr -> JExpr
BAnd JExpr
x (Integer -> JExpr
Int Integer
0xFF00)) JExpr -> JExpr -> JExpr
.<<. (Integer -> JExpr
Int Integer
8))
JExpr -> JExpr -> JExpr
`BOr` ((JExpr -> JExpr -> JExpr
BAnd JExpr
x (Integer -> JExpr
Int Integer
0xFF0000)) JExpr -> JExpr -> JExpr
.>>. (Integer -> JExpr
Int Integer
8))
JExpr -> JExpr -> JExpr
`BOr` (JExpr
x JExpr -> JExpr -> JExpr
.>>>. (Integer -> JExpr
Int Integer
24)))
PrimOp
BSwap64Op -> \[JExpr
r1,JExpr
r2] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
r1,JExpr
r2] FastString
"h$bswap64" [JExpr
x,JExpr
y]
PrimOp
BSwapOp -> \[JExpr
r] [JExpr
x] -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
BSwap32Op [JExpr
r] [JExpr
x]
PrimOp
BRevOp -> \[JExpr
r] [JExpr
w] -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
BRev32Op [JExpr
r] [JExpr
w]
PrimOp
BRev8Op -> \[JExpr
r] [JExpr
w] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= (FastString -> [JExpr] -> JExpr
app FastString
"h$reverseWord" [JExpr
w] JExpr -> JExpr -> JExpr
.>>>. JExpr
24)
PrimOp
BRev16Op -> \[JExpr
r] [JExpr
w] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= (FastString -> [JExpr] -> JExpr
app FastString
"h$reverseWord" [JExpr
w] JExpr -> JExpr -> JExpr
.>>>. JExpr
16)
PrimOp
BRev32Op -> \[JExpr
r] [JExpr
w] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$reverseWord" [JExpr
w]
PrimOp
BRev64Op -> \[JExpr
rh,JExpr
rl] [JExpr
h,JExpr
l] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat [ JExpr
rl JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$reverseWord" [JExpr
h]
, JExpr
rh JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$reverseWord" [JExpr
l]
]
PrimOp
Narrow8IntOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend8 JExpr
x
PrimOp
Narrow16IntOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
signExtend16 JExpr
x
PrimOp
Narrow32IntOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toI32 JExpr
x
PrimOp
Narrow8WordOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
mask8 JExpr
x
PrimOp
Narrow16WordOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
mask16 JExpr
x
PrimOp
Narrow32WordOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toU32 JExpr
x
PrimOp
DoubleGtOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.>. JExpr
y)
PrimOp
DoubleGeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.>=. JExpr
y)
PrimOp
DoubleEqOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.===. JExpr
y)
PrimOp
DoubleNeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.!==. JExpr
y)
PrimOp
DoubleLtOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.<. JExpr
y)
PrimOp
DoubleLeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.<=. JExpr
y)
PrimOp
DoubleAddOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
Add JExpr
x JExpr
y
PrimOp
DoubleSubOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
Sub JExpr
x JExpr
y
PrimOp
DoubleMulOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
Mul JExpr
x JExpr
y
PrimOp
DoubleDivOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
Div JExpr
x JExpr
y
PrimOp
DoubleNegOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
Negate JExpr
x
PrimOp
DoubleFabsOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_abs [JExpr
x]
PrimOp
DoubleToIntOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toI32 JExpr
x
PrimOp
DoubleToFloatOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [JExpr
x]
PrimOp
DoubleExpOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_exp [JExpr
x]
PrimOp
DoubleExpM1Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_expm1 [JExpr
x]
PrimOp
DoubleLogOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_log [JExpr
x]
PrimOp
DoubleLog1POp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_log1p [JExpr
x]
PrimOp
DoubleSqrtOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_sqrt [JExpr
x]
PrimOp
DoubleSinOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_sin [JExpr
x]
PrimOp
DoubleCosOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_cos [JExpr
x]
PrimOp
DoubleTanOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_tan [JExpr
x]
PrimOp
DoubleAsinOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_asin [JExpr
x]
PrimOp
DoubleAcosOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_acos [JExpr
x]
PrimOp
DoubleAtanOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_atan [JExpr
x]
PrimOp
DoubleSinhOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_sinh [JExpr
x]
PrimOp
DoubleCoshOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_cosh [JExpr
x]
PrimOp
DoubleTanhOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_tanh [JExpr
x]
PrimOp
DoubleAsinhOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_asinh [JExpr
x]
PrimOp
DoubleAcoshOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_acosh [JExpr
x]
PrimOp
DoubleAtanhOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_atanh [JExpr
x]
PrimOp
DoublePowerOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_pow [JExpr
x,JExpr
y]
PrimOp
DoubleDecode_2IntOp -> \[JExpr
s,JExpr
h,JExpr
l,JExpr
e] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
s,JExpr
h,JExpr
l,JExpr
e] FastString
"h$decodeDouble2Int" [JExpr
x]
PrimOp
DoubleDecode_Int64Op -> \[JExpr
s1,JExpr
s2,JExpr
e] [JExpr
d] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
e,JExpr
s1,JExpr
s2] FastString
"h$decodeDoubleInt64" [JExpr
d]
PrimOp
FloatGtOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.>. JExpr
y)
PrimOp
FloatGeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.>=. JExpr
y)
PrimOp
FloatEqOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.===. JExpr
y)
PrimOp
FloatNeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.!==. JExpr
y)
PrimOp
FloatLtOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.<. JExpr
y)
PrimOp
FloatLeOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
x JExpr -> JExpr -> JExpr
.<=. JExpr
y)
PrimOp
FloatAddOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [JExpr -> JExpr -> JExpr
Add JExpr
x JExpr
y]
PrimOp
FloatSubOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [JExpr -> JExpr -> JExpr
Sub JExpr
x JExpr
y]
PrimOp
FloatMulOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [JExpr -> JExpr -> JExpr
Mul JExpr
x JExpr
y]
PrimOp
FloatDivOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [JExpr -> JExpr -> JExpr
Div JExpr
x JExpr
y]
PrimOp
FloatNegOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
Negate JExpr
x
PrimOp
FloatFabsOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_abs [JExpr
x]
PrimOp
FloatToIntOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
toI32 JExpr
x
PrimOp
FloatExpOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [[JExpr] -> JExpr
math_exp [JExpr
x]]
PrimOp
FloatExpM1Op -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [[JExpr] -> JExpr
math_expm1 [JExpr
x]]
PrimOp
FloatLogOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [[JExpr] -> JExpr
math_log [JExpr
x]]
PrimOp
FloatLog1POp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [[JExpr] -> JExpr
math_log1p [JExpr
x]]
PrimOp
FloatSqrtOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [[JExpr] -> JExpr
math_sqrt [JExpr
x]]
PrimOp
FloatSinOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [[JExpr] -> JExpr
math_sin [JExpr
x]]
PrimOp
FloatCosOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [[JExpr] -> JExpr
math_cos [JExpr
x]]
PrimOp
FloatTanOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [[JExpr] -> JExpr
math_tan [JExpr
x]]
PrimOp
FloatAsinOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [[JExpr] -> JExpr
math_asin [JExpr
x]]
PrimOp
FloatAcosOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [[JExpr] -> JExpr
math_acos [JExpr
x]]
PrimOp
FloatAtanOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [[JExpr] -> JExpr
math_atan [JExpr
x]]
PrimOp
FloatSinhOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [[JExpr] -> JExpr
math_sinh [JExpr
x]]
PrimOp
FloatCoshOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [[JExpr] -> JExpr
math_cosh [JExpr
x]]
PrimOp
FloatTanhOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [[JExpr] -> JExpr
math_tanh [JExpr
x]]
PrimOp
FloatAsinhOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [[JExpr] -> JExpr
math_asinh [JExpr
x]]
PrimOp
FloatAcoshOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [[JExpr] -> JExpr
math_acosh [JExpr
x]]
PrimOp
FloatAtanhOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [[JExpr] -> JExpr
math_atanh [JExpr
x]]
PrimOp
FloatPowerOp -> \[JExpr
r] [JExpr
x,JExpr
y] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= [JExpr] -> JExpr
math_fround [[JExpr] -> JExpr
math_pow [JExpr
x,JExpr
y]]
PrimOp
FloatToDoubleOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
x
PrimOp
FloatDecode_IntOp -> \[JExpr
s,JExpr
e] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
s,JExpr
e] FastString
"h$decodeFloatInt" [JExpr
x]
PrimOp
NewArrayOp -> \[JExpr
r] [JExpr
l,JExpr
e] -> JStat -> PrimRes
PrimInline (JExpr -> JExpr -> JExpr -> JStat
newArray JExpr
r JExpr
l JExpr
e)
PrimOp
ReadArrayOp -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i (JExpr
r JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> JExpr -> JExpr
.! JExpr
i)
PrimOp
WriteArrayOp -> \[] [JExpr
a,JExpr
i,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i (JExpr
a JExpr -> JExpr -> JExpr
.! JExpr
i JExpr -> JExpr -> JStat
|= JExpr
v)
PrimOp
SizeofArrayOp -> \[JExpr
r] [JExpr
a] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"length"
PrimOp
SizeofMutableArrayOp -> \[JExpr
r] [JExpr
a] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"length"
PrimOp
IndexArrayOp -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i (JExpr
r JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> JExpr -> JExpr
.! JExpr
i)
PrimOp
UnsafeFreezeArrayOp -> \[JExpr
r] [JExpr
a] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
a
PrimOp
UnsafeThawArrayOp -> \[JExpr
r] [JExpr
a] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
a
PrimOp
CopyArrayOp -> \[] [JExpr
a,JExpr
o1,JExpr
ma,JExpr
o2,JExpr
n] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> (JExpr -> JExpr) -> (JExpr -> [JStat]) -> JStat
loopBlockS (Integer -> JExpr
Int Integer
0) (JExpr -> JExpr -> JExpr
.<. JExpr
n) \JExpr
i ->
[ JExpr
ma JExpr -> JExpr -> JExpr
.! (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
o2) JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> JExpr -> JExpr
.! (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
o1)
, JExpr -> JStat
preIncrS JExpr
i
]
PrimOp
CopyMutableArrayOp -> \[] [JExpr
a1,JExpr
o1,JExpr
a2,JExpr
o2,JExpr
n] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ FastString -> [JExpr] -> JStat
appS FastString
"h$copyMutableArray" [JExpr
a1,JExpr
o1,JExpr
a2,JExpr
o2,JExpr
n]
PrimOp
CloneArrayOp -> \[JExpr
r] [JExpr
a,JExpr
start,JExpr
n] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$sliceArray" [JExpr
a,JExpr
start,JExpr
n]
PrimOp
CloneMutableArrayOp -> \[JExpr
r] [JExpr
a,JExpr
start,JExpr
n] -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
CloneArrayOp [JExpr
r] [JExpr
a,JExpr
start,JExpr
n]
PrimOp
FreezeArrayOp -> \[JExpr
r] [JExpr
a,JExpr
start,JExpr
n] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$sliceArray" [JExpr
a,JExpr
start,JExpr
n]
PrimOp
ThawArrayOp -> \[JExpr
r] [JExpr
a,JExpr
start,JExpr
n] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$sliceArray" [JExpr
a,JExpr
start,JExpr
n]
PrimOp
CasArrayOp -> \[JExpr
s,JExpr
o] [JExpr
a,JExpr
i,JExpr
old,JExpr
new] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$
(JExpr -> JStat) -> JStat
forall a. ToSat a => a -> JStat
jVar \JExpr
x -> [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
x JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> JExpr -> JExpr
.! JExpr
i
, JExpr -> [JStat] -> [JStat] -> JStat
ifBlockS (JExpr
x JExpr -> JExpr -> JExpr
.===. JExpr
old)
[ JExpr
o JExpr -> JExpr -> JStat
|= JExpr
new
, JExpr
a JExpr -> JExpr -> JExpr
.! JExpr
i JExpr -> JExpr -> JStat
|= JExpr
new
, JExpr
s JExpr -> JExpr -> JStat
|= JExpr
zero_
]
[ JExpr
s JExpr -> JExpr -> JStat
|= JExpr
one_
, JExpr
o JExpr -> JExpr -> JStat
|= JExpr
x
]
]
PrimOp
NewSmallArrayOp -> \[JExpr
a] [JExpr
n,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
a JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$newArray" [JExpr
n,JExpr
e]
PrimOp
ReadSmallArrayOp -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i (JExpr
r JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> JExpr -> JExpr
.! JExpr
i)
PrimOp
WriteSmallArrayOp -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i (JExpr
a JExpr -> JExpr -> JExpr
.! JExpr
i JExpr -> JExpr -> JStat
|= JExpr
e)
PrimOp
SizeofSmallArrayOp -> \[JExpr
r] [JExpr
a] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"length"
PrimOp
SizeofSmallMutableArrayOp -> \[JExpr
r] [JExpr
a] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"length"
PrimOp
IndexSmallArrayOp -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i (JExpr
r JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> JExpr -> JExpr
.! JExpr
i)
PrimOp
UnsafeFreezeSmallArrayOp -> \[JExpr
r] [JExpr
a] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
a
PrimOp
UnsafeThawSmallArrayOp -> \[JExpr
r] [JExpr
a] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
a
PrimOp
CopySmallArrayOp -> \[] [JExpr
s,JExpr
si,JExpr
d,JExpr
di,JExpr
n] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$
JExpr -> (JExpr -> JExpr) -> (JExpr -> [JStat]) -> JStat
loopBlockS (JExpr -> JExpr -> JExpr
Sub JExpr
n JExpr
one_) (JExpr -> JExpr -> JExpr
.>=. JExpr
zero_) \JExpr
i ->
[ JExpr
d JExpr -> JExpr -> JExpr
.! (JExpr -> JExpr -> JExpr
Add JExpr
di JExpr
i) JExpr -> JExpr -> JStat
|= JExpr
s JExpr -> JExpr -> JExpr
.! (JExpr -> JExpr -> JExpr
Add JExpr
si JExpr
i)
, JExpr -> JStat
postDecrS JExpr
i
]
PrimOp
CopySmallMutableArrayOp -> \[] [JExpr
s,JExpr
si,JExpr
d,JExpr
di,JExpr
n] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ FastString -> [JExpr] -> JStat
appS FastString
"h$copyMutableArray" [JExpr
s,JExpr
si,JExpr
d,JExpr
di,JExpr
n]
PrimOp
CloneSmallArrayOp -> \[JExpr
r] [JExpr
a,JExpr
o,JExpr
n] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> Maybe JExpr -> JExpr -> JStat
cloneArray JExpr
r JExpr
a (JExpr -> Maybe JExpr
forall a. a -> Maybe a
Just JExpr
o) JExpr
n
PrimOp
CloneSmallMutableArrayOp -> \[JExpr
r] [JExpr
a,JExpr
o,JExpr
n] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> Maybe JExpr -> JExpr -> JStat
cloneArray JExpr
r JExpr
a (JExpr -> Maybe JExpr
forall a. a -> Maybe a
Just JExpr
o) JExpr
n
PrimOp
FreezeSmallArrayOp -> \[JExpr
r] [JExpr
a,JExpr
o,JExpr
n] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> Maybe JExpr -> JExpr -> JStat
cloneArray JExpr
r JExpr
a (JExpr -> Maybe JExpr
forall a. a -> Maybe a
Just JExpr
o) JExpr
n
PrimOp
ThawSmallArrayOp -> \[JExpr
r] [JExpr
a,JExpr
o,JExpr
n] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> Maybe JExpr -> JExpr -> JStat
cloneArray JExpr
r JExpr
a (JExpr -> Maybe JExpr
forall a. a -> Maybe a
Just JExpr
o) JExpr
n
PrimOp
CasSmallArrayOp -> \[JExpr
s,JExpr
o] [JExpr
a,JExpr
i,JExpr
old,JExpr
new] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JStat) -> JStat
forall a. ToSat a => a -> JStat
jVar \JExpr
x -> [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
x JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> JExpr -> JExpr
.! JExpr
i
, JExpr -> [JStat] -> [JStat] -> JStat
ifBlockS (JExpr
x JExpr -> JExpr -> JExpr
.===. JExpr
old)
[ JExpr
o JExpr -> JExpr -> JStat
|= JExpr
new
, JExpr
a JExpr -> JExpr -> JExpr
.! JExpr
i JExpr -> JExpr -> JStat
|= JExpr
new
, JExpr
s JExpr -> JExpr -> JStat
|= JExpr
zero_
]
[ JExpr
s JExpr -> JExpr -> JStat
|= JExpr
one_
, JExpr
o JExpr -> JExpr -> JStat
|= JExpr
x
]
]
PrimOp
NewByteArrayOp_Char -> \[JExpr
r] [JExpr
l] -> JStat -> PrimRes
PrimInline (JExpr -> JExpr -> JStat
newByteArray JExpr
r JExpr
l)
PrimOp
NewPinnedByteArrayOp_Char -> \[JExpr
r] [JExpr
l] -> JStat -> PrimRes
PrimInline (JExpr -> JExpr -> JStat
newByteArray JExpr
r JExpr
l)
PrimOp
NewAlignedPinnedByteArrayOp_Char -> \[JExpr
r] [JExpr
l,JExpr
_align] -> JStat -> PrimRes
PrimInline (JExpr -> JExpr -> JStat
newByteArray JExpr
r JExpr
l)
PrimOp
MutableByteArrayIsPinnedOp -> \[JExpr
r] [JExpr
_] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
one_
PrimOp
ByteArrayIsPinnedOp -> \[JExpr
r] [JExpr
_] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
one_
PrimOp
ByteArrayContents_Char -> \[JExpr
a,JExpr
o] [JExpr
b] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat [JExpr
a JExpr -> JExpr -> JStat
|= JExpr
b, JExpr
o JExpr -> JExpr -> JStat
|= JExpr
zero_]
PrimOp
MutableByteArrayContents_Char -> \[JExpr
a,JExpr
o] [JExpr
b] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat [JExpr
a JExpr -> JExpr -> JStat
|= JExpr
b, JExpr
o JExpr -> JExpr -> JStat
|= JExpr
zero_]
PrimOp
ShrinkMutableByteArrayOp_Char -> \[] [JExpr
a,JExpr
n] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ FastString -> [JExpr] -> JStat
appS FastString
"h$shrinkMutableByteArray" [JExpr
a,JExpr
n]
PrimOp
ResizeMutableByteArrayOp_Char -> \[JExpr
r] [JExpr
a,JExpr
n] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$resizeMutableByteArray" [JExpr
a,JExpr
n]
PrimOp
UnsafeFreezeByteArrayOp -> \[JExpr
a] [JExpr
b] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
a JExpr -> JExpr -> JStat
|= JExpr
b
PrimOp
SizeofByteArrayOp -> \[JExpr
r] [JExpr
a] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"len"
PrimOp
SizeofMutableByteArrayOp -> \[JExpr
r] [JExpr
a] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"len"
PrimOp
GetSizeofMutableByteArrayOp -> \[JExpr
r] [JExpr
a] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"len"
PrimOp
IndexByteArrayOp_Char -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_u8 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_WideChar -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_i32 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_Int -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_i32 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_Word -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_u32 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_Addr -> \[JExpr
r1,JExpr
r2] [JExpr
a,JExpr
i] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JStat) -> JStat
forall a. ToSat a => a -> JStat
jVar \JExpr
t -> [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
t JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr"
, JExpr -> [JStat] -> [JStat] -> JStat
ifBlockS (JExpr
t JExpr -> JExpr -> JExpr
.&&. JExpr
t JExpr -> JExpr -> JExpr
.! (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
two_))
[ JExpr
r1 JExpr -> JExpr -> JStat
|= JExpr
t JExpr -> JExpr -> JExpr
.! (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
two_) JExpr -> JExpr -> JExpr
.! JExpr
zero_
, JExpr
r2 JExpr -> JExpr -> JStat
|= JExpr
t JExpr -> JExpr -> JExpr
.! (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
two_) JExpr -> JExpr -> JExpr
.! JExpr
one_
]
[ JExpr
r1 JExpr -> JExpr -> JStat
|= JExpr
null_
, JExpr
r2 JExpr -> JExpr -> JStat
|= JExpr
zero_
]
]
PrimOp
IndexByteArrayOp_Float -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_f32 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_Double -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
7) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_f64 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_StablePtr -> \[JExpr
r1,JExpr
r2] [JExpr
a,JExpr
i] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
r1 JExpr -> JExpr -> JStat
|= FastString -> JExpr
var FastString
"h$stablePtrBuf"
, JExpr
r2 JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_i32 JExpr
a JExpr
i
]
PrimOp
IndexByteArrayOp_Int8 -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_i8 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_Int16 -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
1) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_i16 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_Int32 -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_i32 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_Int64 -> \[JExpr
h,JExpr
l] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
7) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
h JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_i32 JExpr
a (JExpr -> JExpr -> JExpr
Add (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
one_) JExpr
one_)
, JExpr
l JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_u32 JExpr
a (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
one_)
]
PrimOp
IndexByteArrayOp_Word8 -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_u8 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_Word16 -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
1) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_u16 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_Word32 -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_u32 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_Word64 -> \[JExpr
h,JExpr
l] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
7) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
h JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_u32 JExpr
a (JExpr -> JExpr -> JExpr
Add (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
one_) JExpr
one_)
, JExpr
l JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_u32 JExpr
a (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
one_)
]
PrimOp
ReadByteArrayOp_Char -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_u8 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_WideChar -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_i32 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_Int -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_i32 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_Word -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_u32 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_Addr -> \[JExpr
r1,JExpr
r2] [JExpr
a,JExpr
i] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JStat) -> JStat
forall a. ToSat a => a -> JStat
jVar \JExpr
x -> [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
x JExpr -> JExpr -> JStat
|= JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
two_
, JExpr -> JStat -> JStat -> JStat
ifS (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.&&. JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.! JExpr
x)
([JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat [ JExpr
r1 JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.! JExpr
x JExpr -> JExpr -> JExpr
.! JExpr
zero_
, JExpr
r2 JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.! JExpr
x JExpr -> JExpr -> JExpr
.! JExpr
one_
])
([JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat [JExpr
r1 JExpr -> JExpr -> JStat
|= JExpr
null_, JExpr
r2 JExpr -> JExpr -> JStat
|= JExpr
one_])
]
PrimOp
ReadByteArrayOp_Float -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_f32 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_Double -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
7) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_f64 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_StablePtr -> \[JExpr
r1,JExpr
r2] [JExpr
a,JExpr
i] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
r1 JExpr -> JExpr -> JStat
|= FastString -> JExpr
var FastString
"h$stablePtrBuf"
, JExpr
r2 JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_i32 JExpr
a JExpr
i
]
PrimOp
ReadByteArrayOp_Int8 -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_i8 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_Int16 -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
1) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_i16 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_Int32 -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_i32 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_Int64 -> \[JExpr
h,JExpr
l] [JExpr
a,JExpr
i] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
7) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
h JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_i32 JExpr
a (JExpr -> JExpr -> JExpr
Add (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
one_) JExpr
one_)
, JExpr
l JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_u32 JExpr
a (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
one_)
]
PrimOp
ReadByteArrayOp_Word8 -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_u8 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_Word16 -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
1) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_u16 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_Word32 -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_u32 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_Word64 -> \[JExpr
h,JExpr
l] [JExpr
a,JExpr
i] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
7) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
h JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_u32 JExpr
a (JExpr -> JExpr -> JExpr
Add (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
one_) JExpr
one_)
, JExpr
l JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_u32 JExpr
a (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
one_)
]
PrimOp
WriteByteArrayOp_Char -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_u8 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_WideChar -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_i32 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_Int -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_i32 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_Word -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_u32 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_Addr -> \[] [JExpr
a,JExpr
i,JExpr
e1,JExpr
e2] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr -> JStat -> JStat -> JStat
ifS (JExpr -> JExpr
Not (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr")) (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JStat
|= JVal -> JExpr
ValExpr ([JExpr] -> JVal
JList [])) JStat
forall a. Monoid a => a
mempty
, JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.! (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
two_) JExpr -> JExpr -> JStat
|= JVal -> JExpr
ValExpr ([JExpr] -> JVal
JList [JExpr
e1, JExpr
e2])
]
PrimOp
WriteByteArrayOp_Float -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_f32 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_Double -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
7) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_f64 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_StablePtr -> \[] [JExpr
a,JExpr
i,JExpr
_e1,JExpr
e2] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_i32 JExpr
a JExpr
i JExpr
e2
PrimOp
WriteByteArrayOp_Int8 -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_i8 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_Int16 -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
1) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_i16 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_Int32 -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_i32 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_Int64 -> \[] [JExpr
a,JExpr
i,JExpr
e1,JExpr
e2] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
7) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr -> JExpr -> JExpr -> JStat
write_i32 JExpr
a (JExpr -> JExpr -> JExpr
Add (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
one_) JExpr
one_) JExpr
e1
, JExpr -> JExpr -> JExpr -> JStat
write_u32 JExpr
a (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
one_) JExpr
e2
]
PrimOp
WriteByteArrayOp_Word8 -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_u8 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_Word16 -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
1) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_u16 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_Word32 -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_u32 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_Word64 -> \[] [JExpr
a,JExpr
i,JExpr
h,JExpr
l] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
7) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr -> JExpr -> JExpr -> JStat
write_u32 JExpr
a (JExpr -> JExpr -> JExpr
Add (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
one_) JExpr
one_) JExpr
h
, JExpr -> JExpr -> JExpr -> JStat
write_u32 JExpr
a (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
one_) JExpr
l
]
PrimOp
CompareByteArraysOp -> \[JExpr
r] [JExpr
a1,JExpr
o1,JExpr
a2,JExpr
o2,JExpr
n] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a1 (JExpr -> JExpr -> JExpr
Add JExpr
o1 (JExpr -> JExpr -> JExpr
Sub JExpr
n JExpr
1))
(JStat -> JStat) -> (JStat -> JStat) -> JStat -> JStat
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a2 (JExpr -> JExpr -> JExpr
Add JExpr
o2 (JExpr -> JExpr -> JExpr
Sub JExpr
n JExpr
1))
(JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$compareByteArrays" [JExpr
a1,JExpr
o1,JExpr
a2,JExpr
o2,JExpr
n]
PrimOp
CopyByteArrayOp -> \[] [JExpr
a1,JExpr
o1,JExpr
a2,JExpr
o2,JExpr
n] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a1 (JExpr -> JExpr -> JExpr
Add JExpr
o1 (JExpr -> JExpr -> JExpr
Sub JExpr
n JExpr
1))
(JStat -> JStat) -> (JStat -> JStat) -> JStat -> JStat
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a2 (JExpr -> JExpr -> JExpr
Add JExpr
o2 (JExpr -> JExpr -> JExpr
Sub JExpr
n JExpr
1))
(JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ FastString -> [JExpr] -> JStat
appS FastString
"h$copyMutableByteArray" [JExpr
a1,JExpr
o1,JExpr
a2,JExpr
o2,JExpr
n]
PrimOp
CopyMutableByteArrayOp -> \[] xs :: [JExpr]
xs@[JExpr
_a1,JExpr
_o1,JExpr
_a2,JExpr
_o2,JExpr
_n] -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
CopyByteArrayOp [] [JExpr]
xs
PrimOp
CopyByteArrayToAddrOp -> \[] xs :: [JExpr]
xs@[JExpr
_a1,JExpr
_o1,JExpr
_a2,JExpr
_o2,JExpr
_n] -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
CopyByteArrayOp [] [JExpr]
xs
PrimOp
CopyMutableByteArrayToAddrOp -> \[] xs :: [JExpr]
xs@[JExpr
_a1,JExpr
_o1,JExpr
_a2,JExpr
_o2,JExpr
_n] -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
CopyByteArrayOp [] [JExpr]
xs
PrimOp
CopyAddrToByteArrayOp -> \[] xs :: [JExpr]
xs@[JExpr
_ba,JExpr
_bo,JExpr
_aa,JExpr
_ao,JExpr
_n] -> Bool -> Bool -> Type -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
genPrim Bool
prof Bool
bound Type
ty PrimOp
CopyByteArrayOp [] [JExpr]
xs
PrimOp
SetByteArrayOp -> \[] [JExpr
a,JExpr
o,JExpr
n,JExpr
v] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
o (JExpr -> JExpr -> JExpr
Sub JExpr
n JExpr
1)) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> (JExpr -> JExpr) -> (JExpr -> [JStat]) -> JStat
loopBlockS JExpr
zero_ (JExpr -> JExpr -> JExpr
.<. JExpr
n) \JExpr
i ->
[ JExpr -> JExpr -> JExpr -> JStat
write_u8 JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
o JExpr
i) JExpr
v
, JExpr -> JStat
postIncrS JExpr
i
]
PrimOp
AtomicReadByteArrayOp_Int -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_i32 JExpr
a JExpr
i
PrimOp
AtomicWriteByteArrayOp_Int -> \[] [JExpr
a,JExpr
i,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_i32 JExpr
a JExpr
i JExpr
v
PrimOp
FetchAddByteArrayOp_Int -> \[JExpr
r] [JExpr
a,JExpr
i,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JExpr -> JExpr)
-> JExpr -> JExpr -> JExpr -> JExpr -> JStat
fetchOpByteArray JExpr -> JExpr -> JExpr
Add JExpr
r JExpr
a JExpr
i JExpr
v
PrimOp
FetchSubByteArrayOp_Int -> \[JExpr
r] [JExpr
a,JExpr
i,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JExpr -> JExpr)
-> JExpr -> JExpr -> JExpr -> JExpr -> JStat
fetchOpByteArray JExpr -> JExpr -> JExpr
Sub JExpr
r JExpr
a JExpr
i JExpr
v
PrimOp
FetchAndByteArrayOp_Int -> \[JExpr
r] [JExpr
a,JExpr
i,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JExpr -> JExpr)
-> JExpr -> JExpr -> JExpr -> JExpr -> JStat
fetchOpByteArray JExpr -> JExpr -> JExpr
BAnd JExpr
r JExpr
a JExpr
i JExpr
v
PrimOp
FetchOrByteArrayOp_Int -> \[JExpr
r] [JExpr
a,JExpr
i,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JExpr -> JExpr)
-> JExpr -> JExpr -> JExpr -> JExpr -> JStat
fetchOpByteArray JExpr -> JExpr -> JExpr
BOr JExpr
r JExpr
a JExpr
i JExpr
v
PrimOp
FetchNandByteArrayOp_Int -> \[JExpr
r] [JExpr
a,JExpr
i,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JExpr -> JExpr)
-> JExpr -> JExpr -> JExpr -> JExpr -> JStat
fetchOpByteArray (\JExpr
x JExpr
y -> JExpr -> JExpr
BNot (JExpr -> JExpr -> JExpr
BAnd JExpr
x JExpr
y)) JExpr
r JExpr
a JExpr
i JExpr
v
PrimOp
FetchXorByteArrayOp_Int -> \[JExpr
r] [JExpr
a,JExpr
i,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JExpr -> JExpr)
-> JExpr -> JExpr -> JExpr -> JExpr -> JStat
fetchOpByteArray JExpr -> JExpr -> JExpr
BXor JExpr
r JExpr
a JExpr
i JExpr
v
PrimOp
AddrAddOp -> \[JExpr
a',JExpr
o'] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat [JExpr
a' JExpr -> JExpr -> JStat
|= JExpr
a, JExpr
o' JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
Add JExpr
o JExpr
i]
PrimOp
AddrSubOp -> \[JExpr
i] [JExpr
_a1,JExpr
o1,JExpr
_a2,JExpr
o2] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
i JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
Sub JExpr
o1 JExpr
o2
PrimOp
AddrRemOp -> \[JExpr
r] [JExpr
_a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
Mod JExpr
o JExpr
i
PrimOp
AddrToIntOp -> \[JExpr
i] [JExpr
_a,JExpr
o] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
i JExpr -> JExpr -> JStat
|= JExpr
o
PrimOp
IntToAddrOp -> \[JExpr
a,JExpr
o] [JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat [JExpr
a JExpr -> JExpr -> JStat
|= JExpr
null_, JExpr
o JExpr -> JExpr -> JStat
|= JExpr
i]
PrimOp
AddrGtOp -> \[JExpr
r] [JExpr
a1,JExpr
o1,JExpr
a2,JExpr
o2] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (FastString -> [JExpr] -> JExpr
app FastString
"h$comparePointer" [JExpr
a1,JExpr
o1,JExpr
a2,JExpr
o2] JExpr -> JExpr -> JExpr
.>. JExpr
zero_)
PrimOp
AddrGeOp -> \[JExpr
r] [JExpr
a1,JExpr
o1,JExpr
a2,JExpr
o2] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (FastString -> [JExpr] -> JExpr
app FastString
"h$comparePointer" [JExpr
a1,JExpr
o1,JExpr
a2,JExpr
o2] JExpr -> JExpr -> JExpr
.>=. JExpr
zero_)
PrimOp
AddrEqOp -> \[JExpr
r] [JExpr
a1,JExpr
o1,JExpr
a2,JExpr
o2] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (FastString -> [JExpr] -> JExpr
app FastString
"h$comparePointer" [JExpr
a1,JExpr
o1,JExpr
a2,JExpr
o2] JExpr -> JExpr -> JExpr
.===. JExpr
zero_)
PrimOp
AddrNeOp -> \[JExpr
r] [JExpr
a1,JExpr
o1,JExpr
a2,JExpr
o2] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (FastString -> [JExpr] -> JExpr
app FastString
"h$comparePointer" [JExpr
a1,JExpr
o1,JExpr
a2,JExpr
o2] JExpr -> JExpr -> JExpr
.!==. JExpr
zero_)
PrimOp
AddrLtOp -> \[JExpr
r] [JExpr
a1,JExpr
o1,JExpr
a2,JExpr
o2] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (FastString -> [JExpr] -> JExpr
app FastString
"h$comparePointer" [JExpr
a1,JExpr
o1,JExpr
a2,JExpr
o2] JExpr -> JExpr -> JExpr
.<. JExpr
zero_)
PrimOp
AddrLeOp -> \[JExpr
r] [JExpr
a1,JExpr
o1,JExpr
a2,JExpr
o2] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (FastString -> [JExpr] -> JExpr
app FastString
"h$comparePointer" [JExpr
a1,JExpr
o1,JExpr
a2,JExpr
o2] JExpr -> JExpr -> JExpr
.<=. JExpr
zero_)
PrimOp
IndexOffAddrOp_Char -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off8 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
c JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u8 JExpr
a (JExpr -> JExpr -> JExpr
off8 JExpr
o JExpr
i)
PrimOp
IndexOffAddrOp_WideChar -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
c JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i)
PrimOp
IndexOffAddrOp_Int -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
c JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i)
PrimOp
IndexOffAddrOp_Word -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
c JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i)
PrimOp
IndexOffAddrOp_Addr -> \[JExpr
ca,JExpr
co] [JExpr
a,JExpr
o,JExpr
i] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr") (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i)
(JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> [JStat] -> [JStat] -> JStat
ifBlockS (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr " JExpr -> JExpr -> JExpr
.&&. JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.! (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
two_))
[ JExpr
ca JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.! (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) JExpr -> JExpr -> JExpr
.! JExpr
zero_
, JExpr
co JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.! (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) JExpr -> JExpr -> JExpr
.! JExpr
one_
]
[ JExpr
ca JExpr -> JExpr -> JStat
|= JExpr
null_
, JExpr
co JExpr -> JExpr -> JStat
|= JExpr
zero_
]
PrimOp
IndexOffAddrOp_Float -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
c JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_f32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i)
PrimOp
IndexOffAddrOp_Double -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off64 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
c JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_f64 JExpr
a (JExpr -> JExpr -> JExpr
off64 JExpr
o JExpr
i)
PrimOp
IndexOffAddrOp_StablePtr -> \[JExpr
c1,JExpr
c2] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
c1 JExpr -> JExpr -> JStat
|= FastString -> JExpr
var FastString
"h$stablePtrBuf"
, JExpr
c2 JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i)
]
PrimOp
IndexOffAddrOp_Int8 -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off8 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
c JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i8 JExpr
a (JExpr -> JExpr -> JExpr
off8 JExpr
o JExpr
i)
PrimOp
IndexOffAddrOp_Int16 -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off16 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
c JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i16 JExpr
a (JExpr -> JExpr -> JExpr
off16 JExpr
o JExpr
i)
PrimOp
IndexOffAddrOp_Int32 -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
c JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i)
PrimOp
IndexOffAddrOp_Int64 -> \[JExpr
h,JExpr
l] [JExpr
a,JExpr
o,JExpr
i] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
h JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i32 JExpr
a (JExpr -> JExpr -> JExpr
Add (JExpr -> JExpr -> JExpr
off64 JExpr
o JExpr
i) (Integer -> JExpr
Int Integer
4))
, JExpr
l JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a (JExpr -> JExpr -> JExpr
off64 JExpr
o JExpr
i)
]
PrimOp
IndexOffAddrOp_Word8 -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off8 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
c JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u8 JExpr
a (JExpr -> JExpr -> JExpr
off8 JExpr
o JExpr
i)
PrimOp
IndexOffAddrOp_Word16 -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off16 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
c JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u16 JExpr
a (JExpr -> JExpr -> JExpr
off16 JExpr
o JExpr
i)
PrimOp
IndexOffAddrOp_Word32 -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
c JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i)
PrimOp
IndexOffAddrOp_Word64 -> \[JExpr
h,JExpr
l] [JExpr
a,JExpr
o,JExpr
i] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
h JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a (JExpr -> JExpr -> JExpr
Add (JExpr -> JExpr -> JExpr
off64 JExpr
o JExpr
i) (Integer -> JExpr
Int Integer
4))
, JExpr
l JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a (JExpr -> JExpr -> JExpr
off64 JExpr
o JExpr
i)
]
PrimOp
ReadOffAddrOp_Char -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off8 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
c JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u8 JExpr
a (JExpr -> JExpr -> JExpr
off8 JExpr
o JExpr
i)
PrimOp
ReadOffAddrOp_WideChar -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
c JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i)
PrimOp
ReadOffAddrOp_Int -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
c JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i)
PrimOp
ReadOffAddrOp_Word -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
c JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i)
PrimOp
ReadOffAddrOp_Addr -> \[JExpr
c1,JExpr
c2] [JExpr
a,JExpr
o,JExpr
i] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JStat) -> JStat
forall a. ToSat a => a -> JStat
jVar \JExpr
x -> [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
x JExpr -> JExpr -> JStat
|= JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
two_
, Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr") (JExpr -> JExpr -> JExpr
Add JExpr
o JExpr
x) (JStat -> JStat) -> JStat -> JStat
forall a b. (a -> b) -> a -> b
$
JExpr -> [JStat] -> [JStat] -> JStat
ifBlockS (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.&&. JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.! (JExpr -> JExpr -> JExpr
Add JExpr
o JExpr
x))
[ JExpr
c1 JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.! (JExpr -> JExpr -> JExpr
Add JExpr
o JExpr
x) JExpr -> JExpr -> JExpr
.! JExpr
zero_
, JExpr
c2 JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.! (JExpr -> JExpr -> JExpr
Add JExpr
o JExpr
x) JExpr -> JExpr -> JExpr
.! JExpr
one_
]
[ JExpr
c1 JExpr -> JExpr -> JStat
|= JExpr
null_
, JExpr
c2 JExpr -> JExpr -> JStat
|= JExpr
zero_
]
]
PrimOp
ReadOffAddrOp_Float -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
c JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_f32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i)
PrimOp
ReadOffAddrOp_Double -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off64 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
c JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_f64 JExpr
a (JExpr -> JExpr -> JExpr
off64 JExpr
o JExpr
i)
PrimOp
ReadOffAddrOp_StablePtr -> \[JExpr
c1,JExpr
c2] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
c1 JExpr -> JExpr -> JStat
|= FastString -> JExpr
var FastString
"h$stablePtrBuf"
, JExpr
c2 JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i)
]
PrimOp
ReadOffAddrOp_Int8 -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off8 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JStat
AssignStat JExpr
c (JExpr -> JStat) -> JExpr -> JStat
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr
read_boff_i8 JExpr
a (JExpr -> JExpr -> JExpr
off8 JExpr
o JExpr
i)
PrimOp
ReadOffAddrOp_Int16 -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off16 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JStat
AssignStat JExpr
c (JExpr -> JStat) -> JExpr -> JStat
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr
read_boff_i16 JExpr
a (JExpr -> JExpr -> JExpr
off16 JExpr
o JExpr
i)
PrimOp
ReadOffAddrOp_Int32 -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JStat
AssignStat JExpr
c (JExpr -> JStat) -> JExpr -> JStat
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr
read_boff_i32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i)
PrimOp
ReadOffAddrOp_Int64 -> \[JExpr
h,JExpr
l] [JExpr
a,JExpr
o,JExpr
i] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
h JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_i32 JExpr
a (JExpr -> JExpr -> JExpr
Add (JExpr -> JExpr -> JExpr
off64 JExpr
o JExpr
i) (Integer -> JExpr
Int Integer
4))
, JExpr
l JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_u32 JExpr
a (JExpr -> JExpr -> JExpr
off64 JExpr
o JExpr
i)
]
PrimOp
ReadOffAddrOp_Word8 -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off8 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JStat
AssignStat JExpr
c (JExpr -> JStat) -> JExpr -> JStat
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr
read_boff_u8 JExpr
a (JExpr -> JExpr -> JExpr
off8 JExpr
o JExpr
i)
PrimOp
ReadOffAddrOp_Word16 -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off16 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JStat
AssignStat JExpr
c (JExpr -> JStat) -> JExpr -> JStat
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr
read_boff_u16 JExpr
a (JExpr -> JExpr -> JExpr
off16 JExpr
o JExpr
i)
PrimOp
ReadOffAddrOp_Word32 -> \[JExpr
c] [JExpr
a,JExpr
o,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JStat
AssignStat JExpr
c (JExpr -> JStat) -> JExpr -> JStat
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i)
PrimOp
ReadOffAddrOp_Word64 -> \[JExpr
c1,JExpr
c2] [JExpr
a,JExpr
o,JExpr
i] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
c1 JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a (JExpr -> JExpr -> JExpr
Add (JExpr -> JExpr -> JExpr
off64 JExpr
o JExpr
i) (Integer -> JExpr
Int Integer
4))
, JExpr
c2 JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a (JExpr -> JExpr -> JExpr
off64 JExpr
o JExpr
i)
]
PrimOp
WriteOffAddrOp_Char -> \[] [JExpr
a,JExpr
o,JExpr
i,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off8 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_u8 JExpr
a (JExpr -> JExpr -> JExpr
off8 JExpr
o JExpr
i) JExpr
v
PrimOp
WriteOffAddrOp_WideChar -> \[] [JExpr
a,JExpr
o,JExpr
i,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_i32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) JExpr
v
PrimOp
WriteOffAddrOp_Int -> \[] [JExpr
a,JExpr
o,JExpr
i,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_i32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) JExpr
v
PrimOp
WriteOffAddrOp_Word -> \[] [JExpr
a,JExpr
o,JExpr
i,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_u32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) JExpr
v
PrimOp
WriteOffAddrOp_Addr -> \[] [JExpr
a,JExpr
o,JExpr
i,JExpr
va,JExpr
vo] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr -> JStat -> JStat -> JStat
ifS (JExpr -> JExpr
Not (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr")) (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JStat
|= JVal -> JExpr
ValExpr ([JExpr] -> JVal
JList [])) JStat
forall a. Monoid a => a
mempty
, Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr") (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> JStat) -> JStat -> JStat
forall a b. (a -> b) -> a -> b
$
JExpr -> JExpr -> JStat
AssignStat (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.! (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i)) (JExpr -> JStat) -> JExpr -> JStat
forall a b. (a -> b) -> a -> b
$ JVal -> JExpr
ValExpr ([JExpr] -> JVal
JList [JExpr
va, JExpr
vo])
]
PrimOp
WriteOffAddrOp_Float -> \[] [JExpr
a,JExpr
o,JExpr
i,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_f32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) JExpr
v
PrimOp
WriteOffAddrOp_Double -> \[] [JExpr
a,JExpr
o,JExpr
i,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off64 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_f64 JExpr
a (JExpr -> JExpr -> JExpr
off64 JExpr
o JExpr
i) JExpr
v
PrimOp
WriteOffAddrOp_StablePtr -> \[] [JExpr
a,JExpr
o,JExpr
i,JExpr
_v1,JExpr
v2] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_u32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) JExpr
v2
PrimOp
WriteOffAddrOp_Int8 -> \[] [JExpr
a,JExpr
o,JExpr
i,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off8 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_i8 JExpr
a (JExpr -> JExpr -> JExpr
off8 JExpr
o JExpr
i) JExpr
v
PrimOp
WriteOffAddrOp_Int16 -> \[] [JExpr
a,JExpr
o,JExpr
i,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off16 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_i16 JExpr
a (JExpr -> JExpr -> JExpr
off16 JExpr
o JExpr
i) JExpr
v
PrimOp
WriteOffAddrOp_Int32 -> \[] [JExpr
a,JExpr
o,JExpr
i,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_i32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) JExpr
v
PrimOp
WriteOffAddrOp_Int64 -> \[] [JExpr
a,JExpr
o,JExpr
i,JExpr
v1,JExpr
v2] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off64 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr -> JExpr -> JExpr -> JStat
write_boff_i32 JExpr
a (JExpr -> JExpr -> JExpr
Add (JExpr -> JExpr -> JExpr
off64 JExpr
o JExpr
i) (Integer -> JExpr
Int Integer
4)) JExpr
v1
, JExpr -> JExpr -> JExpr -> JStat
write_boff_u32 JExpr
a (JExpr -> JExpr -> JExpr
off64 JExpr
o JExpr
i) JExpr
v2
]
PrimOp
WriteOffAddrOp_Word8 -> \[] [JExpr
a,JExpr
o,JExpr
i,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off8 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_u8 JExpr
a (JExpr -> JExpr -> JExpr
off8 JExpr
o JExpr
i) JExpr
v
PrimOp
WriteOffAddrOp_Word16 -> \[] [JExpr
a,JExpr
o,JExpr
i,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off16 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_u16 JExpr
a (JExpr -> JExpr -> JExpr
off16 JExpr
o JExpr
i) JExpr
v
PrimOp
WriteOffAddrOp_Word32 -> \[] [JExpr
a,JExpr
o,JExpr
i,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_u32 JExpr
a (JExpr -> JExpr -> JExpr
off32 JExpr
o JExpr
i) JExpr
v
PrimOp
WriteOffAddrOp_Word64 -> \[] [JExpr
a,JExpr
o,JExpr
i,JExpr
v1,JExpr
v2] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
off64 JExpr
o JExpr
i) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr -> JExpr -> JExpr -> JStat
write_boff_u32 JExpr
a (JExpr -> JExpr -> JExpr
Add (JExpr -> JExpr -> JExpr
off64 JExpr
o JExpr
i) (Integer -> JExpr
Int Integer
4)) JExpr
v1
, JExpr -> JExpr -> JExpr -> JStat
write_boff_u32 JExpr
a (JExpr -> JExpr -> JExpr
off64 JExpr
o JExpr
i) JExpr
v2
]
PrimOp
NewMutVarOp -> \[JExpr
r] [JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
New (FastString -> [JExpr] -> JExpr
app FastString
"h$MutVar" [JExpr
x])
PrimOp
ReadMutVarOp -> \[JExpr
r] [JExpr
m] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
m JExpr -> FastString -> JExpr
.^ FastString
"val"
PrimOp
WriteMutVarOp -> \[] [JExpr
m,JExpr
x] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
m JExpr -> FastString -> JExpr
.^ FastString
"val" JExpr -> JExpr -> JStat
|= JExpr
x
PrimOp
AtomicModifyMutVar2Op -> \[JExpr
r1,JExpr
r2] [JExpr
m,JExpr
f] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
r1,JExpr
r2] FastString
"h$atomicModifyMutVar2" [JExpr
m,JExpr
f]
PrimOp
AtomicModifyMutVar_Op -> \[JExpr
r1,JExpr
r2] [JExpr
m,JExpr
f] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
r1,JExpr
r2] FastString
"h$atomicModifyMutVar" [JExpr
m,JExpr
f]
PrimOp
CasMutVarOp -> \[JExpr
status,JExpr
r] [JExpr
mv,JExpr
o,JExpr
n] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat -> JStat -> JStat
ifS (JExpr
mv JExpr -> FastString -> JExpr
.^ FastString
"val" JExpr -> JExpr -> JExpr
.===. JExpr
o)
([JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat [JExpr
status JExpr -> JExpr -> JStat
|= JExpr
zero_, JExpr
r JExpr -> JExpr -> JStat
|= JExpr
n, JExpr
mv JExpr -> FastString -> JExpr
.^ FastString
"val" JExpr -> JExpr -> JStat
|= JExpr
n])
([JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat [JExpr
status JExpr -> JExpr -> JStat
|= JExpr
one_ , JExpr
r JExpr -> JExpr -> JStat
|= JExpr
mv JExpr -> FastString -> JExpr
.^ FastString
"val"])
PrimOp
CatchOp -> \[JExpr
_r] [JExpr
a,JExpr
handler] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$catch" [JExpr
a, JExpr
handler])
PrimOp
RaiseOp -> \[JExpr]
_r [JExpr
a] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$throw" [JExpr
a, JExpr
false_])
PrimOp
RaiseIOOp -> \[JExpr]
_r [JExpr
a] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$throw" [JExpr
a, JExpr
false_])
PrimOp
RaiseUnderflowOp -> \[JExpr]
_r [] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$throw" [FastString -> JExpr
var FastString
"h$baseZCGHCziExceptionziTypeziunderflowException", JExpr
false_])
PrimOp
RaiseOverflowOp -> \[JExpr]
_r [] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$throw" [FastString -> JExpr
var FastString
"h$baseZCGHCziExceptionziTypezioverflowException", JExpr
false_])
PrimOp
RaiseDivZeroOp -> \[JExpr]
_r [] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$throw" [FastString -> JExpr
var FastString
"h$baseZCGHCziExceptionziTypezidivZZeroException", JExpr
false_])
PrimOp
MaskAsyncExceptionsOp -> \[JExpr]
_r [JExpr
a] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$maskAsync" [JExpr
a])
PrimOp
MaskUninterruptibleOp -> \[JExpr]
_r [JExpr
a] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$maskUnintAsync" [JExpr
a])
PrimOp
UnmaskAsyncExceptionsOp -> \[JExpr]
_r [JExpr
a] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$unmaskAsync" [JExpr
a])
PrimOp
MaskStatus -> \[JExpr
r] [] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$maskStatus" []
PrimOp
AtomicallyOp -> \[JExpr
_r] [JExpr
a] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$atomically" [JExpr
a])
PrimOp
RetryOp -> \[JExpr]
_r [] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$stmRetry" [])
PrimOp
CatchRetryOp -> \[JExpr
_r] [JExpr
a,JExpr
b] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$stmCatchRetry" [JExpr
a,JExpr
b])
PrimOp
CatchSTMOp -> \[JExpr
_r] [JExpr
a,JExpr
h] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$catchStm" [JExpr
a,JExpr
h])
PrimOp
NewTVarOp -> \[JExpr
tv] [JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
tv JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$newTVar" [JExpr
v]
PrimOp
ReadTVarOp -> \[JExpr
r] [JExpr
tv] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$readTVar" [JExpr
tv]
PrimOp
ReadTVarIOOp -> \[JExpr
r] [JExpr
tv] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$readTVarIO" [JExpr
tv]
PrimOp
WriteTVarOp -> \[] [JExpr
tv,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ FastString -> [JExpr] -> JStat
appS FastString
"h$writeTVar" [JExpr
tv,JExpr
v]
PrimOp
NewMVarOp -> \[JExpr
r] [] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
New (FastString -> [JExpr] -> JExpr
app FastString
"h$MVar" [])
PrimOp
TakeMVarOp -> \[JExpr
_r] [JExpr
m] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$takeMVar" [JExpr
m])
PrimOp
TryTakeMVarOp -> \[JExpr
r,JExpr
v] [JExpr
m] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
r,JExpr
v] FastString
"h$tryTakeMVar" [JExpr
m]
PrimOp
PutMVarOp -> \[] [JExpr
m,JExpr
v] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$putMVar" [JExpr
m,JExpr
v])
PrimOp
TryPutMVarOp -> \[JExpr
r] [JExpr
m,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$tryPutMVar" [JExpr
m,JExpr
v]
PrimOp
ReadMVarOp -> \[JExpr
_r] [JExpr
m] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$readMVar" [JExpr
m])
PrimOp
TryReadMVarOp -> \[JExpr
r,JExpr
v] [JExpr
m] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
v JExpr -> JExpr -> JStat
|= JExpr
m JExpr -> FastString -> JExpr
.^ FastString
"val"
, JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if01 (JExpr
v JExpr -> JExpr -> JExpr
.===. JExpr
null_)
]
PrimOp
IsEmptyMVarOp -> \[JExpr
r] [JExpr
m] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
m JExpr -> FastString -> JExpr
.^ FastString
"val" JExpr -> JExpr -> JExpr
.===. JExpr
null_)
PrimOp
DelayOp -> \[] [JExpr
t] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$delayThread" [JExpr
t])
PrimOp
WaitReadOp -> \[] [JExpr
fd] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$waidRead" [JExpr
fd])
PrimOp
WaitWriteOp -> \[] [JExpr
fd] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$waitWrite" [JExpr
fd])
PrimOp
ForkOp -> \[JExpr
_tid] [JExpr
x] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$fork" [JExpr
x, JExpr
true_])
PrimOp
ForkOnOp -> \[JExpr
_tid] [JExpr
_p,JExpr
x] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$fork" [JExpr
x, JExpr
true_])
PrimOp
KillThreadOp -> \[] [JExpr
tid,JExpr
ex] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$killThread" [JExpr
tid,JExpr
ex])
PrimOp
YieldOp -> \[] [] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$yield" [])
PrimOp
MyThreadIdOp -> \[JExpr
r] [] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> JExpr
var FastString
"h$currentThread"
PrimOp
IsCurrentThreadBoundOp -> \[JExpr
r] [] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
one_
PrimOp
NoDuplicateOp -> \[] [] -> JStat -> PrimRes
PrimInline JStat
forall a. Monoid a => a
mempty
PrimOp
ThreadStatusOp -> \[JExpr
stat,JExpr
cap,JExpr
locked] [JExpr
tid] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
stat, JExpr
cap, JExpr
locked] FastString
"h$threadStatus" [JExpr
tid]
PrimOp
ListThreadsOp -> \[JExpr
r] [] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
r] FastString
"h$listThreads" []
PrimOp
GetThreadLabelOp -> \[JExpr
r1, JExpr
r2] [JExpr
t] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
r1, JExpr
r2] FastString
"h$getThreadLabel" [JExpr
t]
PrimOp
LabelThreadOp -> \[] [JExpr
t,JExpr
l] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
t JExpr -> FastString -> JExpr
.^ FastString
"label" JExpr -> JExpr -> JStat
|= JExpr
l
PrimOp
MkWeakOp -> \[JExpr
r] [JExpr
o,JExpr
b,JExpr
c] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$makeWeak" [JExpr
o,JExpr
b,JExpr
c]
PrimOp
MkWeakNoFinalizerOp -> \[JExpr
r] [JExpr
o,JExpr
b] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$makeWeakNoFinalizer" [JExpr
o,JExpr
b]
PrimOp
AddCFinalizerToWeakOp -> \[JExpr
r] [JExpr
_a1,JExpr
_a1o,JExpr
_a2,JExpr
_a2o,JExpr
_i,JExpr
_a3,JExpr
_a3o,JExpr
_w] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
one_
PrimOp
DeRefWeakOp -> \[JExpr
f,JExpr
v] [JExpr
w] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
v JExpr -> JExpr -> JStat
|= JExpr
w JExpr -> FastString -> JExpr
.^ FastString
"val"
, JExpr
f JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if01 (JExpr
v JExpr -> JExpr -> JExpr
.===. JExpr
null_)
]
PrimOp
FinalizeWeakOp -> \[JExpr
fl,JExpr
fin] [JExpr
w] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
fin, JExpr
fl] FastString
"h$finalizeWeak" [JExpr
w]
PrimOp
TouchOp -> \[] [JExpr
_e] -> JStat -> PrimRes
PrimInline JStat
forall a. Monoid a => a
mempty
PrimOp
KeepAliveOp -> \[JExpr
_r] [JExpr
x, JExpr
f] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
ReturnStat (FastString -> [JExpr] -> JExpr
app FastString
"h$keepAlive" [JExpr
x, JExpr
f])
PrimOp
MakeStablePtrOp -> \[JExpr
s1,JExpr
s2] [JExpr
a] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
s1 JExpr -> JExpr -> JStat
|= FastString -> JExpr
var FastString
"h$stablePtrBuf"
, JExpr
s2 JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$makeStablePtr" [JExpr
a]
]
PrimOp
DeRefStablePtrOp -> \[JExpr
r] [JExpr
_s1,JExpr
s2] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$deRefStablePtr" [JExpr
s2]
PrimOp
EqStablePtrOp -> \[JExpr
r] [JExpr
_sa1,JExpr
sa2,JExpr
_sb1,JExpr
sb2] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
sa2 JExpr -> JExpr -> JExpr
.===. JExpr
sb2)
PrimOp
MakeStableNameOp -> \[JExpr
r] [JExpr
a] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$makeStableName" [JExpr
a]
PrimOp
StableNameToIntOp -> \[JExpr
r] [JExpr
s] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$stableNameInt" [JExpr
s]
PrimOp
CompactNewOp -> \[JExpr
c] [JExpr
s] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
c JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$compactNew" [JExpr
s]
PrimOp
CompactResizeOp -> \[] [JExpr
c,JExpr
s] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ FastString -> [JExpr] -> JStat
appS FastString
"h$compactResize" [JExpr
c,JExpr
s]
PrimOp
CompactContainsOp -> \[JExpr
r] [JExpr
c,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$compactContains" [JExpr
c,JExpr
v]
PrimOp
CompactContainsAnyOp -> \[JExpr
r] [JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$compactContainsAny" [JExpr
v]
PrimOp
CompactGetFirstBlockOp -> \[JExpr
ra,JExpr
ro,JExpr
s] [JExpr
c] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
ra,JExpr
ro,JExpr
s] FastString
"h$compactGetFirstBlock" [JExpr
c]
PrimOp
CompactGetNextBlockOp -> \[JExpr
ra,JExpr
ro,JExpr
s] [JExpr
c,JExpr
a,JExpr
o] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
ra,JExpr
ro,JExpr
s] FastString
"h$compactGetNextBlock" [JExpr
c,JExpr
a,JExpr
o]
PrimOp
CompactAllocateBlockOp -> \[JExpr
ra,JExpr
ro] [JExpr
size,JExpr
sa,JExpr
so] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
ra,JExpr
ro] FastString
"h$compactAllocateBlock" [JExpr
size,JExpr
sa,JExpr
so]
PrimOp
CompactFixupPointersOp -> \[JExpr
c,JExpr
newroota, JExpr
newrooto] [JExpr
blocka,JExpr
blocko,JExpr
roota,JExpr
rooto] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JExpr] -> FastString -> [JExpr] -> JStat
appT [JExpr
c,JExpr
newroota,JExpr
newrooto] FastString
"h$compactFixupPointers" [JExpr
blocka,JExpr
blocko,JExpr
roota,JExpr
rooto]
PrimOp
CompactAdd -> \[JExpr
_r] [JExpr
c,JExpr
o] ->
JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$compactAdd" [JExpr
c,JExpr
o])
PrimOp
CompactAddWithSharing -> \[JExpr
_r] [JExpr
c,JExpr
o] ->
JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$compactAddWithSharing" [JExpr
c,JExpr
o])
PrimOp
CompactSize -> \[JExpr
s] [JExpr
c] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
s JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$compactSize" [JExpr
c]
PrimOp
ReallyUnsafePtrEqualityOp -> \[JExpr
r] [JExpr
p1,JExpr
p2] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr
if10 (JExpr
p1 JExpr -> JExpr -> JExpr
.===. JExpr
p2)
PrimOp
ParOp -> \[JExpr
r] [JExpr
_a] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
zero_
PrimOp
SparkOp -> \[JExpr
r] [JExpr
a] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
a
PrimOp
SeqOp -> \[JExpr
_r] [JExpr
e] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$e" [JExpr
e])
PrimOp
NumSparks -> \[JExpr
r] [] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
zero_
PrimOp
DataToTagOp -> \[JExpr
_r] [JExpr
d] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
stack JExpr -> JExpr -> JExpr
.! JExpr -> JExpr
PreInc JExpr
sp JExpr -> JExpr -> JStat
|= FastString -> JExpr
var FastString
"h$dataToTag_e"
, JExpr -> JStat
returnS (FastString -> [JExpr] -> JExpr
app FastString
"h$e" [JExpr
d])
]
PrimOp
TagToEnumOp -> \[JExpr
r] [JExpr
tag] -> if
| Type -> Bool
isBoolTy Type
ty -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr -> JExpr
IfExpr JExpr
tag JExpr
true_ JExpr
false_
| Bool
otherwise -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$tagToEnum" [JExpr
tag]
PrimOp
AddrToAnyOp -> \[JExpr
r] [JExpr
d,JExpr
_o] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
d
PrimOp
GetCCSOfOp -> \[JExpr
a, JExpr
o] [JExpr
obj] -> if
| Bool
prof -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
a JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr -> JExpr
if_ (JExpr -> JExpr
isObject JExpr
obj)
(FastString -> [JExpr] -> JExpr
app FastString
"h$buildCCSPtr" [JExpr
obj JExpr -> FastString -> JExpr
.^ FastString
"cc"])
JExpr
null_
, JExpr
o JExpr -> JExpr -> JStat
|= JExpr
zero_
]
| Bool
otherwise -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
a JExpr -> JExpr -> JStat
|= JExpr
null_
, JExpr
o JExpr -> JExpr -> JStat
|= JExpr
zero_
]
PrimOp
GetCurrentCCSOp -> \[JExpr
a, JExpr
o] [JExpr
_dummy_arg] ->
let ptr :: JExpr
ptr = if Bool
prof then FastString -> [JExpr] -> JExpr
app FastString
"h$buildCCSPtr" [JExpr
jCurrentCCS]
else JExpr
null_
in JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
a JExpr -> JExpr -> JStat
|= JExpr
ptr
, JExpr
o JExpr -> JExpr -> JStat
|= JExpr
zero_
]
PrimOp
ClearCCSOp -> \[JExpr
_r] [JExpr
x] -> JStat -> PrimRes
PRPrimCall (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JStat
ReturnStat (FastString -> [JExpr] -> JExpr
app FastString
"h$clearCCS" [JExpr
x])
PrimOp
TraceEventOp -> \[] [JExpr
ed,JExpr
eo] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ FastString -> [JExpr] -> JStat
appS FastString
"h$traceEvent" [JExpr
ed,JExpr
eo]
PrimOp
TraceEventBinaryOp -> \[] [JExpr
ed,JExpr
eo,JExpr
len] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ FastString -> [JExpr] -> JStat
appS FastString
"h$traceEventBinary" [JExpr
ed,JExpr
eo,JExpr
len]
PrimOp
TraceMarkerOp -> \[] [JExpr
ed,JExpr
eo] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ FastString -> [JExpr] -> JStat
appS FastString
"h$traceMarker" [JExpr
ed,JExpr
eo]
PrimOp
IndexByteArrayOp_Word8AsChar -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u8 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_Word8AsWideChar -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i32 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_Word8AsAddr -> \[JExpr
r1,JExpr
r2] [JExpr
a,JExpr
i] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JStat) -> JStat
forall a. ToSat a => a -> JStat
jVar \JExpr
x -> [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
x JExpr -> JExpr -> JStat
|= JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
two_
, Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr") JExpr
x (JStat -> JStat) -> JStat -> JStat
forall a b. (a -> b) -> a -> b
$
JExpr -> JStat -> JStat -> JStat
ifS (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.&&. JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.! JExpr
x)
([JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat [ JExpr
r1 JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.! JExpr
x JExpr -> JExpr -> JExpr
.! JExpr
zero_
, JExpr
r2 JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.! JExpr
x JExpr -> JExpr -> JExpr
.! JExpr
one_
])
([JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat [JExpr
r1 JExpr -> JExpr -> JStat
|= JExpr
null_, JExpr
r2 JExpr -> JExpr -> JStat
|= JExpr
one_])
]
PrimOp
IndexByteArrayOp_Word8AsFloat -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_f32 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_Word8AsDouble -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
7) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_f64 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_Word8AsStablePtr -> \[JExpr
r1,JExpr
r2] [JExpr
a,JExpr
i] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
r1 JExpr -> JExpr -> JStat
|= FastString -> JExpr
var FastString
"h$stablePtrBuf"
, JExpr
r2 JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i32 JExpr
a JExpr
i
]
PrimOp
IndexByteArrayOp_Word8AsInt16 -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
1) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i16 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_Word8AsInt32 -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i32 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_Word8AsInt64 -> \[JExpr
h,JExpr
l] [JExpr
a,JExpr
i] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
h JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i32 JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i (Integer -> JExpr
Int Integer
4))
, JExpr
l JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a JExpr
i
]
PrimOp
IndexByteArrayOp_Word8AsInt -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i32 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_Word8AsWord16 -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
1) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u16 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_Word8AsWord32 -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a JExpr
i
PrimOp
IndexByteArrayOp_Word8AsWord64 -> \[JExpr
h,JExpr
l] [JExpr
a,JExpr
i] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
7) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
h JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i (Integer -> JExpr
Int Integer
4))
, JExpr
l JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a JExpr
i
]
PrimOp
IndexByteArrayOp_Word8AsWord -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_Word8AsChar -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u8 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_Word8AsWideChar -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i32 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_Word8AsAddr -> \[JExpr
r1,JExpr
r2] [JExpr
a,JExpr
i] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JStat) -> JStat
forall a. ToSat a => a -> JStat
jVar \JExpr
x -> [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
x JExpr -> JExpr -> JStat
|= JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
two_
, Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr") JExpr
x (JStat -> JStat) -> JStat -> JStat
forall a b. (a -> b) -> a -> b
$
JExpr -> JStat -> JStat -> JStat
ifS (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.&&. JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.! JExpr
x)
([JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat [ JExpr
r1 JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.! JExpr
x JExpr -> JExpr -> JExpr
.! JExpr
zero_
, JExpr
r2 JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.! JExpr
x JExpr -> JExpr -> JExpr
.! JExpr
one_
])
([JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat [JExpr
r1 JExpr -> JExpr -> JStat
|= JExpr
null_, JExpr
r2 JExpr -> JExpr -> JStat
|= JExpr
one_])
]
PrimOp
ReadByteArrayOp_Word8AsFloat -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_f32 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_Word8AsDouble -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
7) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_f64 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_Word8AsStablePtr -> \[JExpr
r1,JExpr
r2] [JExpr
a,JExpr
i] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
r1 JExpr -> JExpr -> JStat
|= FastString -> JExpr
var FastString
"h$stablePtrBuf"
, JExpr
r2 JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i32 JExpr
a JExpr
i
]
PrimOp
ReadByteArrayOp_Word8AsInt16 -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
1) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i16 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_Word8AsInt32 -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i32 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_Word8AsInt64 -> \[JExpr
h,JExpr
l] [JExpr
a,JExpr
i] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
h JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i32 JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i (Integer -> JExpr
Int Integer
4))
, JExpr
l JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a JExpr
i
]
PrimOp
ReadByteArrayOp_Word8AsInt -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_i32 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_Word8AsWord16 -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
1) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u16 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_Word8AsWord32 -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a JExpr
i
PrimOp
ReadByteArrayOp_Word8AsWord64 -> \[JExpr
h,JExpr
l] [JExpr
a,JExpr
i] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
7) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
h JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i (Integer -> JExpr
Int Integer
4))
, JExpr
l JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a JExpr
i
]
PrimOp
ReadByteArrayOp_Word8AsWord -> \[JExpr
r] [JExpr
a,JExpr
i] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a JExpr
i
PrimOp
WriteByteArrayOp_Word8AsChar -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_i8 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_Word8AsWideChar -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_i32 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_Word8AsAddr -> \[] [JExpr
a,JExpr
i,JExpr
e1,JExpr
e2] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr -> JStat -> JStat -> JStat
ifS (JExpr -> JExpr
Not (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr")) (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JStat
|= JVal -> JExpr
ValExpr ([JExpr] -> JVal
JList [])) JStat
forall a. Monoid a => a
mempty
, Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr") (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
two_) (JStat -> JStat) -> JStat -> JStat
forall a b. (a -> b) -> a -> b
$
JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"arr" JExpr -> JExpr -> JExpr
.! (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
two_) JExpr -> JExpr -> JStat
|= JVal -> JExpr
ValExpr ([JExpr] -> JVal
JList [JExpr
e1, JExpr
e2])
]
PrimOp
WriteByteArrayOp_Word8AsFloat -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_f32 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_Word8AsDouble -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
7) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_f64 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_Word8AsStablePtr -> \[] [JExpr
a,JExpr
i,JExpr
_e1,JExpr
e2] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_i32 JExpr
a JExpr
i JExpr
e2
PrimOp
WriteByteArrayOp_Word8AsInt16 -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
1) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_i16 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_Word8AsInt32 -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_i32 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_Word8AsInt64 -> \[] [JExpr
a,JExpr
i,JExpr
h,JExpr
l] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i
(JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat [ JExpr -> JExpr -> JExpr -> JStat
write_boff_i32 JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i (Integer -> JExpr
Int Integer
4)) JExpr
h
, JExpr -> JExpr -> JExpr -> JStat
write_boff_u32 JExpr
a JExpr
i JExpr
l
]
PrimOp
WriteByteArrayOp_Word8AsInt -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_i32 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_Word8AsWord16 -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
1) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_u16 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_Word8AsWord32 -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_u32 JExpr
a JExpr
i JExpr
e
PrimOp
WriteByteArrayOp_Word8AsWord64 -> \[] [JExpr
a,JExpr
i,JExpr
h,JExpr
l] ->
JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
7)
(JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat [ JExpr -> JExpr -> JExpr -> JStat
write_boff_u32 JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i (Integer -> JExpr
Int Integer
4)) JExpr
h
, JExpr -> JExpr -> JExpr -> JStat
write_boff_u32 JExpr
a JExpr
i JExpr
l
]
PrimOp
WriteByteArrayOp_Word8AsWord -> \[] [JExpr
a,JExpr
i,JExpr
e] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_u32 JExpr
a JExpr
i JExpr
e
PrimOp
CasByteArrayOp_Int -> \[JExpr
r] [JExpr
a,JExpr
i,JExpr
old,JExpr
new] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JExpr -> JExpr)
-> (JExpr -> JExpr -> JExpr -> JStat)
-> JExpr
-> JExpr
-> JExpr
-> JExpr
-> JExpr
-> JStat
casOp JExpr -> JExpr -> JExpr
read_i32 JExpr -> JExpr -> JExpr -> JStat
write_i32 JExpr
r JExpr
a JExpr
i JExpr
old JExpr
new
PrimOp
CasByteArrayOp_Int8 -> \[JExpr
r] [JExpr
a,JExpr
i,JExpr
old,JExpr
new] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a JExpr
i (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JExpr -> JExpr)
-> (JExpr -> JExpr -> JExpr -> JStat)
-> JExpr
-> JExpr
-> JExpr
-> JExpr
-> JExpr
-> JStat
casOp JExpr -> JExpr -> JExpr
read_i8 JExpr -> JExpr -> JExpr -> JStat
write_i8 JExpr
r JExpr
a JExpr
i JExpr
old JExpr
new
PrimOp
CasByteArrayOp_Int16 -> \[JExpr
r] [JExpr
a,JExpr
i,JExpr
old,JExpr
new] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
1) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JExpr -> JExpr)
-> (JExpr -> JExpr -> JExpr -> JStat)
-> JExpr
-> JExpr
-> JExpr
-> JExpr
-> JExpr
-> JStat
casOp JExpr -> JExpr -> JExpr
read_i16 JExpr -> JExpr -> JExpr -> JStat
write_i16 JExpr
r JExpr
a JExpr
i JExpr
old JExpr
new
PrimOp
CasByteArrayOp_Int32 -> \[JExpr
r] [JExpr
a,JExpr
i,JExpr
old,JExpr
new] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
i JExpr
3) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JExpr -> JExpr)
-> (JExpr -> JExpr -> JExpr -> JStat)
-> JExpr
-> JExpr
-> JExpr
-> JExpr
-> JExpr
-> JStat
casOp JExpr -> JExpr -> JExpr
read_i32 JExpr -> JExpr -> JExpr -> JStat
write_i32 JExpr
r JExpr
a JExpr
i JExpr
old JExpr
new
PrimOp
CasByteArrayOp_Int64 -> \[JExpr
r_h,JExpr
r_l] [JExpr
a,JExpr
i,JExpr
old_h,JExpr
old_l,JExpr
new_h,JExpr
new_l] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> (JStat -> JStat) -> JStat -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
bound JExpr
a (JExpr -> JExpr -> JExpr
Add (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
one_) JExpr
one_) (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$
(JExpr -> JExpr -> JStat) -> JStat
forall a. ToSat a => a -> JStat
jVar \JExpr
t_h JExpr
t_l -> [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat [ JExpr
t_h JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_i32 JExpr
a (JExpr -> JExpr -> JExpr
Add (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
one_) JExpr
one_)
, JExpr
t_l JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_u32 JExpr
a (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
one_)
, JExpr
r_h JExpr -> JExpr -> JStat
|= JExpr
t_h
, JExpr
r_l JExpr -> JExpr -> JStat
|= JExpr
t_l
, JExpr -> JStat -> JStat -> JStat
ifS (JExpr
t_l JExpr -> JExpr -> JExpr
.===. JExpr
old_l)
(JExpr -> [JStat] -> [JStat] -> JStat
ifBlockS (JExpr
t_h JExpr -> JExpr -> JExpr
.===. JExpr
old_h)
[ JExpr -> JExpr -> JExpr -> JStat
write_i32 JExpr
a (JExpr -> JExpr -> JExpr
Add (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
one_) JExpr
one_) JExpr
new_h
, JExpr -> JExpr -> JExpr -> JStat
write_u32 JExpr
a (JExpr
i JExpr -> JExpr -> JExpr
.<<. JExpr
one_) JExpr
new_l
]
[JStat]
forall a. Monoid a => a
mempty)
JStat
forall a. Monoid a => a
mempty
]
PrimOp
CasAddrOp_Addr -> \[JExpr
r_a,JExpr
r_o] [JExpr
a1,JExpr
o1,JExpr
a2,JExpr
o2,JExpr
a3,JExpr
o3] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$
[JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat [ JExpr -> JStat -> JStat -> JStat
ifS (FastString -> [JExpr] -> JExpr
app FastString
"h$comparePointer" [JExpr
a1,JExpr
o1,JExpr
a2,JExpr
o2])
(FastString -> [JExpr] -> JStat
appS FastString
"h$memcpy" [JExpr
a3,JExpr
o3,JExpr
a1,JExpr
o1,JExpr
8])
JStat
forall a. Monoid a => a
mempty
, JExpr
r_a JExpr -> JExpr -> JStat
|= JExpr
a1
, JExpr
r_o JExpr -> JExpr -> JStat
|= JExpr
o1
]
PrimOp
CasAddrOp_Word -> \[JExpr
r] [JExpr
a,JExpr
o,JExpr
old,JExpr
new] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JExpr -> JExpr)
-> (JExpr -> JExpr -> JExpr -> JStat)
-> JExpr
-> JExpr
-> JExpr
-> JExpr
-> JExpr
-> JStat
casOp JExpr -> JExpr -> JExpr
read_u32 JExpr -> JExpr -> JExpr -> JStat
write_u32 JExpr
r JExpr
a JExpr
o JExpr
old JExpr
new
PrimOp
CasAddrOp_Word8 -> \[JExpr
r] [JExpr
a,JExpr
o,JExpr
old,JExpr
new] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JExpr -> JExpr)
-> (JExpr -> JExpr -> JExpr -> JStat)
-> JExpr
-> JExpr
-> JExpr
-> JExpr
-> JExpr
-> JStat
casOp JExpr -> JExpr -> JExpr
read_u8 JExpr -> JExpr -> JExpr -> JStat
write_u8 JExpr
r JExpr
a JExpr
o JExpr
old JExpr
new
PrimOp
CasAddrOp_Word16 -> \[JExpr
r] [JExpr
a,JExpr
o,JExpr
old,JExpr
new] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JExpr -> JExpr)
-> (JExpr -> JExpr -> JExpr -> JStat)
-> JExpr
-> JExpr
-> JExpr
-> JExpr
-> JExpr
-> JStat
casOp JExpr -> JExpr -> JExpr
read_u16 JExpr -> JExpr -> JExpr -> JStat
write_u16 JExpr
r JExpr
a JExpr
o JExpr
old JExpr
new
PrimOp
CasAddrOp_Word32 -> \[JExpr
r] [JExpr
a,JExpr
o,JExpr
old,JExpr
new] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JExpr -> JExpr)
-> (JExpr -> JExpr -> JExpr -> JStat)
-> JExpr
-> JExpr
-> JExpr
-> JExpr
-> JExpr
-> JStat
casOp JExpr -> JExpr -> JExpr
read_u32 JExpr -> JExpr -> JExpr -> JStat
write_u32 JExpr
r JExpr
a JExpr
o JExpr
old JExpr
new
PrimOp
CasAddrOp_Word64 -> \[JExpr
r_h,JExpr
r_l] [JExpr
a,JExpr
o,JExpr
old_h,JExpr
old_l,JExpr
new_h,JExpr
new_l] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$
[JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat [ JExpr
r_h JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_u32 JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
o (Integer -> JExpr
Int Integer
4))
, JExpr
r_l JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_u32 JExpr
a JExpr
o
, JExpr -> JStat -> JStat -> JStat
ifS (JExpr
r_l JExpr -> JExpr -> JExpr
.===. JExpr
old_l)
(JExpr -> [JStat] -> [JStat] -> JStat
ifBlockS (JExpr
r_h JExpr -> JExpr -> JExpr
.===. JExpr
old_h)
[ JExpr -> JExpr -> JExpr -> JStat
write_u32 JExpr
a (JExpr -> JExpr -> JExpr
Add JExpr
o (Integer -> JExpr
Int Integer
4)) JExpr
new_h
, JExpr -> JExpr -> JExpr -> JStat
write_u32 JExpr
a JExpr
o JExpr
new_l
]
[JStat]
forall a. Monoid a => a
mempty)
JStat
forall a. Monoid a => a
mempty
]
PrimOp
FetchAddAddrOp_Word -> \[JExpr
r] [JExpr
a,JExpr
o,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JExpr -> JExpr)
-> JExpr -> JExpr -> JExpr -> JExpr -> JStat
fetchOpAddr JExpr -> JExpr -> JExpr
Add JExpr
r JExpr
a JExpr
o JExpr
v
PrimOp
FetchSubAddrOp_Word -> \[JExpr
r] [JExpr
a,JExpr
o,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JExpr -> JExpr)
-> JExpr -> JExpr -> JExpr -> JExpr -> JStat
fetchOpAddr JExpr -> JExpr -> JExpr
Sub JExpr
r JExpr
a JExpr
o JExpr
v
PrimOp
FetchAndAddrOp_Word -> \[JExpr
r] [JExpr
a,JExpr
o,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JExpr -> JExpr)
-> JExpr -> JExpr -> JExpr -> JExpr -> JStat
fetchOpAddr JExpr -> JExpr -> JExpr
BAnd JExpr
r JExpr
a JExpr
o JExpr
v
PrimOp
FetchNandAddrOp_Word -> \[JExpr
r] [JExpr
a,JExpr
o,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JExpr -> JExpr)
-> JExpr -> JExpr -> JExpr -> JExpr -> JStat
fetchOpAddr ((JExpr -> JExpr
BNot (JExpr -> JExpr) -> (JExpr -> JExpr) -> JExpr -> JExpr
forall b c a. (b -> c) -> (a -> b) -> a -> c
.) ((JExpr -> JExpr) -> JExpr -> JExpr)
-> (JExpr -> JExpr -> JExpr) -> JExpr -> JExpr -> JExpr
forall b c a. (b -> c) -> (a -> b) -> a -> c
. JExpr -> JExpr -> JExpr
BAnd) JExpr
r JExpr
a JExpr
o JExpr
v
PrimOp
FetchOrAddrOp_Word -> \[JExpr
r] [JExpr
a,JExpr
o,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JExpr -> JExpr)
-> JExpr -> JExpr -> JExpr -> JExpr -> JStat
fetchOpAddr JExpr -> JExpr -> JExpr
BOr JExpr
r JExpr
a JExpr
o JExpr
v
PrimOp
FetchXorAddrOp_Word -> \[JExpr
r] [JExpr
a,JExpr
o,JExpr
v] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ (JExpr -> JExpr -> JExpr)
-> JExpr -> JExpr -> JExpr -> JExpr -> JStat
fetchOpAddr JExpr -> JExpr -> JExpr
BXor JExpr
r JExpr
a JExpr
o JExpr
v
PrimOp
InterlockedExchange_Addr -> \[JExpr
r_a,JExpr
r_o] [JExpr
a1,JExpr
o1,JExpr
_a2,JExpr
o2] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$
[JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat [ JExpr
r_a JExpr -> JExpr -> JStat
|= JExpr
a1
, JExpr
r_o JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a1 JExpr
o1
, JExpr -> JExpr -> JExpr -> JStat
write_boff_u32 JExpr
a1 JExpr
o1 JExpr
o2
]
PrimOp
InterlockedExchange_Word -> \[JExpr
r] [JExpr
a,JExpr
o,JExpr
w] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$
[JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat [ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a JExpr
o
, JExpr -> JExpr -> JExpr -> JStat
write_boff_u32 JExpr
a JExpr
o JExpr
w
]
PrimOp
ShrinkSmallMutableArrayOp_Char -> \[] [JExpr
a,JExpr
n] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ FastString -> [JExpr] -> JStat
appS FastString
"h$shrinkMutableCharArray" [JExpr
a,JExpr
n]
PrimOp
GetSizeofSmallMutableArrayOp -> \[JExpr
r] [JExpr
a] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"length"
PrimOp
AtomicReadAddrOp_Word -> \[JExpr
r] [JExpr
a,JExpr
o] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr
r JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a JExpr
o
PrimOp
AtomicWriteAddrOp_Word -> \[] [JExpr
a,JExpr
o,JExpr
w] -> JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ JExpr -> JExpr -> JExpr -> JStat
write_boff_u32 JExpr
a JExpr
o JExpr
w
PrimOp
NewPromptTagOp -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
PrimOp
PromptOp -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
PrimOp
Control0Op -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
PrimOp
NewIOPortOp -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
PrimOp
ReadIOPortOp -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
PrimOp
WriteIOPortOp -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
PrimOp
GetSparkOp -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
PrimOp
AnyToAddrOp -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
PrimOp
MkApUpd0_Op -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
PrimOp
NewBCOOp -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
PrimOp
UnpackClosureOp -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
PrimOp
ClosureSizeOp -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
PrimOp
GetApStackValOp -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
PrimOp
WhereFromOp -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
PrimOp
SetThreadAllocationCounter -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecBroadcastOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecPackOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecUnpackOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecInsertOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecAddOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecSubOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecMulOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecDivOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecQuotOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecRemOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecNegOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecIndexByteArrayOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecReadByteArrayOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecWriteByteArrayOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecIndexOffAddrOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecReadOffAddrOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecWriteOffAddrOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecIndexScalarByteArrayOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecReadScalarByteArrayOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecWriteScalarByteArrayOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecIndexScalarOffAddrOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecReadScalarOffAddrOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
VecWriteScalarOffAddrOp PrimOpVecCat
_ Int
_ Width
_ -> PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op
PrimOp
PrefetchByteArrayOp3 -> [JExpr] -> [JExpr] -> PrimRes
forall (f :: * -> *) a. Foldable f => f a -> f a -> PrimRes
noOp
PrimOp
PrefetchMutableByteArrayOp3 -> [JExpr] -> [JExpr] -> PrimRes
forall (f :: * -> *) a. Foldable f => f a -> f a -> PrimRes
noOp
PrimOp
PrefetchAddrOp3 -> [JExpr] -> [JExpr] -> PrimRes
forall (f :: * -> *) a. Foldable f => f a -> f a -> PrimRes
noOp
PrimOp
PrefetchValueOp3 -> [JExpr] -> [JExpr] -> PrimRes
forall (f :: * -> *) a. Foldable f => f a -> f a -> PrimRes
noOp
PrimOp
PrefetchByteArrayOp2 -> [JExpr] -> [JExpr] -> PrimRes
forall (f :: * -> *) a. Foldable f => f a -> f a -> PrimRes
noOp
PrimOp
PrefetchMutableByteArrayOp2 -> [JExpr] -> [JExpr] -> PrimRes
forall (f :: * -> *) a. Foldable f => f a -> f a -> PrimRes
noOp
PrimOp
PrefetchAddrOp2 -> [JExpr] -> [JExpr] -> PrimRes
forall (f :: * -> *) a. Foldable f => f a -> f a -> PrimRes
noOp
PrimOp
PrefetchValueOp2 -> [JExpr] -> [JExpr] -> PrimRes
forall (f :: * -> *) a. Foldable f => f a -> f a -> PrimRes
noOp
PrimOp
PrefetchByteArrayOp1 -> [JExpr] -> [JExpr] -> PrimRes
forall (f :: * -> *) a. Foldable f => f a -> f a -> PrimRes
noOp
PrimOp
PrefetchMutableByteArrayOp1 -> [JExpr] -> [JExpr] -> PrimRes
forall (f :: * -> *) a. Foldable f => f a -> f a -> PrimRes
noOp
PrimOp
PrefetchAddrOp1 -> [JExpr] -> [JExpr] -> PrimRes
forall (f :: * -> *) a. Foldable f => f a -> f a -> PrimRes
noOp
PrimOp
PrefetchValueOp1 -> [JExpr] -> [JExpr] -> PrimRes
forall (f :: * -> *) a. Foldable f => f a -> f a -> PrimRes
noOp
PrimOp
PrefetchByteArrayOp0 -> [JExpr] -> [JExpr] -> PrimRes
forall (f :: * -> *) a. Foldable f => f a -> f a -> PrimRes
noOp
PrimOp
PrefetchMutableByteArrayOp0 -> [JExpr] -> [JExpr] -> PrimRes
forall (f :: * -> *) a. Foldable f => f a -> f a -> PrimRes
noOp
PrimOp
PrefetchAddrOp0 -> [JExpr] -> [JExpr] -> PrimRes
forall (f :: * -> *) a. Foldable f => f a -> f a -> PrimRes
noOp
PrimOp
PrefetchValueOp0 -> [JExpr] -> [JExpr] -> PrimRes
forall (f :: * -> *) a. Foldable f => f a -> f a -> PrimRes
noOp
unhandledPrimop :: PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop :: PrimOp -> [JExpr] -> [JExpr] -> PrimRes
unhandledPrimop PrimOp
op [JExpr]
rs [JExpr]
as = JStat -> PrimRes
PrimInline (JStat -> PrimRes) -> JStat -> PrimRes
forall a b. (a -> b) -> a -> b
$ [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ FastString -> [JExpr] -> JStat
appS FastString
"h$log" [String -> JExpr
forall a. ToJExpr a => a -> JExpr
toJExpr (String -> JExpr) -> String -> JExpr
forall a b. (a -> b) -> a -> b
$ [String] -> String
forall a. Monoid a => [a] -> a
mconcat
[ String
"warning, unhandled primop: "
, SDocContext -> SDoc -> String
renderWithContext SDocContext
defaultSDocContext (PrimOp -> SDoc
forall a. Outputable a => a -> SDoc
ppr PrimOp
op)
, String
" "
, (Int, Int) -> String
forall a. Show a => a -> String
show ([JExpr] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [JExpr]
rs, [JExpr] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [JExpr]
as)
]]
, FastString -> [JExpr] -> JStat
appS (String -> FastString
mkFastString (String -> FastString) -> String -> FastString
forall a b. (a -> b) -> a -> b
$ String
"h$primop_" String -> String -> String
forall a. [a] -> [a] -> [a]
++ String -> String
zEncodeString (SDocContext -> SDoc -> String
renderWithContext SDocContext
defaultSDocContext (PrimOp -> SDoc
forall a. Outputable a => a -> SDoc
ppr PrimOp
op))) [JExpr]
as
, [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat ([JStat] -> JStat) -> [JStat] -> JStat
forall a b. (a -> b) -> a -> b
$ (JExpr -> StgRet -> JStat) -> [JExpr] -> [StgRet] -> [JStat]
forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith (\JExpr
r StgRet
reg -> JExpr
r JExpr -> JExpr -> JStat
|= StgRet -> JExpr
forall a. ToJExpr a => a -> JExpr
toJExpr StgRet
reg) [JExpr]
rs (StgRet -> [StgRet]
forall a. Enum a => a -> [a]
enumFrom StgRet
Ret1)
]
noOp :: Foldable f => f a -> f a -> PrimRes
noOp :: forall (f :: * -> *) a. Foldable f => f a -> f a -> PrimRes
noOp = (f a -> PrimRes) -> f a -> f a -> PrimRes
forall a b. a -> b -> a
const ((f a -> PrimRes) -> f a -> f a -> PrimRes)
-> (PrimRes -> f a -> PrimRes) -> PrimRes -> f a -> f a -> PrimRes
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PrimRes -> f a -> PrimRes
forall a b. a -> b -> a
const (PrimRes -> f a -> f a -> PrimRes)
-> PrimRes -> f a -> f a -> PrimRes
forall a b. (a -> b) -> a -> b
$ JStat -> PrimRes
PrimInline JStat
forall a. Monoid a => a
mempty
appT :: [JExpr] -> FastString -> [JExpr] -> JStat
appT :: [JExpr] -> FastString -> [JExpr] -> JStat
appT [] FastString
f [JExpr]
xs = FastString -> [JExpr] -> JStat
appS FastString
f [JExpr]
xs
appT (JExpr
r:[JExpr]
rs) FastString
f [JExpr]
xs = [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
r JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
f [JExpr]
xs
, [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat ((JExpr -> StgRet -> JStat) -> [JExpr] -> [StgRet] -> [JStat]
forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith (\JExpr
r StgRet
ret -> JExpr
r JExpr -> JExpr -> JStat
|= StgRet -> JExpr
forall a. ToJExpr a => a -> JExpr
toJExpr StgRet
ret) [JExpr]
rs (StgRet -> [StgRet]
forall a. Enum a => a -> [a]
enumFrom StgRet
Ret1))
]
idx_i32, idx_u8, idx_u16, idx_f64, idx_f32 :: JExpr -> JExpr -> JExpr
idx_i32 :: JExpr -> JExpr -> JExpr
idx_i32 JExpr
a JExpr
i = JExpr -> JExpr -> JExpr
IdxExpr (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"i3") JExpr
i
idx_u8 :: JExpr -> JExpr -> JExpr
idx_u8 JExpr
a JExpr
i = JExpr -> JExpr -> JExpr
IdxExpr (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"u8") JExpr
i
idx_u16 :: JExpr -> JExpr -> JExpr
idx_u16 JExpr
a JExpr
i = JExpr -> JExpr -> JExpr
IdxExpr (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"u1") JExpr
i
idx_f64 :: JExpr -> JExpr -> JExpr
idx_f64 JExpr
a JExpr
i = JExpr -> JExpr -> JExpr
IdxExpr (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"f6") JExpr
i
idx_f32 :: JExpr -> JExpr -> JExpr
idx_f32 JExpr
a JExpr
i = JExpr -> JExpr -> JExpr
IdxExpr (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"f3") JExpr
i
read_u8 :: JExpr -> JExpr -> JExpr
read_u8 :: JExpr -> JExpr -> JExpr
read_u8 JExpr
a JExpr
i = JExpr -> JExpr -> JExpr
idx_u8 JExpr
a JExpr
i
read_u16 :: JExpr -> JExpr -> JExpr
read_u16 :: JExpr -> JExpr -> JExpr
read_u16 JExpr
a JExpr
i = JExpr -> JExpr -> JExpr
idx_u16 JExpr
a JExpr
i
read_u32 :: JExpr -> JExpr -> JExpr
read_u32 :: JExpr -> JExpr -> JExpr
read_u32 JExpr
a JExpr
i = JExpr -> JExpr
toU32 (JExpr -> JExpr -> JExpr
idx_i32 JExpr
a JExpr
i)
read_i8 :: JExpr -> JExpr -> JExpr
read_i8 :: JExpr -> JExpr -> JExpr
read_i8 JExpr
a JExpr
i = JExpr -> JExpr
signExtend8 (JExpr -> JExpr -> JExpr
idx_u8 JExpr
a JExpr
i)
read_i16 :: JExpr -> JExpr -> JExpr
read_i16 :: JExpr -> JExpr -> JExpr
read_i16 JExpr
a JExpr
i = JExpr -> JExpr
signExtend16 (JExpr -> JExpr -> JExpr
idx_u16 JExpr
a JExpr
i)
read_i32 :: JExpr -> JExpr -> JExpr
read_i32 :: JExpr -> JExpr -> JExpr
read_i32 JExpr
a JExpr
i = JExpr -> JExpr -> JExpr
idx_i32 JExpr
a JExpr
i
read_f32 :: JExpr -> JExpr -> JExpr
read_f32 :: JExpr -> JExpr -> JExpr
read_f32 JExpr
a JExpr
i = JExpr -> JExpr -> JExpr
idx_f32 JExpr
a JExpr
i
read_f64 :: JExpr -> JExpr -> JExpr
read_f64 :: JExpr -> JExpr -> JExpr
read_f64 JExpr
a JExpr
i = JExpr -> JExpr -> JExpr
idx_f64 JExpr
a JExpr
i
write_u8 :: JExpr -> JExpr -> JExpr -> JStat
write_u8 :: JExpr -> JExpr -> JExpr -> JStat
write_u8 JExpr
a JExpr
i JExpr
v = JExpr -> JExpr -> JExpr
idx_u8 JExpr
a JExpr
i JExpr -> JExpr -> JStat
|= JExpr
v
write_u16 :: JExpr -> JExpr -> JExpr -> JStat
write_u16 :: JExpr -> JExpr -> JExpr -> JStat
write_u16 JExpr
a JExpr
i JExpr
v = JExpr -> JExpr -> JExpr
idx_u16 JExpr
a JExpr
i JExpr -> JExpr -> JStat
|= JExpr
v
write_u32 :: JExpr -> JExpr -> JExpr -> JStat
write_u32 :: JExpr -> JExpr -> JExpr -> JStat
write_u32 JExpr
a JExpr
i JExpr
v = JExpr -> JExpr -> JExpr
idx_i32 JExpr
a JExpr
i JExpr -> JExpr -> JStat
|= JExpr
v
write_i8 :: JExpr -> JExpr -> JExpr -> JStat
write_i8 :: JExpr -> JExpr -> JExpr -> JStat
write_i8 JExpr
a JExpr
i JExpr
v = JExpr -> JExpr -> JExpr
idx_u8 JExpr
a JExpr
i JExpr -> JExpr -> JStat
|= JExpr
v
write_i16 :: JExpr -> JExpr -> JExpr -> JStat
write_i16 :: JExpr -> JExpr -> JExpr -> JStat
write_i16 JExpr
a JExpr
i JExpr
v = JExpr -> JExpr -> JExpr
idx_u16 JExpr
a JExpr
i JExpr -> JExpr -> JStat
|= JExpr
v
write_i32 :: JExpr -> JExpr -> JExpr -> JStat
write_i32 :: JExpr -> JExpr -> JExpr -> JStat
write_i32 JExpr
a JExpr
i JExpr
v = JExpr -> JExpr -> JExpr
idx_i32 JExpr
a JExpr
i JExpr -> JExpr -> JStat
|= JExpr
v
write_f32 :: JExpr -> JExpr -> JExpr -> JStat
write_f32 :: JExpr -> JExpr -> JExpr -> JStat
write_f32 JExpr
a JExpr
i JExpr
v = JExpr -> JExpr -> JExpr
idx_f32 JExpr
a JExpr
i JExpr -> JExpr -> JStat
|= JExpr
v
write_f64 :: JExpr -> JExpr -> JExpr -> JStat
write_f64 :: JExpr -> JExpr -> JExpr -> JStat
write_f64 JExpr
a JExpr
i JExpr
v = JExpr -> JExpr -> JExpr
idx_f64 JExpr
a JExpr
i JExpr -> JExpr -> JStat
|= JExpr
v
write_boff_i8, write_boff_u8, write_boff_i16, write_boff_u16, write_boff_i32, write_boff_u32, write_boff_f32, write_boff_f64 :: JExpr -> JExpr -> JExpr -> JStat
write_boff_i8 :: JExpr -> JExpr -> JExpr -> JStat
write_boff_i8 JExpr
a JExpr
i JExpr
v = JExpr -> JExpr -> JExpr -> JStat
write_i8 JExpr
a JExpr
i JExpr
v
write_boff_u8 :: JExpr -> JExpr -> JExpr -> JStat
write_boff_u8 JExpr
a JExpr
i JExpr
v = JExpr -> JExpr -> JExpr -> JStat
write_u8 JExpr
a JExpr
i JExpr
v
write_boff_i16 :: JExpr -> JExpr -> JExpr -> JStat
write_boff_i16 JExpr
a JExpr
i JExpr
v = JExpr -> [JExpr] -> JStat
ApplStat (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"dv" JExpr -> FastString -> JExpr
.^ FastString
"setInt16" ) [JExpr
i, JExpr
v, JExpr
true_]
write_boff_u16 :: JExpr -> JExpr -> JExpr -> JStat
write_boff_u16 JExpr
a JExpr
i JExpr
v = JExpr -> [JExpr] -> JStat
ApplStat (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"dv" JExpr -> FastString -> JExpr
.^ FastString
"setUint16" ) [JExpr
i, JExpr
v, JExpr
true_]
write_boff_i32 :: JExpr -> JExpr -> JExpr -> JStat
write_boff_i32 JExpr
a JExpr
i JExpr
v = JExpr -> [JExpr] -> JStat
ApplStat (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"dv" JExpr -> FastString -> JExpr
.^ FastString
"setInt32" ) [JExpr
i, JExpr
v, JExpr
true_]
write_boff_u32 :: JExpr -> JExpr -> JExpr -> JStat
write_boff_u32 JExpr
a JExpr
i JExpr
v = JExpr -> [JExpr] -> JStat
ApplStat (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"dv" JExpr -> FastString -> JExpr
.^ FastString
"setUint32" ) [JExpr
i, JExpr
v, JExpr
true_]
write_boff_f32 :: JExpr -> JExpr -> JExpr -> JStat
write_boff_f32 JExpr
a JExpr
i JExpr
v = JExpr -> [JExpr] -> JStat
ApplStat (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"dv" JExpr -> FastString -> JExpr
.^ FastString
"setFloat32") [JExpr
i, JExpr
v, JExpr
true_]
write_boff_f64 :: JExpr -> JExpr -> JExpr -> JStat
write_boff_f64 JExpr
a JExpr
i JExpr
v = JExpr -> [JExpr] -> JStat
ApplStat (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"dv" JExpr -> FastString -> JExpr
.^ FastString
"setFloat64") [JExpr
i, JExpr
v, JExpr
true_]
read_boff_i8, read_boff_u8, read_boff_i16, read_boff_u16, read_boff_i32, read_boff_u32, read_boff_f32, read_boff_f64 :: JExpr -> JExpr -> JExpr
read_boff_i8 :: JExpr -> JExpr -> JExpr
read_boff_i8 JExpr
a JExpr
i = JExpr -> JExpr -> JExpr
read_i8 JExpr
a JExpr
i
read_boff_u8 :: JExpr -> JExpr -> JExpr
read_boff_u8 JExpr
a JExpr
i = JExpr -> JExpr -> JExpr
read_u8 JExpr
a JExpr
i
read_boff_i16 :: JExpr -> JExpr -> JExpr
read_boff_i16 JExpr
a JExpr
i = JExpr -> [JExpr] -> JExpr
ApplExpr (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"dv" JExpr -> FastString -> JExpr
.^ FastString
"getInt16" ) [JExpr
i, JExpr
true_]
read_boff_u16 :: JExpr -> JExpr -> JExpr
read_boff_u16 JExpr
a JExpr
i = JExpr -> [JExpr] -> JExpr
ApplExpr (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"dv" JExpr -> FastString -> JExpr
.^ FastString
"getUint16" ) [JExpr
i, JExpr
true_]
read_boff_i32 :: JExpr -> JExpr -> JExpr
read_boff_i32 JExpr
a JExpr
i = JExpr -> [JExpr] -> JExpr
ApplExpr (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"dv" JExpr -> FastString -> JExpr
.^ FastString
"getInt32" ) [JExpr
i, JExpr
true_]
read_boff_u32 :: JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
a JExpr
i = JExpr -> [JExpr] -> JExpr
ApplExpr (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"dv" JExpr -> FastString -> JExpr
.^ FastString
"getUint32" ) [JExpr
i, JExpr
true_]
read_boff_f32 :: JExpr -> JExpr -> JExpr
read_boff_f32 JExpr
a JExpr
i = JExpr -> [JExpr] -> JExpr
ApplExpr (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"dv" JExpr -> FastString -> JExpr
.^ FastString
"getFloat32") [JExpr
i, JExpr
true_]
read_boff_f64 :: JExpr -> JExpr -> JExpr
read_boff_f64 JExpr
a JExpr
i = JExpr -> [JExpr] -> JExpr
ApplExpr (JExpr
a JExpr -> FastString -> JExpr
.^ FastString
"dv" JExpr -> FastString -> JExpr
.^ FastString
"getFloat64") [JExpr
i, JExpr
true_]
fetchOpByteArray :: (JExpr -> JExpr -> JExpr) -> JExpr -> JExpr -> JExpr -> JExpr -> JStat
fetchOpByteArray :: (JExpr -> JExpr -> JExpr)
-> JExpr -> JExpr -> JExpr -> JExpr -> JStat
fetchOpByteArray JExpr -> JExpr -> JExpr
op JExpr
tgt JExpr
src JExpr
i JExpr
v = [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
tgt JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_i32 JExpr
src JExpr
i
, JExpr -> JExpr -> JExpr -> JStat
write_i32 JExpr
src JExpr
i (JExpr -> JExpr -> JExpr
op JExpr
tgt JExpr
v)
]
fetchOpAddr :: (JExpr -> JExpr -> JExpr) -> JExpr -> JExpr -> JExpr -> JExpr -> JStat
fetchOpAddr :: (JExpr -> JExpr -> JExpr)
-> JExpr -> JExpr -> JExpr -> JExpr -> JStat
fetchOpAddr JExpr -> JExpr -> JExpr
op JExpr
tgt JExpr
src JExpr
i JExpr
v = [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
tgt JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read_boff_u32 JExpr
src JExpr
i
, JExpr -> JExpr -> JExpr -> JStat
write_boff_u32 JExpr
src JExpr
i (JExpr -> JExpr -> JExpr
op JExpr
tgt JExpr
v)
]
casOp
:: (JExpr -> JExpr -> JExpr)
-> (JExpr -> JExpr -> JExpr -> JStat)
-> JExpr
-> JExpr
-> JExpr
-> JExpr
-> JExpr
-> JStat
casOp :: (JExpr -> JExpr -> JExpr)
-> (JExpr -> JExpr -> JExpr -> JStat)
-> JExpr
-> JExpr
-> JExpr
-> JExpr
-> JExpr
-> JStat
casOp JExpr -> JExpr -> JExpr
read JExpr -> JExpr -> JExpr -> JStat
write JExpr
tgt JExpr
src JExpr
i JExpr
old JExpr
new = [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
tgt JExpr -> JExpr -> JStat
|= JExpr -> JExpr -> JExpr
read JExpr
src JExpr
i
, JExpr -> JStat -> JStat -> JStat
ifS (JExpr
tgt JExpr -> JExpr -> JExpr
.===. JExpr
old)
(JExpr -> JExpr -> JExpr -> JStat
write JExpr
src JExpr
i JExpr
new)
JStat
forall a. Monoid a => a
mempty
]
cloneArray :: JExpr -> JExpr -> Maybe JExpr -> JExpr -> JStat
cloneArray :: JExpr -> JExpr -> Maybe JExpr -> JExpr -> JStat
cloneArray JExpr
tgt JExpr
src Maybe JExpr
mb_offset JExpr
len = [JStat] -> JStat
forall a. Monoid a => [a] -> a
mconcat
[ JExpr
tgt JExpr -> JExpr -> JStat
|= JExpr -> [JExpr] -> JExpr
ApplExpr (JExpr
src JExpr -> FastString -> JExpr
.^ FastString
"slice") [JExpr
start, JExpr
end]
, JExpr
tgt JExpr -> FastString -> JExpr
.^ FastString
closureMeta_ JExpr -> JExpr -> JStat
|= JExpr
zero_
, JExpr
tgt JExpr -> FastString -> JExpr
.^ FastString
"__ghcjsArray" JExpr -> JExpr -> JStat
|= JExpr
true_
]
where
start :: JExpr
start = JExpr -> Maybe JExpr -> JExpr
forall a. a -> Maybe a -> a
fromMaybe JExpr
zero_ Maybe JExpr
mb_offset
end :: JExpr
end = JExpr -> (JExpr -> JExpr) -> Maybe JExpr -> JExpr
forall b a. b -> (a -> b) -> Maybe a -> b
maybe JExpr
len (JExpr -> JExpr -> JExpr
Add JExpr
len) Maybe JExpr
mb_offset
newArray :: JExpr -> JExpr -> JExpr -> JStat
newArray :: JExpr -> JExpr -> JExpr -> JStat
newArray JExpr
tgt JExpr
len JExpr
elem =
JExpr
tgt JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$newArray" [JExpr
len, JExpr
elem]
newByteArray :: JExpr -> JExpr -> JStat
newByteArray :: JExpr -> JExpr -> JStat
newByteArray JExpr
tgt JExpr
len =
JExpr
tgt JExpr -> JExpr -> JStat
|= FastString -> [JExpr] -> JExpr
app FastString
"h$newByteArray" [JExpr
len]
boundsChecked :: Bool
-> JExpr
-> JExpr
-> JStat
-> JStat
boundsChecked :: Bool -> JExpr -> JExpr -> JStat -> JStat
boundsChecked Bool
False JExpr
_ JExpr
_ JStat
r = JStat
r
boundsChecked Bool
True JExpr
xs JExpr
i JStat
r =
JExpr -> JStat -> JStat -> JStat
ifS ((JExpr
i JExpr -> JExpr -> JExpr
.<. JExpr
xs JExpr -> FastString -> JExpr
.^ FastString
"length") JExpr -> JExpr -> JExpr
.&&. (JExpr
i JExpr -> JExpr -> JExpr
.>=. JExpr
zero_))
JStat
r
(JExpr -> JStat
returnS (JExpr -> JStat) -> JExpr -> JStat
forall a b. (a -> b) -> a -> b
$ FastString -> [JExpr] -> JExpr
app FastString
"h$exitProcess" [Integer -> JExpr
Int Integer
134])
toI32 :: JExpr -> JExpr
toI32 :: JExpr -> JExpr
toI32 JExpr
e = JExpr -> JExpr -> JExpr
BOr JExpr
e JExpr
zero_
toU32 :: JExpr -> JExpr
toU32 :: JExpr -> JExpr
toU32 JExpr
e = JExpr
e JExpr -> JExpr -> JExpr
.>>>. JExpr
zero_
quotShortInt :: Int -> JExpr -> JExpr -> JExpr
quotShortInt :: Int -> JExpr -> JExpr -> JExpr
quotShortInt Int
bits JExpr
x JExpr
y = JExpr -> JExpr -> JExpr
BAnd (JExpr -> JExpr
signed JExpr
x JExpr -> JExpr -> JExpr
`Div` JExpr -> JExpr
signed JExpr
y) JExpr
mask
where
signed :: JExpr -> JExpr
signed JExpr
z = (JExpr
z JExpr -> JExpr -> JExpr
.<<. JExpr
shift) JExpr -> JExpr -> JExpr
.>>. JExpr
shift
shift :: JExpr
shift = Int -> JExpr
forall a. ToJExpr a => a -> JExpr
toJExpr (Int
32 Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
bits)
mask :: JExpr
mask = Integer -> JExpr
forall a. ToJExpr a => a -> JExpr
toJExpr (((Integer
2::Integer) Integer -> Int -> Integer
forall a b. (Num a, Integral b) => a -> b -> a
^ Int
bits) Integer -> Integer -> Integer
forall a. Num a => a -> a -> a
- Integer
1)
remShortInt :: Int -> JExpr -> JExpr -> JExpr
remShortInt :: Int -> JExpr -> JExpr -> JExpr
remShortInt Int
bits JExpr
x JExpr
y = JExpr -> JExpr -> JExpr
BAnd (JExpr -> JExpr
signed JExpr
x JExpr -> JExpr -> JExpr
`Mod` JExpr -> JExpr
signed JExpr
y) JExpr
mask
where
signed :: JExpr -> JExpr
signed JExpr
z = (JExpr
z JExpr -> JExpr -> JExpr
.<<. JExpr
shift) JExpr -> JExpr -> JExpr
.>>. JExpr
shift
shift :: JExpr
shift = Int -> JExpr
forall a. ToJExpr a => a -> JExpr
toJExpr (Int
32 Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
bits)
mask :: JExpr
mask = Integer -> JExpr
forall a. ToJExpr a => a -> JExpr
toJExpr (((Integer
2::Integer) Integer -> Int -> Integer
forall a b. (Num a, Integral b) => a -> b -> a
^ Int
bits) Integer -> Integer -> Integer
forall a. Num a => a -> a -> a
- Integer
1)