Changeset 2c8179f


Ignore:
Timestamp:
Dec 14, 2015 6:54:58 PM (4 years ago)
Author:
dev <dev@…>
Branches:
master
Children:
0e6e90b
Parents:
fe3642e
Message:

Added hasBMI2() feature detection and use it to list some Celeron Haswell CPUs as non-Haswell CPUs.

Location:
core/java/src/freenet/support/CPUInformation
Files:
4 edited

Legend:

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

    rfe3642e r2c8179f  
    325325        System.out.println("CPU model string: " + c.getCPUModelString());
    326326        System.out.println("CPU has MMX:    " + c.hasMMX());
     327        System.out.println("CPU has BMI2:   " + c.hasBMI2());
    327328        System.out.println("CPU has SSE:    " + c.hasSSE());
    328329        System.out.println("CPU has SSE2:   " + c.hasSSE2());
  • core/java/src/freenet/support/CPUInformation/CPUIDCPUInfo.java

    rfe3642e r2c8179f  
    1616    {
    1717        return (CPUID.getEDXCPUFlags() & (1 << 23)) != 0; //EDX Bit 23
     18    }
     19
     20    public boolean hasBMI2(){
     21        return (CPUID.getExtendedEBXFeatureFlags() & (1 << 8)) != 0; // Extended EBX Bit 8
    1822    }
    1923
  • core/java/src/freenet/support/CPUInformation/CPUInfo.java

    rfe3642e r2c8179f  
    2323     */
    2424    public String getVendor();
     25
    2526    /**
    2627     * @return A string detailing what type of CPU that is present in the machine. I.e. 'Pentium IV' etc.
     
    3031     */
    3132    public String getCPUModelString() throws UnknownCPUException;
    32    
     33
    3334    /**
    34      * @return true iff the CPU support the MMX instruction set.
     35     * @return true iff the CPU supports the MMX instruction set.
    3536     */
    3637    public boolean hasMMX();
     38
    3739    /**
    38      * @return true iff the CPU support the SSE instruction set.
     40     * @return true iff the CPU supports the BMI2 instruction set.
     41     */
     42    public boolean hasBMI2();
     43
     44    /**
     45     * @return true iff the CPU supports the SSE instruction set.
    3946     */
    4047    public boolean hasSSE();
     48
    4149    /**
    42      * @return true iff the CPU support the SSE2 instruction set.
     50     * @return true iff the CPU supports the SSE2 instruction set.
    4351     */
    4452    public boolean hasSSE2();
    4553
    4654    /**
    47      * @return true iff the CPU support the SSE3 instruction set.
     55     * @return true iff the CPU supports the SSE3 instruction set.
    4856     */
    4957    public boolean hasSSE3();
    5058   
    5159    /**
    52      * @return true iff the CPU support the SSE4.1 instruction set.
     60     * @return true iff the CPU supports the SSE4.1 instruction set.
    5361     */
    5462    public boolean hasSSE41();
    5563
    5664    /**
    57      * @return true iff the CPU support the SSE4.2 instruction set.
     65     * @return true iff the CPU supports the SSE4.2 instruction set.
    5866     */
    5967    public boolean hasSSE42();
     
    6371     * ref: https://en.wikipedia.org/wiki/SSE4.2#SSE4a
    6472     *
    65      * @return true iff the CPU support the SSE4A instruction set.
     73     * @return true iff the CPU supports the SSE4A instruction set.
    6674     */
    6775    public boolean hasSSE4A();
     
    106114     */
    107115    public boolean hasTBM();
     116
    108117    /**
    109118     * @return true iff the CPU supports the AES-NI instruction set.
  • core/java/src/freenet/support/CPUInformation/IntelInfoImpl.java

    rfe3642e r2c8179f  
    3838    public boolean IsSandyCompatible(){ return isSandyCompatible; }
    3939    public boolean IsIvyCompatible(){ return isIvyCompatible; }
    40     public boolean IsHaswellCompatible(){ return isHaswellCompatible; }
     40    public boolean IsHaswellCompatible(){
     41      // Some Celeron Haswell CPUs do not support BMI2, which
     42      // GMP-6.0 assumes is present in all Haswell CPUs and causes
     43      // crashes. Mark these CPUs as non-Haswell.
     44     
     45      return this.hasBMI2() && isHaswellCompatible;
     46    }
    4147    public boolean IsBroadwellCompatible(){ return isBroadwellCompatible; }
    4248
Note: See TracChangeset for help on using the changeset viewer.