Changeset 68adfa80
 Timestamp:
 May 20, 2015 1:06:26 AM (5 years ago)
 Branches:
 master
 Children:
 2185a65, 9134d28
 Parents:
 1e8c299b
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

core/java/src/net/i2p/util/NativeBigInteger.java
r1e8c299b r68adfa80 33 33 import freenet.support.CPUInformation.VIACPUInfo; 34 34 import freenet.support.CPUInformation.UnknownCPUException; 35 36 35 import net.i2p.I2PAppContext; 37 36 import net.i2p.crypto.CryptoConstants; … … 146 145 * @since 0.8.7 147 146 */ 147 private final static String JBIGI_OPTIMIZATION_PENTIUMM = "pentiumm"; 148 148 private final static String JBIGI_OPTIMIZATION_ATOM = "atom"; 149 149 private final static String JBIGI_OPTIMIZATION_CORE2 = "core2"; … … 151 151 private final static String JBIGI_OPTIMIZATION_GEODE = "geode"; 152 152 private final static String JBIGI_OPTIMIZATION_NANO = "nano"; 153 private final static String JBIGI_OPTIMIZATION_PENTIUMM = "pentiumm";154 153 /** all libjbibi builds are identical to pentium3, case handled in getMiddleName2() */ 155 154 private final static String JBIGI_OPTIMIZATION_VIAC32 = "viac32"; 155 /** 156 * The optimization levels defined here are since 0.9.21. Each of the 32bit processors below 157 * needs an explicit fallback in getResourceList() or getMiddleName2(). 158 * 64bit processors will fallback to athlon64 and athlon in getResourceList(). 159 * @since 0.9.21 160 */ 161 private final static String JBIGI_OPTIMIZATION_COREI_SBR = "coreisbr"; 162 private final static String JBIGI_OPTIMIZATION_COREI_HWL = "coreihwl"; 163 private final static String JBIGI_OPTIMIZATION_COREI_BWL = "coreibwl"; 164 private final static String JBIGI_OPTIMIZATION_BULLDOZER = "bulldozer"; 165 private final static String JBIGI_OPTIMIZATION_PILEDRIVER = "piledriver"; 166 private final static String JBIGI_OPTIMIZATION_STEAMROLLER = "steamroller"; 167 private final static String JBIGI_OPTIMIZATION_EXCAVATOR = "excavator"; 168 private final static String JBIGI_OPTIMIZATION_BOBCAT = "bobcat"; 169 private final static String JBIGI_OPTIMIZATION_JAGUAR = "jaguar"; 156 170 157 171 /** … … 159 173 * @since 0.8.7 160 174 */ 161 private final static String JBIGI_OPTIMIZATION_ARM = "arm";162 175 private final static String JBIGI_OPTIMIZATION_PPC = "ppc"; 176 177 /** 178 * ARM 179 * @since 0.9.21 180 */ 181 private final static String JBIGI_OPTIMIZATION_ARM_ARMV5 = "armv5"; 182 private final static String JBIGI_OPTIMIZATION_ARM_ARMV6 = "armv6"; 183 private final static String JBIGI_OPTIMIZATION_ARM_ARMV7 = "armv7"; 184 185 /** 186 * None, no optimizations. The default fallback for x86. 187 * @since 0.9.21 188 */ 189 private final static String JBIGI_OPTIMIZATION_X86 = "none"; 190 191 /** 192 * CPU architecture compatibility lists, in order of preference. 193 * 194 * The list is organized by the chronological evolution of architectures. 195 * Totally unrelated architectures have separate lists. Sequences of 196 * architectures that aren't backwards compatible (performance wise) for 197 * some reasons have also been separated out. 198 * 199 * Really this could be represented by a DAG, but the benefits don't 200 * outweigh the implementation time. 201 */ 202 private final static String[] JBIGI_COMPAT_LIST_PPC = {JBIGI_OPTIMIZATION_PPC}; 203 private final static String[] JBIGI_COMPAT_LIST_ARM = {JBIGI_OPTIMIZATION_ARM_ARMV7, JBIGI_OPTIMIZATION_ARM_ARMV6, JBIGI_OPTIMIZATION_ARM_ARMV5}; 204 private final static String[] JBIGI_COMPAT_LIST_VIA = {JBIGI_OPTIMIZATION_NANO, JBIGI_OPTIMIZATION_VIAC32, JBIGI_OPTIMIZATION_VIAC3, 205 JBIGI_OPTIMIZATION_PENTIUM, JBIGI_OPTIMIZATION_X86}; 206 private final static String[] JBIGI_COMPAT_LIST_AMD_ATHLON = {JBIGI_OPTIMIZATION_ATHLON64, JBIGI_OPTIMIZATION_ATHLON, JBIGI_OPTIMIZATION_K6_3, 207 JBIGI_OPTIMIZATION_K6_2, JBIGI_OPTIMIZATION_K6, JBIGI_OPTIMIZATION_X86}; 208 private final static String[] JBIGI_COMPAT_LIST_AMD_GEODE = {JBIGI_OPTIMIZATION_GEODE, JBIGI_OPTIMIZATION_K6_3, JBIGI_OPTIMIZATION_K6_2, JBIGI_OPTIMIZATION_K6, 209 JBIGI_OPTIMIZATION_X86}; 210 private final static String[] JBIGI_COMPAT_LIST_AMD_APU = {JBIGI_OPTIMIZATION_JAGUAR, JBIGI_OPTIMIZATION_BOBCAT, JBIGI_OPTIMIZATION_ATHLON64}; 211 private final static String[] JBIGI_COMPAT_LIST_AMD_BULLDOZER = {JBIGI_OPTIMIZATION_EXCAVATOR, JBIGI_OPTIMIZATION_STEAMROLLER, JBIGI_OPTIMIZATION_PILEDRIVER, 212 JBIGI_OPTIMIZATION_BULLDOZER, JBIGI_OPTIMIZATION_ATHLON64, JBIGI_OPTIMIZATION_X86}; 213 private final static String[] JBIGI_COMPAT_LIST_INTEL_ATOM = {JBIGI_OPTIMIZATION_ATOM, JBIGI_OPTIMIZATION_PENTIUM4, JBIGI_OPTIMIZATION_PENTIUM3, 214 JBIGI_OPTIMIZATION_PENTIUM2, JBIGI_OPTIMIZATION_PENTIUMMMX, JBIGI_OPTIMIZATION_PENTIUM, 215 JBIGI_OPTIMIZATION_X86}; 216 private final static String[] JBIGI_COMPAT_LIST_INTEL_PENTIUM = {JBIGI_OPTIMIZATION_PENTIUM4, JBIGI_OPTIMIZATION_PENTIUMM, JBIGI_OPTIMIZATION_PENTIUM3, 217 JBIGI_OPTIMIZATION_PENTIUM2, JBIGI_OPTIMIZATION_PENTIUMMMX, JBIGI_OPTIMIZATION_PENTIUM, 218 JBIGI_OPTIMIZATION_X86}; 219 private final static String[] JBIGI_COMPAT_LIST_INTEL_CORE = {JBIGI_OPTIMIZATION_COREI_BWL, JBIGI_OPTIMIZATION_COREI_HWL, JBIGI_OPTIMIZATION_COREI_SBR, 220 JBIGI_OPTIMIZATION_COREI, JBIGI_OPTIMIZATION_CORE2, JBIGI_OPTIMIZATION_PENTIUMM, 221 JBIGI_OPTIMIZATION_PENTIUM3, JBIGI_OPTIMIZATION_X86}; 222 /** 223 * The mapping between CPU architecture and it's compatibility list. 224 */ 225 @SuppressWarnings("serial") 226 private final static HashMap<String, String[] > JBIGI_COMPAT_MAP = new HashMap<String, String[]>(){{ 227 put(JBIGI_OPTIMIZATION_PPC, JBIGI_COMPAT_LIST_PPC); 228 229 put(JBIGI_OPTIMIZATION_ARM_ARMV5, JBIGI_COMPAT_LIST_ARM); 230 put(JBIGI_OPTIMIZATION_ARM_ARMV6, JBIGI_COMPAT_LIST_ARM); 231 put(JBIGI_OPTIMIZATION_ARM_ARMV7, JBIGI_COMPAT_LIST_ARM); 232 233 put(JBIGI_OPTIMIZATION_VIAC3, JBIGI_COMPAT_LIST_VIA); 234 put(JBIGI_OPTIMIZATION_VIAC32, JBIGI_COMPAT_LIST_VIA); 235 put(JBIGI_OPTIMIZATION_NANO, JBIGI_COMPAT_LIST_VIA); 236 237 put(JBIGI_OPTIMIZATION_K6, JBIGI_COMPAT_LIST_AMD_ATHLON); 238 put(JBIGI_OPTIMIZATION_K6_2, JBIGI_COMPAT_LIST_AMD_ATHLON); 239 put(JBIGI_OPTIMIZATION_K6_3, JBIGI_COMPAT_LIST_AMD_ATHLON); 240 put(JBIGI_OPTIMIZATION_ATHLON, JBIGI_COMPAT_LIST_AMD_ATHLON); 241 put(JBIGI_OPTIMIZATION_ATHLON64, JBIGI_COMPAT_LIST_AMD_ATHLON); 242 243 put(JBIGI_OPTIMIZATION_GEODE, JBIGI_COMPAT_LIST_AMD_GEODE); 244 245 put(JBIGI_OPTIMIZATION_BOBCAT, JBIGI_COMPAT_LIST_AMD_APU); 246 put(JBIGI_OPTIMIZATION_JAGUAR, JBIGI_COMPAT_LIST_AMD_APU); 247 248 put(JBIGI_OPTIMIZATION_BULLDOZER, JBIGI_COMPAT_LIST_AMD_BULLDOZER); 249 put(JBIGI_OPTIMIZATION_PILEDRIVER, JBIGI_COMPAT_LIST_AMD_BULLDOZER); 250 put(JBIGI_OPTIMIZATION_STEAMROLLER, JBIGI_COMPAT_LIST_AMD_BULLDOZER); 251 put(JBIGI_OPTIMIZATION_EXCAVATOR, JBIGI_COMPAT_LIST_AMD_BULLDOZER); 252 253 put(JBIGI_OPTIMIZATION_ATOM, JBIGI_COMPAT_LIST_INTEL_CORE); 254 255 put(JBIGI_OPTIMIZATION_PENTIUM, JBIGI_COMPAT_LIST_INTEL_PENTIUM); 256 put(JBIGI_OPTIMIZATION_PENTIUMMMX, JBIGI_COMPAT_LIST_INTEL_PENTIUM); 257 put(JBIGI_OPTIMIZATION_PENTIUM2, JBIGI_COMPAT_LIST_INTEL_PENTIUM); 258 put(JBIGI_OPTIMIZATION_PENTIUM3, JBIGI_COMPAT_LIST_INTEL_PENTIUM); 259 put(JBIGI_OPTIMIZATION_PENTIUMM, JBIGI_COMPAT_LIST_INTEL_PENTIUM); 260 put(JBIGI_OPTIMIZATION_PENTIUM4, JBIGI_COMPAT_LIST_INTEL_PENTIUM); 261 262 put(JBIGI_OPTIMIZATION_PENTIUM3, JBIGI_COMPAT_LIST_INTEL_CORE); 263 put(JBIGI_OPTIMIZATION_PENTIUMM, JBIGI_COMPAT_LIST_INTEL_CORE); 264 put(JBIGI_OPTIMIZATION_CORE2, JBIGI_COMPAT_LIST_INTEL_CORE); 265 put(JBIGI_OPTIMIZATION_COREI, JBIGI_COMPAT_LIST_INTEL_CORE); 266 put(JBIGI_OPTIMIZATION_COREI_SBR, JBIGI_COMPAT_LIST_INTEL_CORE); 267 put(JBIGI_OPTIMIZATION_COREI_HWL, JBIGI_COMPAT_LIST_INTEL_CORE); 268 put(JBIGI_OPTIMIZATION_COREI_BWL, JBIGI_COMPAT_LIST_INTEL_CORE); 269 }}; 163 270 164 271 /** … … 198 305 private static final String _libSuffix = (_isWin  _isOS2 ? ".dll" : _isMac ? ".jnilib" : ".so"); 199 306 200 private final static String sCPUType; //The CPU Type to optimize for (one of the above strings)307 private final static String sCPUType; 201 308 202 309 static { 203 if (_isX86) // Don't try to resolve CPU type on non x86 hardware 204 sCPUType = resolveCPUType(); 205 else if (_isArm) 206 sCPUType = JBIGI_OPTIMIZATION_ARM; 207 else if (_isPPC && !_isMac) 208 sCPUType = JBIGI_OPTIMIZATION_PPC; 209 else 210 sCPUType = null; 310 sCPUType = resolveCPUType(); 211 311 loadNative(); 212 312 } … … 218 318 */ 219 319 private static String resolveCPUType() { 220 try {221 CPUInfo c = CPUID.getInfo();320 321 if(_isX86) { 222 322 try { 223 _cpuModel = c.getCPUModelString(); 224 } catch (UnknownCPUException e) {} 225 if (c instanceof VIACPUInfo){ 226 VIACPUInfo viacpu = (VIACPUInfo) c; 227 if (viacpu.IsNanoCompatible()) 228 return JBIGI_OPTIMIZATION_NANO; 229 return JBIGI_OPTIMIZATION_VIAC3; 230 } else if(c instanceof AMDCPUInfo) { 231 AMDCPUInfo amdcpu = (AMDCPUInfo) c; 232 // Supported in CPUID, no GMP support 233 //if (amdcpu.IsBobcatCompatible()) 234 // return JBIGI_OPTIMIZATION_BOBCAT; 235 if (amdcpu.IsAthlon64Compatible()) 236 return JBIGI_OPTIMIZATION_ATHLON64; 237 if (amdcpu.IsAthlonCompatible()) 238 return JBIGI_OPTIMIZATION_ATHLON; 239 // FIXME lots of geodes, but GMP configures like a K63 240 if (amdcpu.IsGeodeCompatible()) 241 return JBIGI_OPTIMIZATION_GEODE; 242 if (amdcpu.IsK6_3_Compatible()) 243 return JBIGI_OPTIMIZATION_K6_3; 244 if (amdcpu.IsK6_2_Compatible()) 245 return JBIGI_OPTIMIZATION_K6_2; 246 if (amdcpu.IsK6Compatible()) 247 return JBIGI_OPTIMIZATION_K6; 248 } else if (c instanceof IntelCPUInfo) { 249 IntelCPUInfo intelcpu = (IntelCPUInfo) c; 250 if (intelcpu.IsCoreiCompatible()) 251 return JBIGI_OPTIMIZATION_COREI; 252 if (intelcpu.IsCore2Compatible()) 253 return JBIGI_OPTIMIZATION_CORE2; 254 if (intelcpu.IsPentium4Compatible()) 255 return JBIGI_OPTIMIZATION_PENTIUM4; 256 if (intelcpu.IsAtomCompatible()) 257 return JBIGI_OPTIMIZATION_ATOM; 258 if (intelcpu.IsPentiumMCompatible()) 259 return JBIGI_OPTIMIZATION_PENTIUMM; 260 if (intelcpu.IsPentium3Compatible()) 261 return JBIGI_OPTIMIZATION_PENTIUM3; 262 if (intelcpu.IsPentium2Compatible()) 263 return JBIGI_OPTIMIZATION_PENTIUM2; 264 if (intelcpu.IsPentiumMMXCompatible()) 265 return JBIGI_OPTIMIZATION_PENTIUMMMX; 266 if (intelcpu.IsPentiumCompatible()) 267 return JBIGI_OPTIMIZATION_PENTIUM; 268 } 323 CPUInfo c = CPUID.getInfo(); 324 try { 325 _cpuModel = c.getCPUModelString(); 326 } catch (UnknownCPUException e) {} 327 if (c instanceof VIACPUInfo){ 328 VIACPUInfo viacpu = (VIACPUInfo) c; 329 if (viacpu.IsNanoCompatible()) 330 return JBIGI_OPTIMIZATION_NANO; 331 return JBIGI_OPTIMIZATION_VIAC3; 332 } else if(c instanceof AMDCPUInfo) { 333 AMDCPUInfo amdcpu = (AMDCPUInfo) c; 334 if (amdcpu.IsExcavatorCompatible()) 335 return JBIGI_OPTIMIZATION_EXCAVATOR; 336 if (amdcpu.IsSteamrollerCompatible()) 337 return JBIGI_OPTIMIZATION_STEAMROLLER; 338 if (amdcpu.IsPiledriverCompatible()) 339 return JBIGI_OPTIMIZATION_PILEDRIVER; 340 if (amdcpu.IsBulldozerCompatible()) 341 return JBIGI_OPTIMIZATION_BULLDOZER; 342 if (amdcpu.IsJaguarCompatible()) 343 return JBIGI_OPTIMIZATION_JAGUAR; 344 if (amdcpu.IsBobcatCompatible()) 345 return JBIGI_OPTIMIZATION_BOBCAT; 346 if (amdcpu.IsAthlon64Compatible()) 347 return JBIGI_OPTIMIZATION_ATHLON64; 348 if (amdcpu.IsAthlonCompatible()) 349 return JBIGI_OPTIMIZATION_ATHLON; 350 if (amdcpu.IsGeodeCompatible()) 351 return JBIGI_OPTIMIZATION_GEODE; 352 if (amdcpu.IsK6_3_Compatible()) 353 return JBIGI_OPTIMIZATION_K6_3; 354 if (amdcpu.IsK6_2_Compatible()) 355 return JBIGI_OPTIMIZATION_K6_2; 356 if (amdcpu.IsK6Compatible()) 357 return JBIGI_OPTIMIZATION_K6; 358 } else if (c instanceof IntelCPUInfo) { 359 IntelCPUInfo intelcpu = (IntelCPUInfo) c; 360 if (intelcpu.IsBroadwellCompatible()) 361 return JBIGI_OPTIMIZATION_COREI_BWL; 362 if (intelcpu.IsHaswellCompatible()) 363 return JBIGI_OPTIMIZATION_COREI_HWL; 364 if (intelcpu.IsSandyCompatible()) 365 return JBIGI_OPTIMIZATION_COREI_SBR; 366 if (intelcpu.IsCoreiCompatible()) 367 return JBIGI_OPTIMIZATION_COREI; 368 if (intelcpu.IsCore2Compatible()) 369 return JBIGI_OPTIMIZATION_CORE2; 370 if (intelcpu.IsPentium4Compatible()) 371 return JBIGI_OPTIMIZATION_PENTIUM4; 372 if (intelcpu.IsAtomCompatible()) 373 return JBIGI_OPTIMIZATION_ATOM; 374 if (intelcpu.IsPentiumMCompatible()) 375 return JBIGI_OPTIMIZATION_PENTIUMM; 376 if (intelcpu.IsPentium3Compatible()) 377 return JBIGI_OPTIMIZATION_PENTIUM3; 378 if (intelcpu.IsPentium2Compatible()) 379 return JBIGI_OPTIMIZATION_PENTIUM2; 380 if (intelcpu.IsPentiumMMXCompatible()) 381 return JBIGI_OPTIMIZATION_PENTIUMMMX; 382 if (intelcpu.IsPentiumCompatible()) 383 return JBIGI_OPTIMIZATION_PENTIUM; 384 } 385 return null; 386 } catch (UnknownCPUException e) { 387 return null; 388 } 389 } else if (_isArm) { 390 Map<String, String> cpuinfo = getCPUInfo(); 391 String proc = cpuinfo.get("model name"); 392 if (proc != null && proc.contains("ARMv7")) { 393 return JBIGI_OPTIMIZATION_ARM_ARMV7; 394 } else if (proc != null && proc.contains("ARMv6")) { 395 return JBIGI_OPTIMIZATION_ARM_ARMV6; 396 } else if (proc != null && proc.contains("ARMv5")) { 397 return JBIGI_OPTIMIZATION_ARM_ARMV5; 398 } 399 // If we didn't find a match, return null 269 400 return null; 270 } catch (UnknownCPUException e) { 271 return null; //TODO: Log something here maybe.. 272 } 401 } else if (_isPPC && !_isMac) { 402 return JBIGI_OPTIMIZATION_PPC; 403 } 404 405 return null; 273 406 } 274 407 … … 358 491 * Set the jbigi and libgmp versions. Call after loading. 359 492 * Sets _jbigiVersion, _nativeOK3, and _libGMPVersion. 360 * @since 0.9. 18493 * @since 0.9.21 361 494 */ 362 495 private static void setVersions() { … … 763 896 _loadStatus = s; 764 897 } 898 899 /** @since 0.9.21 */ 900 private static void error(String s) { 901 error(s, null); 902 } 903 904 /** @since 0.9.21 */ 905 private static void error(String s, Throwable t) { 906 if(_doLog) { 907 System.err.println("ERROR: " + s); 908 if (t != null) 909 t.printStackTrace(); 910 } 911 I2PAppContext.getGlobalContext().logManager().getLog(NativeBigInteger.class).error(s, t); 912 if (t != null) 913 _loadStatus = s + ' ' + t; 914 else 915 _loadStatus = s; 916 } 765 917 766 918 /** … … 872 1024 * See loadNative() comments for more info. 873 1025 * @return nonnull 874 * @since 0.8.7 875 */ 876 private static List<String> getResourceList() { 877 if (_isAndroid) 1026 * @since 0.9.21 1027 */ 1028 private static List<String> getResourceList(){ 1029 List<String> rv = new ArrayList<String>(20); 1030 String primary = getMiddleName2(true); 1031 String[] compatList = JBIGI_COMPAT_MAP.get(primary); 1032 1033 if (_isAndroid) { 878 1034 return Collections.emptyList(); 879 List<String> rv = new ArrayList<String>(8); 880 String primary = getMiddleName2(true); 881 if (primary != null) { 882 if (_is64) { 883 // add 64 bit variants at the front 884 if (!primary.equals(JBIGI_OPTIMIZATION_ATHLON64)) 885 rv.add(_libPrefix + getMiddleName1() + primary + "_64" + _libSuffix); 886 // 64 bit core2 is always a fallback for 64 bit corei 887 if (primary.equals(JBIGI_OPTIMIZATION_COREI)) 888 rv.add(_libPrefix + getMiddleName1() + JBIGI_OPTIMIZATION_CORE2 + "_64" + _libSuffix); 889 // athlon64_64 is always a fallback for 64 bit 890 rv.add(_libPrefix + getMiddleName1() + JBIGI_OPTIMIZATION_ATHLON64 + "_64" + _libSuffix); 891 } 892 893 // 32 bit below here 894 895 if (_isArm) { 896 Map<String, String> cpuinfo = getCPUInfo(); 897 int ver = 0; 898 String proc = cpuinfo.get("processor"); 899 String arch = cpuinfo.get("cpu architecture"); 900 if (proc != null && proc.contains("ARMv6")) { 901 // Raspberry Pi workaround 902 // Processor : ARMv6compatible processor rev 7 (v6l) 903 // CPU architecture: 7 904 ver = 6; 905 } else if (arch != null && arch.length() > 0) { 906 //CPU architecture: 5TEJ 907 //CPU architecture: 7 908 String sver = arch.substring(0, 1); 909 try { 910 ver = Integer.parseInt(sver); 911 } catch (NumberFormatException nfe) {} 1035 } 1036 if (primary != null && 1037 compatList != null) { 1038 // Add all architectural parents of this arch to the resource list 1039 // Skip architectures that are newer than our target 1040 int i = 0; 1041 for (; i < compatList.length; ++i) { 1042 if (compatList[i].equals(primary)) { 1043 break; 912 1044 } 913 // add libjbigilinuxarmv7.so, libjbigilinuxarmv6.so, ... 914 for (int i = ver; i >= 3; i) { 915 rv.add(_libPrefix + getMiddleName1() + primary + 'v' + i + _libSuffix); 1045 } 1046 for (; i < compatList.length; ++i) { 1047 if (_is64) { 1048 rv.add(_libPrefix + getMiddleName1() + compatList[i] + "_64" + _libSuffix); 916 1049 } 917 } 918 919 // the preferred selection 920 rv.add(_libPrefix + getMiddleName1() + primary + _libSuffix); 921 922 // core2 is always a fallback for corei 923 if (primary.equals(JBIGI_OPTIMIZATION_COREI)) 924 rv.add(_libPrefix + getMiddleName1() + JBIGI_OPTIMIZATION_CORE2 + _libSuffix); 925 926 // athlon64 is always a fallback for 64 bit 927 if (_is64 && !primary.equals(JBIGI_OPTIMIZATION_ATHLON64)) 928 rv.add(_libPrefix + getMiddleName1() + JBIGI_OPTIMIZATION_ATHLON64 + _libSuffix); 929 930 // Add fallbacks for any 32bit that were added 0.8.7 or later here 931 // FIXME lots of geodes, but GMP configures like a K63, so pentium3 is probably a good backup 932 if (primary.equals(JBIGI_OPTIMIZATION_ATOM)  933 primary.equals(JBIGI_OPTIMIZATION_PENTIUMM)  934 primary.equals(JBIGI_OPTIMIZATION_GEODE)) 935 rv.add(_libPrefix + getMiddleName1() + JBIGI_OPTIMIZATION_PENTIUM3 + _libSuffix); 936 937 // athlon is always a fallback for 64 bit, we have it for all architectures 938 // and it should be much better than "none" 939 if (_is64) 940 rv.add(_libPrefix + getMiddleName1() + JBIGI_OPTIMIZATION_ATHLON + _libSuffix); 941 1050 rv.add(_libPrefix + getMiddleName1() + compatList[i] + _libSuffix); 1051 } 1052 1053 if (rv.size() <= 0) { 1054 error("Couldn't find the arch \"" + primary + "\" in it's compatibility map \"" + compatList.toString() + "\""); 1055 } 942 1056 } else { 943 if (_is64) { 944 rv.add(_libPrefix + getMiddleName1() + JBIGI_OPTIMIZATION_ATHLON64 + "_64" + _libSuffix); 945 rv.add(_libPrefix + getMiddleName1() + JBIGI_OPTIMIZATION_ATHLON64 + _libSuffix); 946 } 947 } 948 // Add libjbigixxxnone_64.so 949 if (_is64) 950 rv.add(_libPrefix + getMiddleName1() + "none_64" + _libSuffix); 951 // Add libjbigixxxnone.so 952 // Note that libjbigiosxnone.jnilib is a 'fat binary' with both PPC and x8632 953 if (!_isArm && !_isPPC && !_isMac) 954 rv.add(getResourceName(false)); 1057 error("Couldn't find the compatibility map for arch \"" + primary + "\""); 1058 } 1059 955 1060 return rv; 956 1061 } … … 1034 1139 // FIXME no viac3 available for windows, what to use instead? 1035 1140 else 1036 sAppend = sCPUType; 1141 sAppend = sCPUType; 1037 1142 } else { 1038 1143 sAppend = "none";
Note: See TracChangeset
for help on using the changeset viewer.