Changeset e82a547 for core


Ignore:
Timestamp:
Jun 6, 2019 1:28:44 PM (10 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
75ace42
Parents:
6d72aee
Message:

CPUID/NBI: Prep for GMP 6.1.2
Add Skylake support (ticket #1869)
Recognize more Intel "Lake" processors
Clean up CLI output

Location:
core/java/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/freenet/support/CPUInformation/CPUID.java

    r6d72aee re82a547  
    341341        }
    342342        System.out.println("JCPUID Version: " + _jcpuidVersion);
    343         System.out.println(" **CPUInfo**");
     343        System.out.println("**CPUInfo**");
    344344        String mname = getCPUModelName();
    345345        if (mname != null)
    346             System.out.println("CPU Model Name: " + mname);
     346            System.out.println("CPU Name:    " + mname);
    347347        String vendor = getCPUVendorID();
    348         System.out.println("CPU Vendor: " + vendor);
     348        System.out.println("CPU Vendor:   " + vendor);
    349349        // http://en.wikipedia.org/wiki/Cpuid
    350350        // http://web.archive.org/web/20110307080258/http://www.intel.com/Assets/PDF/appnote/241618.pdf
     
    359359            family += getCPUExtendedFamily();
    360360        }
    361         System.out.println("CPU Family: " + family);
    362         System.out.println("CPU Model: " + model);
     361        System.out.println("CPU Family:   " + family);
     362        System.out.println("CPU Model:    " + model + " (0x" + Integer.toHexString(model) + ')');
    363363        System.out.println("CPU Stepping: " + getCPUStepping());
    364364        System.out.println("CPU Flags (EDX):      0x" + Integer.toHexString(getEDXCPUFlags()));
     
    370370
    371371        CPUInfo c = getInfo();
    372         System.out.println("\n **More CPUInfo**");
    373         System.out.println("CPU model string: " + c.getCPUModelString());
     372        System.out.println("\n**More CPUInfo**");
     373        System.out.println("CPU model name: " + c.getCPUModelString());
    374374        System.out.println("CPU has MMX:    " + c.hasMMX());
    375375        System.out.println("CPU has SSE:    " + c.hasSSE());
     
    391391        System.out.println("CPU has ABM:    " + c.hasABM());
    392392        if(c instanceof IntelCPUInfo){
    393             System.out.println("\n **Intel-info**");
    394             System.out.println("Is PII-compatible:       "+((IntelCPUInfo)c).IsPentium2Compatible());
    395             System.out.println("Is PIII-compatible:      "+((IntelCPUInfo)c).IsPentium3Compatible());
    396             System.out.println("Is PIV-compatible:       "+((IntelCPUInfo)c).IsPentium4Compatible());
    397             System.out.println("Is Atom-compatible:      "+((IntelCPUInfo)c).IsAtomCompatible());
    398             System.out.println("Is Pentium M compatible: "+((IntelCPUInfo)c).IsPentiumMCompatible());
    399             System.out.println("Is Core2-compatible:     "+((IntelCPUInfo)c).IsCore2Compatible());
    400             System.out.println("Is Corei-compatible:     "+((IntelCPUInfo)c).IsCoreiCompatible());
    401             System.out.println("Is Sandy-compatible:     "+((IntelCPUInfo)c).IsSandyCompatible());
    402             System.out.println("Is Ivy-compatible:       "+((IntelCPUInfo)c).IsIvyCompatible());
    403             System.out.println("Is Haswell-compatible:   "+((IntelCPUInfo)c).IsHaswellCompatible());
    404             System.out.println("Is Broadwell-compatible: "+((IntelCPUInfo)c).IsBroadwellCompatible());
    405         }
    406         if(c instanceof AMDCPUInfo){
    407             System.out.println("\n **AMD-info**");
    408             System.out.println("Is K6-compatible:          "+((AMDCPUInfo)c).IsK6Compatible());
    409             System.out.println("Is K6_2-compatible:        "+((AMDCPUInfo)c).IsK6_2_Compatible());
    410             System.out.println("Is K6_3-compatible:        "+((AMDCPUInfo)c).IsK6_3_Compatible());
    411             System.out.println("Is Geode-compatible:       "+((AMDCPUInfo)c).IsGeodeCompatible());
    412             System.out.println("Is Athlon-compatible:      "+((AMDCPUInfo)c).IsAthlonCompatible());
    413             System.out.println("Is Athlon64-compatible:    "+((AMDCPUInfo)c).IsAthlon64Compatible());
    414             System.out.println("Is Bobcat-compatible:      "+((AMDCPUInfo)c).IsBobcatCompatible());
    415             System.out.println("Is K10-compatible:         "+((AMDCPUInfo)c).IsK10Compatible());
    416             System.out.println("Is Jaguar-compatible:      "+((AMDCPUInfo)c).IsJaguarCompatible());
    417             System.out.println("Is Bulldozer-compatible:   "+((AMDCPUInfo)c).IsBulldozerCompatible());
    418             System.out.println("Is Piledriver-compatible:  "+((AMDCPUInfo)c).IsPiledriverCompatible());
    419             System.out.println("Is Steamroller-compatible: "+((AMDCPUInfo)c).IsSteamrollerCompatible());
    420             System.out.println("Is Excavator-compatible:   "+((AMDCPUInfo)c).IsExcavatorCompatible());
     393            IntelCPUInfo cc = (IntelCPUInfo) c;
     394            System.out.println("\n**Intel-info**");
     395            System.out.println("Is PII-compatible:       " + cc.IsPentium2Compatible());
     396            System.out.println("Is PIII-compatible:      " + cc.IsPentium3Compatible());
     397            System.out.println("Is PIV-compatible:       " + cc.IsPentium4Compatible());
     398            System.out.println("Is Atom-compatible:      " + cc.IsAtomCompatible());
     399            System.out.println("Is Pentium M compatible: " + cc.IsPentiumMCompatible());
     400            System.out.println("Is Core2-compatible:     " + cc.IsCore2Compatible());
     401            System.out.println("Is Corei-compatible:     " + cc.IsCoreiCompatible());
     402            System.out.println("Is Sandy-compatible:     " + cc.IsSandyCompatible());
     403            System.out.println("Is Ivy-compatible:       " + cc.IsIvyCompatible());
     404            System.out.println("Is Haswell-compatible:   " + cc.IsHaswellCompatible());
     405            System.out.println("Is Broadwell-compatible: " + cc.IsBroadwellCompatible());
     406            System.out.println("Is Skylake-compatible:   " + cc.IsSkylakeCompatible());
     407        } else if (c instanceof AMDCPUInfo) {
     408            AMDCPUInfo cc = (AMDCPUInfo) c;
     409            System.out.println("\n**AMD-info**");
     410            System.out.println("Is K6-compatible:          " + cc.IsK6Compatible());
     411            System.out.println("Is K6_2-compatible:        " + cc.IsK6_2_Compatible());
     412            System.out.println("Is K6_3-compatible:        " + cc.IsK6_3_Compatible());
     413            System.out.println("Is Geode-compatible:       " + cc.IsGeodeCompatible());
     414            System.out.println("Is Athlon-compatible:      " + cc.IsAthlonCompatible());
     415            System.out.println("Is Athlon64-compatible:    " + cc.IsAthlon64Compatible());
     416            System.out.println("Is Bobcat-compatible:      " + cc.IsBobcatCompatible());
     417            System.out.println("Is K10-compatible:         " + cc.IsK10Compatible());
     418            System.out.println("Is Jaguar-compatible:      " + cc.IsJaguarCompatible());
     419            System.out.println("Is Bulldozer-compatible:   " + cc.IsBulldozerCompatible());
     420            System.out.println("Is Piledriver-compatible:  " + cc.IsPiledriverCompatible());
     421            System.out.println("Is Steamroller-compatible: " + cc.IsSteamrollerCompatible());
     422            System.out.println("Is Excavator-compatible:   " + cc.IsExcavatorCompatible());
    421423        }
    422424    }
  • core/java/src/freenet/support/CPUInformation/IntelCPUInfo.java

    r6d72aee re82a547  
    140140     */
    141141    public boolean IsBroadwellCompatible();
     142
     143    /**
     144     * Supports the AVX-512 instrutions.
     145     *
     146     * @since 0.9.41
     147     */
     148    public boolean IsSkylakeCompatible();
    142149}
  • core/java/src/freenet/support/CPUInformation/IntelInfoImpl.java

    r6d72aee re82a547  
    2424    private static boolean isHaswellCompatible;
    2525    private static boolean isBroadwellCompatible;
     26    private static boolean isSkylakeCompatible;
    2627   
    2728    // If modelString != null, the cpu is considered correctly identified.
     
    4041    public boolean IsHaswellCompatible(){ return isHaswellCompatible; }
    4142    public boolean IsBroadwellCompatible(){ return isBroadwellCompatible; }
     43    /**
     44     * Supports the AVX-512 instrutions.
     45     * @since 0.9.41
     46     */
     47    public boolean IsSkylakeCompatible() { return isSkylakeCompatible; }
    4248
    4349    public String getCPUModelString() throws UnknownCPUException
     
    6268            // Intel uses extended model for family = 15 or family = 6,
    6369            // which is not what wikipedia says
     70            // we construct the model from EAX as follows:
     71            // ext. model is 5th byte, base model is 2nd byte
     72            // So e.g. for a published CPUID value of "306C1"
     73            // the model here would be 0x3c, it's a Haswell.
    6474            model += CPUID.getCPUExtendedModel() << 4;
    6575        }
     
    440450                    case 0x4e:
    441451                    case 0x55:
    442                     case 0x5e: {
     452                    case 0x5c: // Apollo Lake
     453                    case 0x5e:
     454                    case 0x66: // Cannon Lake
     455                    case 0x67: // Cannon Lake
     456                    case 0x6c: // Apollo Lake
     457                               {
    443458                        CPUIDCPUInfo c = new CPUIDCPUInfo();
    444459                        if (c.hasAVX2() && c.hasBMI1()  && c.hasBMI2() &&
     
    447462                            isIvyCompatible = true;
    448463                            isHaswellCompatible = true;
    449                             if (c.hasADX())
     464                            if (c.hasADX()) {
    450465                                isBroadwellCompatible = true;
     466                                if (c.hasAVX512())
     467                                    isSkylakeCompatible = true;
     468                            }
    451469                            modelString = "Skylake Core i3/i5/i7";
    452470                        } else {
     
    464482                    }
    465483
     484
     485                // TODO case 0x5f: // Goldmont / Atom
     486                // TODO case 0x7a: // Gemini Lake
     487                // TODO case 0x7e: // Ice Lake
     488
     489
    466490                // following are for extended model == 8 or 9
    467491                // most flags are set above
     
    470494                    // Kaby Lake
    471495                    // ref: https://github.com/InstLatx64/InstLatx64/commit/9d2ea1a9eb727868dc514900da9e2f175710f9bf
     496                    // ref: https://github.com/InstLatx64/InstLatx64/blob/master/ChangeLog.htm
     497                    // ref: https://github.com/coreboot/coreboot/blob/master/src/soc/intel/common/block/include/intelblocks/mp_init.h
    472498                    // See Haswell notes above
    473                     case 0x8e:
    474                     case 0x9e: {
     499                    case 0x8e: // also Whiskey Lake, Coffee Lake
     500                    case 0x9e: // also Whiskey Lake, Coffee Lake
     501                    case 0xa5: // Comet Lake
     502                    case 0xa6: // Comet Lake
     503                               {
    475504                        CPUIDCPUInfo c = new CPUIDCPUInfo();
    476505                        if (c.hasAVX2() && c.hasBMI1()  && c.hasBMI2() &&
     
    479508                            isIvyCompatible = true;
    480509                            isHaswellCompatible = true;
    481                             if (c.hasADX())
     510                            if (c.hasADX()) {
    482511                                isBroadwellCompatible = true;
     512                                if (c.hasAVX512())
     513                                    isSkylakeCompatible = true;
     514                            }
    483515                            modelString = "Kaby Lake Core i3/i5/i7";
    484516                        } else {
  • core/java/src/net/i2p/util/NativeBigInteger.java

    r6d72aee re82a547  
    173173    private final static String JBIGI_OPTIMIZATION_BOBCAT      = "bobcat";
    174174    private final static String JBIGI_OPTIMIZATION_JAGUAR      = "jaguar";
     175    /** @since 0.9.41 */
     176    private final static String JBIGI_OPTIMIZATION_SKYLAKE     = "skylake";
    175177
    176178    /**
     
    234236                                                                     JBIGI_OPTIMIZATION_PENTIUM2, JBIGI_OPTIMIZATION_PENTIUMMMX, JBIGI_OPTIMIZATION_PENTIUM,
    235237                                                                     JBIGI_OPTIMIZATION_X86};
    236     private final static String[] JBIGI_COMPAT_LIST_INTEL_CORE    = {JBIGI_OPTIMIZATION_COREI_BWL, JBIGI_OPTIMIZATION_COREI_HWL, JBIGI_OPTIMIZATION_COREI_SBR,
     238    private final static String[] JBIGI_COMPAT_LIST_INTEL_CORE    = {JBIGI_OPTIMIZATION_SKYLAKE,
     239                                                                     JBIGI_OPTIMIZATION_COREI_BWL, JBIGI_OPTIMIZATION_COREI_HWL, JBIGI_OPTIMIZATION_COREI_SBR,
    237240                                                                     JBIGI_OPTIMIZATION_COREI, JBIGI_OPTIMIZATION_CORE2, JBIGI_OPTIMIZATION_PENTIUMM,
    238241                                                                     JBIGI_OPTIMIZATION_PENTIUM3, JBIGI_OPTIMIZATION_X86};
     
    294297        put(JBIGI_OPTIMIZATION_COREI_HWL, JBIGI_COMPAT_LIST_INTEL_CORE);
    295298        put(JBIGI_OPTIMIZATION_COREI_BWL, JBIGI_COMPAT_LIST_INTEL_CORE);
     299        put(JBIGI_OPTIMIZATION_SKYLAKE,   JBIGI_COMPAT_LIST_INTEL_CORE);
    296300    }};
    297301
     
    388392                } else if (c instanceof IntelCPUInfo) {
    389393                    IntelCPUInfo intelcpu = (IntelCPUInfo) c;
     394                    if (intelcpu.IsSkylakeCompatible())
     395                        return JBIGI_OPTIMIZATION_SKYLAKE;
    390396                    if (intelcpu.IsBroadwellCompatible())
    391397                        return JBIGI_OPTIMIZATION_COREI_BWL;
Note: See TracChangeset for help on using the changeset viewer.