diff options
-rw-r--r-- | libraries/ghc-prim/cbits/pdep.c | 6 | ||||
-rw-r--r-- | libraries/ghc-prim/cbits/pext.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/libraries/ghc-prim/cbits/pdep.c b/libraries/ghc-prim/cbits/pdep.c index 2769008f67..52325ff21d 100644 --- a/libraries/ghc-prim/cbits/pdep.c +++ b/libraries/ghc-prim/cbits/pdep.c @@ -1,6 +1,12 @@ #include "Rts.h" #include "MachDeps.h" +/* + * The algorithm for PDEP or generalized insert or expand is from + * Henry S. Warren, Hacker's Delight, 2nd ed, p 157, Figure 7-12 + * "Parallel suffix method for the /expand/ operation". + */ + StgWord64 hs_pdep64(StgWord64 src, StgWord64 mask) { diff --git a/libraries/ghc-prim/cbits/pext.c b/libraries/ghc-prim/cbits/pext.c index 2cac9a4f79..27894fdd3c 100644 --- a/libraries/ghc-prim/cbits/pext.c +++ b/libraries/ghc-prim/cbits/pext.c @@ -1,6 +1,12 @@ #include "Rts.h" #include "MachDeps.h" +/* + * The algorithm for PEXT or generalized extract or compress is from + * Henry S. Warren, Hacker's Delight, 2nd ed, p 153, Figure 7-10 + * "Parallel suffix method for the /compress/ operation". + */ + StgWord64 hs_pext64(StgWord64 src, StgWord64 mask) { |