Improve powerOfTwo utilities using C++20 operations

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Won't Fix
    • Priority: P4
    • tbd
    • Affects Version/s: 16
    • Component/s: 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

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

              Created:
              Updated:
              Resolved: