[GHC] #9532: Expose new CLZ/CTZ primops via `Data.Bits` interface
#9532: Expose new CLZ/CTZ primops via `Data.Bits` interface -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: task | Status: new Priority: normal | Milestone: 7.10.1 Component: libraries/base | Version: Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Unknown | Type of failure: Blocked By: | None/Unknown Related Tickets: #9340 | Test Case: | Blocking: | Differential Revisions: Phab:D158 -------------------------------------+------------------------------------- GHC now provides optimized CLZ/CTZ primops (see #9340), this ticket is about exposing those in a more convenient way. This was proposed as http://www.haskell.org/pipermail/libraries/2014-August/023567.html and passed. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9532> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9532: Expose new CLZ/CTZ primops via `Data.Bits` interface -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: task | Status: new Priority: normal | Milestone: 7.10.1 Component: | Version: libraries/base | Keywords: Data.Bits Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: #9340 None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D158 | -------------------------------------+------------------------------------- Changes (by hvr): * keywords: => Data.Bits * owner: => hvr -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9532#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9532: Expose new CLZ/CTZ primops via `Data.Bits` interface -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: task | Status: new Priority: normal | Milestone: 7.10.1 Component: | Version: libraries/base | Keywords: Data.Bits Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: #9340 None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D158 | -------------------------------------+------------------------------------- Comment (by Herbert Valerio Riedel <hvr@…>): In [changeset:"a8a969ae7a05e408b29961d0a2ea621a16d73d3e/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="a8a969ae7a05e408b29961d0a2ea621a16d73d3e" Add `FiniteBits(count{Leading,Trailing}Zeros)` This exposes the newly added CLZ/CTZ primops from e0c1767d0ea8d12e0a4badf43682a08784e379c6 (re #9340) via two new methods `countLeadingZeros` and `countTrailingZeros` in the `Data.Bits.FiniteBits` class. The original proposal can be found at http://www.haskell.org/pipermail/libraries/2014-August/023567.html Test Plan: successful validate Reviewers: ekmett, tibbe GHC Trac Issues: #9532 Differential Revision: https://phabricator.haskell.org/D158 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9532#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9532: Expose new CLZ/CTZ primops via `Data.Bits` interface -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: task | Status: closed Priority: normal | Milestone: 7.10.1 Component: | Version: libraries/base | Keywords: Data.Bits Resolution: fixed | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: #9340 None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D158 | -------------------------------------+------------------------------------- Changes (by hvr): * status: new => closed * resolution: => fixed Old description:
GHC now provides optimized CLZ/CTZ primops (see #9340), this ticket is about exposing those in a more convenient way.
This was proposed as
http://www.haskell.org/pipermail/libraries/2014-August/023567.html
and passed.
New description: GHC now provides optimized CLZ/CTZ primops (see #9340), this ticket is about exposing those in a more convenient way. This was proposed as http://www.haskell.org/pipermail/libraries/2014-August/023567.html and passed (see also [http://www.haskell.org/pipermail/libraries/2014-August/023657.html proposal summary]) -- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9532#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9532: Expose new CLZ/CTZ primops via `Data.Bits` interface -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: task | Status: closed Priority: normal | Milestone: 7.10.1 Component: | Version: libraries/base | Keywords: Data.Bits Resolution: fixed | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: #9340 None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D158 | -------------------------------------+------------------------------------- Comment (by Herbert Valerio Riedel <hvr@…>): In [changeset:"3241ac56d371220ed0b9522a86678678532f48bc/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="3241ac56d371220ed0b9522a86678678532f48bc" Remove incorrect property in docstring (re #9532) The property countLeadingZeros . negate = const 0 doesn't generally hold and it's not such a useful property to state, as it simply follows from "sign-bit == most-significant-bit" for FiniteBits types which use twos-complement representation for negative values, and even then it breaks down for 0... TLDR, remove thinko from documentation of `countLeadingZeros` }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9532#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC