RFR: 8256436: AArch64: Fix undefined behavior for signed right shift in assembler
Xiaohong Gong
xgong at openjdk.java.net
Thu Nov 19 05:27:08 UTC 2020
Right shift a signed negative value is implementation-defined in C++ (see [1]). It's better to avoid the signed right shift operations,
and use the unsigned right shift instead.
[1] https://docs.microsoft.com/en-us/cpp/cpp/left-shift-and-right-shift-operators-input-and-output?view=msvc-160&viewFallbackFrom=vs-2019
Tested jtreg langtools:tier1, hotspot:hotspot_all_no_apps and jdk:jdk_core, and all tests pass without new failures.
-------------
Commit messages:
- 8256436: AArch64: Fix undefined behavior for signed right shift in assembler
Changes: https://git.openjdk.java.net/jdk/pull/1307/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1307&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8256436
Stats: 78 lines in 3 files changed: 8 ins; 0 del; 70 mod
Patch: https://git.openjdk.java.net/jdk/pull/1307.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/1307/head:pull/1307
PR: https://git.openjdk.java.net/jdk/pull/1307
More information about the hotspot-compiler-dev
mailing list