clean up experimental setup and keep using ffast-math flag

Summary: Remove experimental setup of fast-math and add `-ffast-math` as a compiler flag for yoga.

Reviewed By: emilsjolander

Differential Revision: D7414228

fbshipit-source-id: 320e1b1953f6af867b13e617af7872eb8999160e
This commit is contained in:
Pritesh Nandgaonkar
2018-04-04 08:17:04 -07:00
committed by Facebook Github Bot
parent bad262b961
commit 9550126f76
6 changed files with 1 additions and 49 deletions

14
BUCK
View File

@@ -32,20 +32,6 @@ cxx_library(
], ],
) )
cxx_library(
name = "yogafastmath",
srcs = glob(["yoga/*.cpp"]),
header_namespace = "",
exported_headers = subdir_glob([("", "yoga/*.h")]),
compiler_flags = COMPILER_FLAGS + ["-ffast-math"],
soname = "libyogafastmathcore.$(ext)",
tests = [":YogaTests"],
visibility = ["PUBLIC"],
deps = [
yoga_dep("lib/fb:ndklog"),
],
)
cxx_test( cxx_test(
name = "YogaTests", name = "YogaTests",
srcs = glob(["tests/*.cpp"]), srcs = glob(["tests/*.cpp"]),

View File

@@ -28,29 +28,6 @@ cxx_library(
], ],
) )
cxx_library(
name = "jniFastMath",
srcs = glob(["jni/*.cpp"]),
header_namespace = "",
compiler_flags = [
"-fno-omit-frame-pointer",
"-fexceptions",
"-fPIC",
"-Wall",
"-Werror",
"-O3",
"-std=c++11",
],
platforms = ANDROID,
soname = "libyogafastmath.$(ext)",
visibility = ["PUBLIC"],
deps = [
FBJNI_TARGET,
JNI_TARGET,
yoga_dep(":yogafastmath"),
],
)
java_library( java_library(
name = "java", name = "java",
srcs = glob(["com/facebook/yoga/*.java"]), srcs = glob(["com/facebook/yoga/*.java"]),
@@ -63,7 +40,6 @@ java_library(
visibility = ["PUBLIC"], visibility = ["PUBLIC"],
deps = [ deps = [
":jni", ":jni",
":jniFastMath",
INFER_ANNOTATIONS_TARGET, INFER_ANNOTATIONS_TARGET,
JSR_305_TARGET, JSR_305_TARGET,
PROGRUARD_ANNOTATIONS_TARGET, PROGRUARD_ANNOTATIONS_TARGET,

View File

@@ -16,11 +16,7 @@ public class YogaConfig {
public static int SPACING_TYPE = 1; public static int SPACING_TYPE = 1;
static { static {
if (YogaConstants.shouldUseFastMath) {
SoLoader.loadLibrary("yogafastmath");
} else {
SoLoader.loadLibrary("yoga"); SoLoader.loadLibrary("yoga");
}
} }
long mNativePointer; long mNativePointer;

View File

@@ -18,8 +18,6 @@ public class YogaConstants {
*/ */
public static final float UNDEFINED = (float) (10E20); public static final float UNDEFINED = (float) (10E20);
public static boolean shouldUseFastMath = false;
public static boolean isUndefined(float value) { public static boolean isUndefined(float value) {
// Value of a float in the case of it being not defined is 10.1E20. Earlier it used to be NAN, // Value of a float in the case of it being not defined is 10.1E20. Earlier it used to be NAN,
// the benefit of which // the benefit of which

View File

@@ -17,11 +17,7 @@ import javax.annotation.Nullable;
public class YogaNode implements Cloneable { public class YogaNode implements Cloneable {
static { static {
if (YogaConstants.shouldUseFastMath) {
SoLoader.loadLibrary("yogafastmath");
} else {
SoLoader.loadLibrary("yoga"); SoLoader.loadLibrary("yoga");
}
} }
/** /**

View File

@@ -32,6 +32,7 @@ BASE_COMPILER_FLAGS = [
'-Wall', '-Wall',
'-Werror', '-Werror',
'-O3', '-O3',
'-ffast-math',
] ]
LIBRARY_COMPILER_FLAGS = BASE_COMPILER_FLAGS + [ LIBRARY_COMPILER_FLAGS = BASE_COMPILER_FLAGS + [
@@ -112,4 +113,3 @@ def prebuilt_jar(*args, **kwargs):
def is_apple_platform(): def is_apple_platform():
return True return True