RFR: 8281146: Replace StringCoding.hasNegatives with countPositives [v6]

Lutz Schmidt lucy at openjdk.java.net
Tue Mar 1 22:05:04 UTC 2022


On Tue, 1 Mar 2022 19:12:17 GMT, Claes Redestad <redestad at openjdk.org> wrote:

>> @theRealAph , @a74nh  or someone familiar with aarch64 code, please review aarch64 changes.
>
>> @theRealAph , @a74nh or someone familiar with aarch64 code, please review aarch64 changes.
> 
> Note that the aarch64 changes I've put in for now implements `countPositives` to return `0` if there's a negative value anywhere, otherwise `len`. This way we can remove the intrinsic scaffolding for `hasNegatives` once I integrate s390 and ppc changes, but since no precise calculation is implemented for aarch64 then there's no speed-up on micros such as `encodeLatin1LongEnd` for now. I would like to defer such optimization work to a follow-up.
> 
> @RealLucy yes, I'd like to integrate your changes into this patch and drop the `HasNegativesNode` et.c. You mentioned in e-mail some issue with the code generation on s390 - has that been resolved or identified?

@cl4es This issue in code generation (checking the intrinsic return value for < 0 where it only can be >= 0) is not specific to s390. It is as well visible on x86_64 and on ppc. It happens with the SPECjvm2008 sub-benchmark compiler.sunflow. What's specific to s390 is the fact that this obviously erroneous check causes the benchmark to fail. x86_64 and ppc seem to be immune. Where the immunity comes from is not yet understood.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7231


More information about the core-libs-dev mailing list