Changeset 5df3f40


Ignore:
Timestamp:
Dec 8, 2015 12:36:49 AM (4 years ago)
Author:
dev <dev@…>
Branches:
master
Children:
fe3642e
Parents:
eec87bd
Message:

Fixed support for Atom CPUs.

Location:
core/java/src
Files:
3 edited

Legend:

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

    reec87bd r5df3f40  
    1616 */
    1717public interface IntelCPUInfo extends CPUInfo {
     18
    1819    /**
    1920     * @return true if the CPU is at least a Pentium CPU.
    2021     */
    2122    public boolean IsPentiumCompatible();
     23
    2224    /**
    2325     * @return true if the CPU is at least a Pentium which implements the MMX instruction/feature set.
    2426     */
    2527    public boolean IsPentiumMMXCompatible();
     28
    2629    /**
    2730     * @return true if the CPU implements at least the p6 instruction set (Pentium II or better).
     
    3033     */
    3134    public boolean IsPentium2Compatible();
     35
    3236    /**
    3337     * @return true if the CPU implements at least a Pentium III level of the p6 instruction/feature set.
    3438     */
    3539    public boolean IsPentium3Compatible();
     40
    3641    /**
     42     * Supports the SSE 2 instructions. Does not necessarily support SSE 3.
     43     * https://en.wikipedia.org/wiki/Pentium_4
    3744     * @return true if the CPU implements at least a Pentium IV level instruction/feature set.
    3845     */
    3946    public boolean IsPentium4Compatible();
     47
    4048    /**
    4149     * @return true if the CPU implements at least a Pentium M level instruction/feature set.
    4250     */
    4351    public boolean IsPentiumMCompatible();     
     52
    4453    /**
     54     * Supports the SSE 2 and SSE 3 instructions.
     55     * https://en.wikipedia.org/wiki/Atom_processor
    4556     * @return true if the CPU implements at least a Atom level instruction/feature set.
    4657     */
  • core/java/src/freenet/support/CPUInformation/IntelInfoImpl.java

    reec87bd r5df3f40  
    321321                        modelString = "Atom";
    322322                        break;
     323                    // Silvermont 22 nm Celeron
     324                    case 0x37:
     325                        isAtomCompatible = true;
     326                        isCore2Compatible = false;
     327                        isCoreiCompatible = false;
     328                        modelString = "Atom";
     329                        break;
    323330                    // Ivy Bridge 22 nm
    324331                    case 0x3a:
  • core/java/src/net/i2p/util/NativeBigInteger.java

    reec87bd r5df3f40  
    2020import java.security.SecureRandom;
    2121import java.util.ArrayList;
     22import java.util.Arrays;
    2223import java.util.Collections;
    2324import java.util.HashMap;
     
    220221    private final static String[] JBIGI_COMPAT_LIST_AMD_BULLDOZER = {JBIGI_OPTIMIZATION_EXCAVATOR, JBIGI_OPTIMIZATION_STEAMROLLER, JBIGI_OPTIMIZATION_PILEDRIVER,
    221222                                                                     JBIGI_OPTIMIZATION_BULLDOZER, JBIGI_OPTIMIZATION_ATHLON64, JBIGI_OPTIMIZATION_X86};
    222     private final static String[] JBIGI_COMPAT_LIST_INTEL_ATOM    = {JBIGI_OPTIMIZATION_ATOM, JBIGI_OPTIMIZATION_PENTIUM4, JBIGI_OPTIMIZATION_PENTIUM3,
    223                                                                      JBIGI_OPTIMIZATION_PENTIUM2, JBIGI_OPTIMIZATION_PENTIUMMMX, JBIGI_OPTIMIZATION_PENTIUM,
    224                                                                      JBIGI_OPTIMIZATION_X86};
     223    private final static String[] JBIGI_COMPAT_LIST_INTEL_ATOM    = {JBIGI_OPTIMIZATION_ATOM, JBIGI_OPTIMIZATION_PENTIUM3, JBIGI_OPTIMIZATION_PENTIUM2,
     224                                                                     JBIGI_OPTIMIZATION_PENTIUMMMX, JBIGI_OPTIMIZATION_PENTIUM, JBIGI_OPTIMIZATION_X86,
     225                                                                     JBIGI_OPTIMIZATION_PENTIUM4};
    225226    private final static String[] JBIGI_COMPAT_LIST_INTEL_PENTIUM = {JBIGI_OPTIMIZATION_PENTIUM4, JBIGI_OPTIMIZATION_PENTIUMM, JBIGI_OPTIMIZATION_PENTIUM3,
    226227                                                                     JBIGI_OPTIMIZATION_PENTIUM2, JBIGI_OPTIMIZATION_PENTIUMMMX, JBIGI_OPTIMIZATION_PENTIUM,
     
    265266        put(JBIGI_OPTIMIZATION_EXCAVATOR,   JBIGI_COMPAT_LIST_AMD_BULLDOZER);
    266267
    267         put(JBIGI_OPTIMIZATION_ATOM, JBIGI_COMPAT_LIST_INTEL_CORE);
     268        put(JBIGI_OPTIMIZATION_ATOM, JBIGI_COMPAT_LIST_INTEL_ATOM);
    268269
    269270        put(JBIGI_OPTIMIZATION_PENTIUM,    JBIGI_COMPAT_LIST_INTEL_PENTIUM);
     
    383384                    if (intelcpu.IsCore2Compatible())
    384385                        return JBIGI_OPTIMIZATION_CORE2;
     386                    // The isAtomCompatible check should be done before the Pentium4
     387                    // check since they are compatible, but Atom performs better with
     388                    // the JBIGI_OPTIMIZATION_ATOM compability list.
     389                    if (intelcpu.IsAtomCompatible())
     390                        return JBIGI_OPTIMIZATION_ATOM;
    385391                    if (intelcpu.IsPentium4Compatible())
    386392                        return JBIGI_OPTIMIZATION_PENTIUM4;
    387                     if (intelcpu.IsAtomCompatible())
    388                         return JBIGI_OPTIMIZATION_ATOM;
    389393                    if (intelcpu.IsPentiumMCompatible())
    390394                        return JBIGI_OPTIMIZATION_PENTIUMM;
     
    11581162           
    11591163            if (rv.isEmpty()) {
    1160                 error("Couldn't find the arch \"" + primary + "\" in its compatibility map \"" + compatList.toString() + "\"");
     1164                error("Couldn't find the arch \"" + primary + "\" in its compatibility map \"" +
     1165                      primary + ": " + Arrays.toString(compatList) + "\"");
    11611166            }
    11621167        }
Note: See TracChangeset for help on using the changeset viewer.