hw-prim-0.6.3.2: Primitive functions and data types
Safe HaskellSafe-Inferred
LanguageHaskell2010

HaskellWorks.Data.Branchless

Synopsis

Documentation

ltWord8 :: Word8 -> Word8 -> Word8 Source #

Branchless less-than comparison

Return 1 if the first argument is less-than the second argument, otherwise return 0.

>>> ltWord8 5 5
0
>>> ltWord8 4 5
1
>>> ltWord8 6 5
0

ltWord16 :: Word16 -> Word16 -> Word16 Source #

Branchless less-than comparison

Return 1 if the first argument is less-than the second argument, otherwise return 0.

>>> ltWord16 5 5
0
>>> ltWord16 4 5
1
>>> ltWord16 6 5
0

ltWord32 :: Word32 -> Word32 -> Word32 Source #

Branchless less-than comparison

Return 1 if the first argument is less-than the second argument, otherwise return 0.

>>> ltWord32 5 5
0
>>> ltWord32 4 5
1
>>> ltWord32 6 5
0

ltWord64 :: Word64 -> Word64 -> Word64 Source #

Branchless less-than comparison

Return 1 if the first argument is less-than the second argument, otherwise return 0.

>>> ltWord64 5 5
0
>>> ltWord64 4 5
1
>>> ltWord64 6 5
0

leWord8 :: Word8 -> Word8 -> Word8 Source #

Branchless less-than-or-equal-to comparison

Return 1 if the first argument is less-than-or-equal-to the second argument, otherwise return 0.

>>> leWord8 5 5
1
>>> leWord8 4 5
1
>>> leWord8 6 5
0

leWord16 :: Word16 -> Word16 -> Word16 Source #

Branchless less-than-or-equal-to comparison

Return 1 if the first argument is less-than-or-equal-to the second argument, otherwise return 0.

>>> leWord16 5 5
1
>>> leWord16 4 5
1
>>> leWord16 6 5
0

leWord32 :: Word32 -> Word32 -> Word32 Source #

Branchless less-than-or-equal-to comparison

Return 1 if the first argument is less-than-or-equal-to the second argument, otherwise return 0.

>>> leWord32 5 5
1
>>> leWord32 4 5
1
>>> leWord32 6 5
0

leWord64 :: Word64 -> Word64 -> Word64 Source #

Branchless less-than-or-equal-to comparison

Return 1 if the first argument is less-than-or-equal-to the second argument, otherwise return 0.

>>> leWord64 5 5
1
>>> leWord64 4 5
1
>>> leWord64 6 5
0

gtWord8 :: Word8 -> Word8 -> Word8 Source #

Branchless greater-than comparison

Return 1 if the first argument is greater-than the second argument, otherwise return 0.

>>> gtWord8 5 5
0
>>> gtWord8 4 5
0
>>> gtWord8 6 5
1

gtWord16 :: Word16 -> Word16 -> Word16 Source #

Branchless greater-than comparison

Return 1 if the first argument is greater-than the second argument, otherwise return 0.

>>> gtWord16 5 5
0
>>> gtWord16 4 5
0
>>> gtWord16 6 5
1

gtWord32 :: Word32 -> Word32 -> Word32 Source #

Branchless greater-than comparison

Return 1 if the first argument is greater-than the second argument, otherwise return 0.

>>> gtWord32 5 5
0
>>> gtWord32 4 5
0
>>> gtWord32 6 5
1

gtWord64 :: Word64 -> Word64 -> Word64 Source #

Branchless greater-than comparison

Return 1 if the first argument is greater-than the second argument, otherwise return 0.

>>> gtWord64 5 5
0
>>> gtWord64 4 5
0
>>> gtWord64 6 5
1

geWord8 :: Word8 -> Word8 -> Word8 Source #

Branchless greater-than-or-equal-to comparison

Return 1 if the first argument is greater-than-or-equal-to the second argument, otherwise return 0.

>>> geWord8 5 5
1
>>> geWord8 4 5
0
>>> geWord8 6 5
1

geWord16 :: Word16 -> Word16 -> Word16 Source #

Branchless greater-than-or-equal-to comparison

Return 1 if the first argument is greater-than-or-equal-to the second argument, otherwise return 0.

>>> geWord16 5 5
1
>>> geWord16 4 5
0
>>> geWord16 6 5
1

geWord32 :: Word32 -> Word32 -> Word32 Source #

Branchless greater-than-or-equal-to comparison

Return 1 if the first argument is greater-than-or-equal-to the second argument, otherwise return 0.

>>> geWord32 5 5
1
>>> geWord32 4 5
0
>>> geWord32 6 5
1

geWord64 :: Word64 -> Word64 -> Word64 Source #

Branchless greater-than-or-equal-to comparison

Return 1 if the first argument is greater-than-or-equal-to the second argument, otherwise return 0.

>>> geWord64 5 5
1
>>> geWord64 4 5
0
>>> geWord64 6 5
1