Changeset 93fbdcd


Ignore:
Timestamp:
Dec 15, 2015 5:19:37 PM (4 years ago)
Author:
dev <dev@…>
Branches:
master
Children:
1f4a266
Parents:
0e6e90b
Message:

Made CPUIDCPUInfo non-abstract to support looking for CPU features during CPU identification.

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

Legend:

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

    r0e6e90b r93fbdcd  
    66 *  @since 0.8.7
    77 */
    8 abstract class CPUIDCPUInfo implements CPUInfo
     8public class CPUIDCPUInfo implements CPUInfo
    99{
    1010    public String getVendor()
     
    125125     */
    126126    public boolean hasBMI1() {
    127         return this.hasABM() &&
    128                (CPUID.getExtendedEBXFeatureFlags() & (1 << 3)) != 0; // Extended EBX Feature Bit 3
     127        return (CPUID.getExtendedEBXFeatureFlags() & (1 << 3)) != 0; // Extended EBX Feature Bit 3
    129128    }
    130129   
     
    134133     */
    135134    public boolean hasBMI2() {
    136         return this.hasABM() &&
    137                (CPUID.getExtendedEBXFeatureFlags() & (1 << 8)) != 0; // Extended EBX Feature Bit 8
     135        return (CPUID.getExtendedEBXFeatureFlags() & (1 << 8)) != 0; // Extended EBX Feature Bit 8
    138136    }
    139137
     
    159157     */
    160158    public boolean hasABM() {
    161         return this.hasFMA3() &&
    162                this.hasMOVBE() &&
    163                (CPUID.getExtendedECXCPUFlags() & (1 << 5)) != 0; // Extended EBX Bit 5
     159        return (CPUID.getExtendedECXCPUFlags() & (1 << 5)) != 0; // Extended EBX Bit 5
    164160    }
     161
     162        @Override
     163        public String getCPUModelString() throws UnknownCPUException {
     164        throw new UnknownCPUException("Class CPUIDCPUInfo cannot indentify CPUs");
     165        }
    165166}
  • core/java/src/freenet/support/CPUInformation/IntelInfoImpl.java

    r0e6e90b r93fbdcd  
    3838    public boolean IsSandyCompatible(){ return isSandyCompatible; }
    3939    public boolean IsIvyCompatible(){ return isIvyCompatible; }
    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     }
     40    public boolean IsHaswellCompatible(){ return isHaswellCompatible; }
    4741    public boolean IsBroadwellCompatible(){ return isBroadwellCompatible; }
    4842
     
    383377                    case 0x45:
    384378                    case 0x46:
    385                         CPUInfo c = CPUID.getInfo();
     379                        CPUIDCPUInfo c = new CPUIDCPUInfo();
    386380                        if (c.hasAVX2() && c.hasBMI1() && c.hasBMI2()) {
    387381                            isSandyCompatible = true;
Note: See TracChangeset for help on using the changeset viewer.