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

Improve bit manipulation and boolean to integer conversion operations on x86_64

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 19
    • 19
    • hotspot
    • None
    • b26
    • x86

      - Base variable scalar shifts have bad performance implications and should be replaced by their bmi2 counterparts:
        + Bounded operands
        + Multiple uops both in fused and unfused domains
        + May result in flag stall since the operations have unpredictable flag output
      - Flag to general-purpose registers operation currently uses cmov, this could be replaced by set, which transforms the sequence:
        + xorl dst, dst
           sometest
           movl tmp, 0x01
           cmovlcc dst, tmp
      into:
        + xorl dst, dst
           sometest
           setbcc dst
      This sequence reduces 1uop of the mov and 1 demanded register without any drawback.
      (Note: movzx does not work here since move elision requires different registers for input and output)

      Some small improvements:
      - Add memory variances to `tzcnt` and `lzcnt`
      - Add memory variances to `rolx` and `rorx`
      - Add rolx rules (note that `rolx dst, imm` is equivalent to `rorx dst, size - imm`)

            qamai Quan Anh Mai
            qamai Quan Anh Mai
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: