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

Improve powerOfTwo utilities using C++20 operations

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • tbd
    • 16
    • hotspot

      C++20 <bit> provides some functions that are similar to some of HotSpot's powerOfTwo utilities. However, they only support unsigned types, so we would probably want to keep the names of the existing HotSpot functions as wrappers that also handle signed types.

      is_power_of_2 -> std::has_single_bit
      round_up_power_of_2 -> std::bit_ceil
      round_down_power_of_2 -> std::bit_floor

            Unassigned Unassigned
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: