Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8074869

C2 code generator can replace -0.0f with +0.0f on Linux

    XMLWordPrintable

Details

    • b57
    • generic
    • linux

    Backports

      Description

        On Linux, the C2 code generator can replace the value -0.0f with +0.0f (and also the value -0.0d with +0.0d). The reason is that in some *.ad files both the value -0.0f and +0.0f is treated as being 0.0 and can therefore be replaced with an immediate +0.0f embedded into an instruction.

        For example, in the sparc.ad file, the 'fpclass' function is used to decide if a float node's content is +0.0:

        predicate((n->getf() == 0) && (fpclass(n->getf()) == FP_PZERO));

        On Solaris, 'fpclass' returns FP_PZERO if the parameter is +0.0f and FP_NZERO if the parameter is -0.0f. On Linux, however, 'fpclass' is not available and therefore 'fpclassify' is used.

        'fpclassify' does not distinguish between ±0.0f, it returns FP_ZERO for both +0.0f and -0.0f.

        Attachments

          Issue Links

            Activity

              People

                zmajo Zoltan Majo (Inactive)
                zmajo Zoltan Majo (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: