On Mon, 12 Jul 2021 17:59:32 GMT, Brian Burkhalter wrote:
>> Please consider this change to make the `float` and `double` versions of
>> `java.lang.Math.abs()` branch-free.
>
> Brian Burkhalter has refreshed the contents of this pull request, and
> previous commits have been removed. The increm
On Mon, 12 Jul 2021 17:59:32 GMT, Brian Burkhalter wrote:
>> Please consider this change to make the `float` and `double` versions of
>> `java.lang.Math.abs()` branch-free.
>
> Brian Burkhalter has refreshed the contents of this pull request, and
> previous commits have been removed. The increm
> Please consider this change to make the `float` and `double` versions of
> `java.lang.Math.abs()` branch-free.
Brian Burkhalter has refreshed the contents of this pull request, and previous
commits have been removed. The incremental views will show differences compared
to the previous content
> Please consider this change to make the `float` and `double` versions of
> `java.lang.Math.abs()` branch-free.
Brian Burkhalter has updated the pull request incrementally with one additional
commit since the last revision:
6506405: Clean up test
-
Changes:
- all: https://git
On Fri, 9 Jul 2021 22:02:14 GMT, Joe Darcy wrote:
>> Brian Burkhalter has refreshed the contents of this pull request, and
>> previous commits have been removed. The incremental views will show
>> differences compared to the previous content of the PR.
>
> src/java.base/share/classes/jdk/intern
On Fri, 9 Jul 2021 21:30:22 GMT, Brian Burkhalter wrote:
>> Please consider this change to make the `float` and `double` versions of
>> `java.lang.Math.abs()` branch-free.
>
> Brian Burkhalter has refreshed the contents of this pull request, and
> previous commits have been removed. The increme
> Please consider this change to make the `float` and `double` versions of
> `java.lang.Math.abs()` branch-free.
Brian Burkhalter has updated the pull request incrementally with one additional
commit since the last revision:
6506405: More test cleanup
-
Changes:
- all: https:/
> Please consider this change to make the `float` and `double` versions of
> `java.lang.Math.abs()` branch-free.
Brian Burkhalter has refreshed the contents of this pull request, and previous
commits have been removed. The incremental views will show differences compared
to the previous content
On Fri, 9 Jul 2021 13:54:39 GMT, Joe Darcy wrote:
>> Brian Burkhalter has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> 6506405: Add some tests
>
> test/jdk/java/lang/Math/AbsTests.java line 35:
>
>> 33: */
>> 34: public class AbsTests {
On Thu, 8 Jul 2021 18:15:23 GMT, Brian Burkhalter wrote:
>> Please consider this change to make the `float` and `double` versions of
>> `java.lang.Math.abs()` branch-free.
>
> Brian Burkhalter has updated the pull request incrementally with one
> additional commit since the last revision:
>
>
PS The benefit of an intrinsic in a case like this is being to use a
platform-optimized implementation, trading off native instruction,
floating-point branch, and bitwise conversion costs.
-Joe
On 7/8/2021 4:26 AM, Joe Darcy wrote:
On 7/8/2021 3:50 AM, Andrew Haley wrote:
On Thu, 8 Jul 2021
> Please consider this change to make the `float` and `double` versions of
> `java.lang.Math.abs()` branch-free.
Brian Burkhalter has updated the pull request incrementally with one additional
commit since the last revision:
6506405: Add some tests
-
Changes:
- all: https://gi
On Thu, 8 Jul 2021 15:53:18 GMT, Brian Burkhalter wrote:
>> Please consider this change to make the `float` and `double` versions of
>> `java.lang.Math.abs()` branch-free.
>
> Brian Burkhalter has updated the pull request incrementally with one
> additional commit since the last revision:
>
>
> Please consider this change to make the `float` and `double` versions of
> `java.lang.Math.abs()` branch-free.
Brian Burkhalter has updated the pull request incrementally with one additional
commit since the last revision:
6506405: Set MAG_BIT_MASKs to bit-wise complements of SIGN_BIT_MASKs
On Thu, 8 Jul 2021 15:34:16 GMT, Brian Burkhalter wrote:
>> Please consider this change to make the `float` and `double` versions of
>> `java.lang.Math.abs()` branch-free.
>
> Brian Burkhalter has refreshed the contents of this pull request, and
> previous commits have been removed. The increme
> Please consider this change to make the `float` and `double` versions of
> `java.lang.Math.abs()` branch-free.
Brian Burkhalter has refreshed the contents of this pull request, and previous
commits have been removed. The incremental views will show differences compared
to the previous content
On Thu, 8 Jul 2021 01:05:16 GMT, Brian Burkhalter wrote:
>> Please consider this change to make the `float` and `double` versions of
>> `java.lang.Math.abs()` branch-free.
>
> Brian Burkhalter has updated the pull request incrementally with one
> additional commit since the last revision:
>
>
On 7/8/2021 3:50 AM, Andrew Haley wrote:
On Thu, 8 Jul 2021 09:43:35 GMT, Andrew Haley wrote:
Moves between GPRs and FPRs are often slow. There's a 10-cycle latency on some
AArch64, so we avoid it whenever we can. Mind you, we don't care about this
patch because we always generate FABS from
On Thu, 8 Jul 2021 09:43:35 GMT, Andrew Haley wrote:
> Moves between GPRs and FPRs are often slow. There's a 10-cycle latency on
> some AArch64, so we avoid it whenever we can. Mind you, we don't care about
> this patch because we always generate FABS from an intrinsic anyway.
For avoidance of
On Thu, 8 Jul 2021 01:05:16 GMT, Brian Burkhalter wrote:
>> Please consider this change to make the `float` and `double` versions of
>> `java.lang.Math.abs()` branch-free.
>
> Brian Burkhalter has updated the pull request incrementally with one
> additional commit since the last revision:
>
>
On Thu, 8 Jul 2021 00:45:48 GMT, Joe Darcy wrote:
> However, the bitwise conversion should now be fast everywhere.
Doesn't it require moves between general-purpose and floating-point registers?
Those have to go through memory for some targets (including old x86, where the
ISA supports it, but
On Thu, 8 Jul 2021 01:05:16 GMT, Brian Burkhalter wrote:
>> Please consider this change to make the `float` and `double` versions of
>> `java.lang.Math.abs()` branch-free.
>
> Brian Burkhalter has updated the pull request incrementally with one
> additional commit since the last revision:
>
>
On a quick review of version 2, I noticed that the double constant is declared
as integer with same value like the float one.
I think that's wrong, but I wonder why the asserts still pass.
Uwe
Am July 8, 2021 1:05:16 AM UTC schrieb Brian Burkhalter :
>> Please consider this change to make the `
On Jul 7, 2021, at 5:50 PM, Joe Darcy
mailto:joe.da...@oracle.com>> wrote:
There is no specific constant in `{Float,Double}Consts` to mask all but the
sign bit, but I had thought it might be good to add one there
The sign bit mask can be bit-wise complemented though :-)
I had it that way in
On Thu, 8 Jul 2021 01:05:16 GMT, Brian Burkhalter wrote:
>> Please consider this change to make the `float` and `double` versions of
>> `java.lang.Math.abs()` branch-free.
>
> Brian Burkhalter has updated the pull request incrementally with one
> additional commit since the last revision:
>
>
> Please consider this change to make the `float` and `double` versions of
> `java.lang.Math.abs()` branch-free.
Brian Burkhalter has updated the pull request incrementally with one additional
commit since the last revision:
6506405: Add comments, use new consts for masking
-
Ch
On 7/7/2021 5:43 PM, Brian Burkhalter wrote:
On Thu, 8 Jul 2021 00:38:45 GMT, Joe Darcy wrote:
Please consider this change to make the `float` and `double` versions of
`java.lang.Math.abs()` branch-free.
src/java.base/share/classes/java/lang/Math.java line 1530:
1528: @IntrinsicCandida
On Wed, 7 Jul 2021 20:29:37 GMT, Brian Burkhalter wrote:
>
>
> With this change there is no measurable effect on performance on macOS, but
> on Linux there is approximately a 10% throughput improvement.
The improvement is with the default options, without turning intrinsics off?
I'm somewhat
On Wed, 7 Jul 2021 20:28:37 GMT, Brian Burkhalter wrote:
> Please consider this change to make the `float` and `double` versions of
> `java.lang.Math.abs()` branch-free.
src/java.base/share/classes/java/lang/Math.java line 1530:
> 1528: @IntrinsicCandidate
> 1529: public static float a
On Thu, 8 Jul 2021 00:38:45 GMT, Joe Darcy wrote:
>> Please consider this change to make the `float` and `double` versions of
>> `java.lang.Math.abs()` branch-free.
>
> src/java.base/share/classes/java/lang/Math.java line 1530:
>
>> 1528: @IntrinsicCandidate
>> 1529: public static float
On Wed, 7 Jul 2021 20:28:37 GMT, Brian Burkhalter wrote:
> Please consider this change to make the `float` and `double` versions of
> `java.lang.Math.abs()` branch-free.
On Jul 7, 2021, at 3:44 PM, Rémi Forax ***@***.**@***.***>> wrote:
Your patch change the semantics, actually
Math.abs(I
On Wed, 7 Jul 2021 22:22:45 GMT, Joe Darcy wrote:
>
> > Your patch change the semantics, actually
> > `Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE`
> > with your patch
> > `Math.abs(Integer.MIN_VALUE) == Integer.MAX_VALUE`
>
> Does it? The overriding of int arguments shouldn't be affected.
On Wed, 7 Jul 2021 20:28:37 GMT, Brian Burkhalter wrote:
> Please consider this change to make the `float` and `double` versions of
> `java.lang.Math.abs()` branch-free.
>
> Good catch. Well that’s not good. If it needs to catch a special case it’s
> probably not worth doing. given the small
On Wed, 7 Jul 2021 20:28:37 GMT, Brian Burkhalter wrote:
> Please consider this change to make the `float` and `double` versions of
> `java.lang.Math.abs()` branch-free.
Good catch. Well that’s not good. If it needs to catch a special case it’s
probably not worth doing. given the small improve
On Wed, 7 Jul 2021 20:28:37 GMT, Brian Burkhalter wrote:
> Please consider this change to make the `float` and `double` versions of
> `java.lang.Math.abs()` branch-free.
Your patch change the semantics, actually
`Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE`
with your patch
`Math.abs(In
Please consider this change to make the `float` and `double` versions of
`java.lang.Math.abs()` branch-free.
-
Commit messages:
- 6506405: Math.abs(float) is slow
Changes: https://git.openjdk.java.net/jdk/pull/4711/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4711&r
On Wed, 7 Jul 2021 20:28:37 GMT, Brian Burkhalter wrote:
> Please consider this change to make the `float` and `double` versions of
> `java.lang.Math.abs()` branch-free.
With this change there is no measurable effect on performance on macOS, but on
Linux there is approximately a 10% throughput
37 matches
Mail list logo