Re: RFR: 8283892: Compress and expand bits [v7]

2022-04-11 Thread Paul Sandoz
> Add support to compress bits and expand bits of `int` and `long` values, see > Hacker's Delight (2nd edition), section 7.4. > > Compressing or expanding bits of an `int` or `long` value can be composed to > enable general permutations, and the "sheep and goats" operation (SAG) see > Hacker's

Re: RFR: 8283892: Compress and expand bits [v6]

2022-04-10 Thread Alan Bateman
On Fri, 8 Apr 2022 19:13:35 GMT, Paul Sandoz wrote: >> Add support to compress bits and expand bits of `int` and `long` values, see >> Hacker's Delight (2nd edition), section 7.4. >> >> Compressing or expanding bits of an `int` or `long` value can be composed to >> enable general

Re: RFR: 8283892: Compress and expand bits [v6]

2022-04-09 Thread Claes Redestad
On Fri, 8 Apr 2022 19:13:35 GMT, Paul Sandoz wrote: >> Add support to compress bits and expand bits of `int` and `long` values, see >> Hacker's Delight (2nd edition), section 7.4. >> >> Compressing or expanding bits of an `int` or `long` value can be composed to >> enable general

Re: RFR: 8283892: Compress and expand bits [v6]

2022-04-08 Thread Paul Sandoz
> Add support to compress bits and expand bits of `int` and `long` values, see > Hacker's Delight (2nd edition), section 7.4. > > Compressing or expanding bits of an `int` or `long` value can be composed to > enable general permutations, and the "sheep and goats" operation (SAG) see > Hacker's

Re: RFR: 8283892: Compress and expand bits [v5]

2022-04-08 Thread Paul Sandoz
> Add support to compress bits and expand bits of `int` and `long` values, see > Hacker's Delight (2nd edition), section 7.4. > > Compressing or expanding bits of an `int` or `long` value can be composed to > enable general permutations, and the "sheep and goats" operation (SAG) see > Hacker's

Re: RFR: 8283892: Compress and expand bits [v4]

2022-04-08 Thread Alan Bateman
On Thu, 7 Apr 2022 18:29:22 GMT, Paul Sandoz wrote: >> Add support to compress bits and expand bits of `int` and `long` values, see >> Hacker's Delight (2nd edition), section 7.4. >> >> Compressing or expanding bits of an `int` or `long` value can be composed to >> enable general

Re: RFR: 8283892: Compress and expand bits [v4]

2022-04-07 Thread Paul Sandoz
On Thu, 7 Apr 2022 20:02:51 GMT, Alan Bateman wrote: >> Examples added in latest commit. > > I see you've added a comment on each example too, I think this really helpers > readers to see how they can be used. > > The class description of both Integer and Long have an implementation note >

Re: RFR: 8283892: Compress and expand bits [v4]

2022-04-07 Thread Alan Bateman
On Thu, 7 Apr 2022 18:23:50 GMT, Paul Sandoz wrote: >> src/java.base/share/classes/java/lang/Integer.java line 1781: >> >>> 1779: * All the upper remaining bits of the compressed value are set >>> 1780: * to zero. >>> 1781: * >> >> Following Alan's comment, I suggest the

Re: RFR: 8283892: Compress and expand bits [v4]

2022-04-07 Thread Paul Sandoz
On Wed, 6 Apr 2022 18:22:45 GMT, John R Rose wrote: >> Paul Sandoz has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Fix typo. >> - Provide examples. > > src/java.base/share/classes/java/lang/Integer.java line 1781: > >> 1779: *

Re: RFR: 8283892: Compress and expand bits [v4]

2022-04-07 Thread Paul Sandoz
> Add support to compress bits and expand bits of `int` and `long` values, see > Hacker's Delight (2nd edition), section 7.4. > > Compressing or expanding bits of an `int` or `long` value can be composed to > enable general permutations, and the "sheep and goats" operation (SAG) see > Hacker's

Re: RFR: 8283892: Compress and expand bits [v3]

2022-04-07 Thread Paul Sandoz
> Add support to compress bits and expand bits of `int` and `long` values, see > Hacker's Delight (2nd edition), section 7.4. > > Compressing or expanding bits of an `int` or `long` value can be composed to > enable general permutations, and the "sheep and goats" operation (SAG) see > Hacker's

Re: RFR: 8283892: Compress and expand bits [v2]

2022-04-07 Thread Paul Sandoz
On Thu, 7 Apr 2022 14:01:53 GMT, Claes Redestad wrote: >> Paul Sandoz has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Doc and test updates. > > I experimented with this and drafted a few microbenchmarks along and a > micro-optimization

Re: RFR: 8283892: Compress and expand bits [v2]

2022-04-07 Thread Paul Sandoz
On Wed, 6 Apr 2022 17:39:48 GMT, John R Rose wrote: >> Paul Sandoz has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Doc and test updates. > > test/jdk/java/lang/AbstractCompressExpandTest.java line 145: > >> 143: >> 144: int i

Re: RFR: 8283892: Compress and expand bits [v2]

2022-04-07 Thread Claes Redestad
On Wed, 6 Apr 2022 21:57:44 GMT, Paul Sandoz wrote: >> Add support to compress bits and expand bits of `int` and `long` values, see >> Hacker's Delight (2nd edition), section 7.4. >> >> Compressing or expanding bits of an `int` or `long` value can be composed to >> enable general

Re: RFR: 8283892: Compress and expand bits [v2]

2022-04-06 Thread Paul Sandoz
On Wed, 6 Apr 2022 17:43:34 GMT, John R Rose wrote: >> Paul Sandoz has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Doc and test updates. > > test/jdk/java/lang/AbstractCompressExpandTest.java line 104: > >> 102: abstract long

Re: RFR: 8283892: Compress and expand bits [v2]

2022-04-06 Thread Paul Sandoz
> Add support to compress bits and expand bits of `int` and `long` values, see > Hacker's Delight (2nd edition), section 7.4. > > Compressing or expanding bits of an `int` or `long` value can be composed to > enable general permutations, and the "sheep and goats" operation (SAG) see > Hacker's

Re: RFR: 8283892: Compress and expand bits

2022-04-06 Thread John R Rose
On Tue, 5 Apr 2022 22:05:19 GMT, Paul Sandoz wrote: > Add support to compress bits and expand bits of `int` and `long` values, see > Hacker's Delight (2nd edition), section 7.4. > > Compressing or expanding bits of an `int` or `long` value can be composed to > enable general permutations, and

Re: RFR: 8283892: Compress and expand bits

2022-04-06 Thread Paul Sandoz
On Wed, 6 Apr 2022 14:58:37 GMT, Alan Bateman wrote: >> Add support to compress bits and expand bits of `int` and `long` values, see >> Hacker's Delight (2nd edition), section 7.4. >> >> Compressing or expanding bits of an `int` or `long` value can be composed to >> enable general

Re: RFR: 8283892: Compress and expand bits

2022-04-06 Thread Alan Bateman
On Tue, 5 Apr 2022 22:05:19 GMT, Paul Sandoz wrote: > Add support to compress bits and expand bits of `int` and `long` values, see > Hacker's Delight (2nd edition), section 7.4. > > Compressing or expanding bits of an `int` or `long` value can be composed to > enable general permutations, and

RFR: 8283892: Compress and expand bits

2022-04-05 Thread Paul Sandoz
Add support to compress bits and expand bits of `int` and `long` values, see Hacker's Delight (2nd edition), section 7.4. Compressing or expanding bits of an `int` or `long` value can be composed to enable general permutations, and the "sheep and goats" operation (SAG) see Hacker's Delight