CPUInfo: Use enums to represent CPU features

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 17
    • Component/s: hotspot

      Replace strings with enums to represent CPU features in sun.hotspot.cpuinfo.CPUInfo.

      public static List<String> getFeatures()
      public static boolean hasFeature(String feature)

      It enables static and dynamic checks to ensure that JVM and tests agree on CPU features.

      test//hotspot/jtreg/compiler/intrinsics/bmi/TestBlsiL.java: if (!CPUInfo.hasFeature("bmi1")) {
      test//hotspot/jtreg/compiler/intrinsics/bmi/TestBzhiI2L.java: if (!CPUInfo.hasFeature("bmi2")) {
      test//hotspot/jtreg/compiler/intrinsics/bmi/TestLzcntI.java: if (!CPUInfo.hasFeature("lzcnt")) {
       

            Assignee:
            Unassigned
            Reporter:
            Vladimir Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: