Remove neon

This commit is contained in:
Alexey Pelykh 2014-12-21 16:36:06 +02:00
parent 16cc6c7298
commit 24dbcbe8fb
5 changed files with 1 additions and 100 deletions

View file

@ -17,30 +17,5 @@ endif
# } LEGACY
$(info OsmAnd makefiles: $(OSMAND_MAKEFILES))
# Protect from previous builds
ifneq ($(TARGET_ARCH_ABI),armeabi-v7a)
OSMAND_BUILDING_NEON_LIBRARY := false
endif
# OSMAND_FORCE_NEON_SUPPORT is used to force only NEON support on ARMv7a
ifeq ($(OSMAND_FORCE_NEON_SUPPORT),true)
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
OSMAND_BUILDING_NEON_LIBRARY := true
endif
endif
# By default, include makefiles only once
include $(OSMAND_MAKEFILES)
# If we're not asked not to support NEON and not asked to support only NEON ARMv7a, then
# make additional build
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
ifneq ($(OSMAND_SKIP_NEON_SUPPORT),true)
ifneq ($(OSMAND_FORCE_NEON_SUPPORT),true)
OSMAND_BUILDING_NEON_LIBRARY := true
include $(OSMAND_MAKEFILES)
endif
endif
endif

View file

@ -16,22 +16,9 @@ ifneq ($(filter mips,$(OSMAND_ARCHITECTURES_SET)),)
endif
ifneq ($(filter arm,$(OSMAND_ARCHITECTURES_SET)),)
APP_ABI += armeabi armeabi-v7a
OSMAND_SKIP_NEON_SUPPORT := false
OSMAND_FORCE_NEON_SUPPORT := false
else
ifneq ($(filter armv7,$(OSMAND_ARCHITECTURES_SET)),)
APP_ABI += armeabi-v7a
ifeq ($(filter armv7-neon,$(OSMAND_ARCHITECTURES_SET)),)
OSMAND_SKIP_NEON_SUPPORT := true
endif
OSMAND_FORCE_NEON_SUPPORT := false
endif
ifneq ($(filter armv7-neon,$(OSMAND_ARCHITECTURES_SET)),)
APP_ABI += armeabi-v7a
OSMAND_SKIP_NEON_SUPPORT := false
ifeq ($(filter armv7,$(OSMAND_ARCHITECTURES_SET)),)
OSMAND_FORCE_NEON_SUPPORT := true
endif
endif
endif

View file

@ -1,22 +0,0 @@
# CPU Features library should not be built for NEON
ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := cpufeatures_proxy
ifneq ($(OSMAND_USE_PREBUILT),true)
LOCAL_SRC_FILES := \
cpuCheck.cpp
LOCAL_STATIC_LIBRARIES := cpufeatures
include $(BUILD_SHARED_LIBRARY)
else
LOCAL_SRC_FILES := \
../lib/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).so
LOCAL_STATIC_LIBRARIES := cpufeatures
include $(PREBUILT_SHARED_LIBRARY)
endif
$(call import-module,android/cpufeatures)
endif

View file

@ -1,18 +0,0 @@
#include <jni.h>
#include <cpu-features.h>
#ifdef __cplusplus
extern "C" {
#endif
JNIEXPORT jint JNICALL Java_net_osmand_plus_render_NativeOsmandLibrary_getCpuCount( JNIEnv* ienv, jobject obj) {
return android_getCpuCount();
}
JNIEXPORT jboolean JNICALL Java_net_osmand_plus_render_NativeOsmandLibrary_cpuHasNeonSupport( JNIEnv* ienv, jobject obj) {
return (android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM && (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) == ANDROID_CPU_ARM_FEATURE_NEON) ? JNI_TRUE : JNI_FALSE;
}
#ifdef __cplusplus
}
#endif

View file

@ -1,6 +1,5 @@
package net.osmand.plus.render;
import net.osmand.NativeLibrary;
import net.osmand.PlatformUtil;
import net.osmand.plus.OsmandApplication;
@ -27,15 +26,6 @@ public class NativeOsmandLibrary extends NativeLibrary {
return library;
}
}
public static void loadLibrary(String name) {
try {
System.out.println("Loading " + name);
System.loadLibrary(name);
} catch( UnsatisfiedLinkError e ) {
System.err.println("Failed to load '"+name + "':" + e);
throw e;
}
}
public static NativeOsmandLibrary getLibrary(RenderingRulesStorage storage, OsmandApplication ctx) {
if (!isLoaded()) {
@ -45,8 +35,6 @@ public class NativeOsmandLibrary extends NativeLibrary {
try {
log.debug("Loading native gnustl_shared..."); //$NON-NLS-1$
System.loadLibrary("gnustl_shared");
log.debug("Loading native cpufeatures_proxy..."); //$NON-NLS-1$
System.loadLibrary("cpufeatures_proxy");
if (android.os.Build.VERSION.SDK_INT >= 8) {
log.debug("Loading jnigraphics, since Android >= 2.2 ..."); //$NON-NLS-1$
try {
@ -56,9 +44,8 @@ public class NativeOsmandLibrary extends NativeLibrary {
log.debug("Failed to load jnigraphics: " + e); //$NON-NLS-1$
}
}
final String libCpuSuffix = cpuHasNeonSupport() ? "_neon" : "";
log.debug("Loading native libraries..."); //$NON-NLS-1$
loadOldCore(libCpuSuffix);
System.loadLibrary("osmand");
log.debug("Creating NativeOsmandLibrary instance..."); //$NON-NLS-1$
library = new NativeOsmandLibrary(false);
log.debug("Initializing rendering rules storage..."); //$NON-NLS-1$
@ -74,10 +61,6 @@ public class NativeOsmandLibrary extends NativeLibrary {
return library;
}
private static void loadOldCore(final String libCpuSuffix) {
System.loadLibrary("osmand" + libCpuSuffix);
}
public static boolean isSupported()
{
return isNativeSupported != null && isNativeSupported;
@ -116,8 +99,4 @@ public class NativeOsmandLibrary extends NativeLibrary {
private static native RenderingGenerationResult generateRenderingDirect(RenderingContext rc, long searchResultHandler,
Bitmap bitmap, RenderingRuleSearchRequest render);
public static native int getCpuCount();
public static native boolean cpuHasNeonSupport();
}