bits-extra-0.0.2.0: Useful bitwise operations

Copyright(c) John Ky 2018-2019
LicenseBSD-3-Clause
Maintainernewhoggy@gmail.com
Stabilitystable
Safe HaskellSafe
LanguageHaskell2010

Data.Bits.Pdep

Description

 
Synopsis

Documentation

class Pdep a where Source #

Bitwise parallel deposit. Deposits bits from the source at the locations described by the mask.

Copies lower order bits from src to mask 1-bit locations in the return value; mask 0-bit locations in the return value will be cleared.

>>> pdep 1 1 :: Word64
1

Methods

pdep Source #

Arguments

:: a

the bitmap from which bits will be extracted

-> a

the bitmap selecting the bit locations that are to be deposited to

-> a

the bitmap containing the deposited bits with other bits bits cleared

Instances
Pdep Word Source # 
Instance details

Defined in Data.Bits.Pdep

Methods

pdep :: Word -> Word -> Word Source #

Pdep Word8 Source # 
Instance details

Defined in Data.Bits.Pdep

Methods

pdep :: Word8 -> Word8 -> Word8 Source #

Pdep Word16 Source # 
Instance details

Defined in Data.Bits.Pdep

Methods

pdep :: Word16 -> Word16 -> Word16 Source #

Pdep Word32 Source # 
Instance details

Defined in Data.Bits.Pdep

Methods

pdep :: Word32 -> Word32 -> Word32 Source #

Pdep Word64 Source # 
Instance details

Defined in Data.Bits.Pdep

Methods

pdep :: Word64 -> Word64 -> Word64 Source #

fastPdepEnabled :: Bool Source #

Runtime flag indicating whether the pdep function is using the high-performance. BMI2 instruction set. A value of False indicates that pdep is emulated.

Actual performance when using the BMI2 instruction set will vary according to CPU model. For example Intel CPUs currently outperform AMD CPUs in this area.