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

X86 I2L conversion can be skipped for certain masked positive values

    XMLWordPrintable

Details

    • b14
    • x86

    Description

      X86 I2L conversion can be skipped for certain masked positive values

      For the following expression:
       (long)(value & mask)
      Where value is of int type and mask is constant (power of two – 1), we can directly generate bzhi instruction to zero the upper bits
      Instead of doing an andl, followed by movslq

      Before:
      Benchmark Mode Cnt Score Error Units
      SkipIntToLongCast.skipMaskedSmallPositiveCast avgt 15 10.679 ± 1.496 ns/op


      After:
      Benchmark Mode Cnt Score Error Units
      SkipIntToLongCast.skipMaskedSmallPositiveCast avgt 15 7.870 ± 0.067 ns/op

      Attachments

        Issue Links

          Activity

            People

              sviswanathan Sandhya Viswanathan
              sviswanathan Sandhya Viswanathan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: