JDK-6805950 : Typos in andL_rReg_imm instructions in x86_64.ad
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs15
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2009-02-16
  • Updated: 2010-07-29
  • Resolved: 2009-02-27
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 6 JDK 7 Other
6u18Fixed 7Fixed hs15Fixed
There are two typos in andL_rReg_imm instructions in x86_64.ad.

The first one generates confusing output with PrintOptoAssembly:

009   	movzbq  RAX, #255	# long & 0xFF

and the second generates a non-matching instruction (see rRegI):

instruct andL_rReg_imm65535(rRegI dst, immL_65535 src)

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/2cacccded90f

EVALUATION The fix is trivial as suggested.

SUGGESTED FIX The fix is trivial and produces the expected output: --- test.bbef4344adb2/src/cpu/x86/vm/x86_64.ad 2009-02-16 13:58:14.166262213 +0100 +++ /export/home/twisti/hotspot-comp/test/src/cpu/x86/vm/x86_64.ad 2009-02-16 13:37:43.595432518 +0100 @@ -9490,14 +9490,14 @@ instruct andL_rReg_imm255(rRegL dst, imm %{ match(Set dst (AndL dst src)); - format %{ "movzbq $dst, $src\t# long & 0xFF" %} + format %{ "movzbq $dst, $dst\t# long & 0xFF" %} opcode(0x0F, 0xB6); ins_encode(REX_reg_reg_wide(dst, dst), OpcP, OpcS, reg_reg(dst, dst)); ins_pipe(ialu_reg); %} // And Register with Immediate 65535 -instruct andL_rReg_imm65535(rRegI dst, immL_65535 src) +instruct andL_rReg_imm65535(rRegL dst, immL_65535 src) %{ match(Set dst (AndL dst src));