JDK-6443505 : Ideal() function for CmpLTMask
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-06-26
  • Updated: 2013-06-26
  • Resolved: 2013-04-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 7 JDK 8 Other
7u40Fixed 8Fixed hs24Fixed
Related Reports
Relates :  
While investigating 6317170, it was noted that the CmpLTMask node could profit from a Ideal() function which transforms (CmpLTMask (SubI x y) 0) into (CmpLTMask x y). 

Small improvements in 201_compress are expected.

The recommended transformation is not correct (try x=Integer.MIN_VALUE, y=1) but there is nonetheless a transformation that applies. Recommended method is "do in .ad files as match() rule. Look on cadd_cmpLTMask, for example." Current compilation of x<y and x-y<0: return x < y; 00c xorl R10, R10 # int 00f movl RAX, #1 # int 014 cmpl RSI, RDX 016 cmovlge RAX, R10 # signed, int return (x - y) < 0; 00c subl RSI, RDX # int 00e movl RAX, #1 # int 013 xorl R11, R11 # int 016 testl RSI, RSI 018 cmovlge RAX, R11 # signed, int Proposed improvement: return (x - y) < 0; 00e movl RAX, #1 # int 013 xorl R11, R11 # int 00c cmpl RSI, RDX # int 018 cmovlns RAX, R11 # signed, int