JDK-8259601 : AArch64: Fix reinterpretX2D match rule issue
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 16,17
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: aarch64
  • Submitted: 2021-01-12
  • Updated: 2021-01-20
  • Resolved: 2021-01-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16 JDK 17
16 b32Fixed 17Fixed
Related Reports
Relates :  
Relates :  
Description
This is a similar issue with https://bugs.openjdk.java.net/browse/JDK-8259353. 
Currently on AArch64 NEON, the match rule of ���reinterpretX2D" which implements the vector reinterpret from 16 bytes to 8 bytes, doesn't generate any register move instruction if the 'dst' and 'src' are the same register. This is not right since the higher 64-bits of the dst register can not be cleared to zero, which is not expected. 

See the codes:
  instruct reinterpretX2D(vecD dst, vecX src)
  %{
    predicate(n->bottom_type()->is_vect()->length_in_bytes() == 8 &&
                    n->in(1)->bottom_type()->is_vect()->length_in_bytes() == 16);
    match(Set dst (VectorReinterpret src));
    ins_cost(INSN_COST);
    format %{ " # reinterpret $dst,$src" %}
    ins_encode %{
      // If register is the same, then move is not needed.
      if (as_FloatRegister($dst$$reg) != as_FloatRegister($src$$reg)) {
        __ orr(as_FloatRegister($dst$$reg), __ T8B,
                  as_FloatRegister($src$$reg),
                  as_FloatRegister($src$$reg));
       }
    %}
    ins_pipe(vlogical64);
  %}

This might lead the same issue with https://bugs.openjdk.java.net/browse/JDK-8259353.
Comments
verified w/ the attached test. JDK-8259757 was filed to add the test.
14-01-2021

Changeset: 793017d2 Author: Xiaohong Gong <xgong@openjdk.org> Committer: Ningsheng Jian <njian@openjdk.org> Date: 2021-01-13 05:52:45 +0000 URL: https://git.openjdk.java.net/jdk16/commit/793017d2
13-01-2021

ILW = Same as JDK-8259353 = P2
12-01-2021