Skip to content

Commit

Permalink
clean up experimental setup and keep using ffast-math flag
Browse files Browse the repository at this point in the history
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
  • Loading branch information
priteshrnandgaonkar authored and facebook-github-bot committed Apr 4, 2018
1 parent bad262b commit 9550126
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 49 deletions.
14 changes: 0 additions & 14 deletions BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -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(
name = "YogaTests",
srcs = glob(["tests/*.cpp"]),
Expand Down
24 changes: 0 additions & 24 deletions java/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -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(
name = "java",
srcs = glob(["com/facebook/yoga/*.java"]),
Expand All @@ -63,7 +40,6 @@ java_library(
visibility = ["PUBLIC"],
deps = [
":jni",
":jniFastMath",
INFER_ANNOTATIONS_TARGET,
JSR_305_TARGET,
PROGRUARD_ANNOTATIONS_TARGET,
Expand Down
4 changes: 0 additions & 4 deletions java/com/facebook/yoga/YogaConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ public class YogaConfig {
public static int SPACING_TYPE = 1;

static {
if (YogaConstants.shouldUseFastMath) {
SoLoader.loadLibrary("yogafastmath");
} else {
SoLoader.loadLibrary("yoga");
}
}

long mNativePointer;
Expand Down
2 changes: 0 additions & 2 deletions java/com/facebook/yoga/YogaConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ public class YogaConstants {
*/
public static final float UNDEFINED = (float) (10E20);

public static boolean shouldUseFastMath = false;

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,
// the benefit of which
Expand Down
4 changes: 0 additions & 4 deletions java/com/facebook/yoga/YogaNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
public class YogaNode implements Cloneable {

static {
if (YogaConstants.shouldUseFastMath) {
SoLoader.loadLibrary("yogafastmath");
} else {
SoLoader.loadLibrary("yoga");
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion yoga_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ BASE_COMPILER_FLAGS = [
'-Wall',
'-Werror',
'-O3',
'-ffast-math',
]

LIBRARY_COMPILER_FLAGS = BASE_COMPILER_FLAGS + [
Expand Down Expand Up @@ -112,4 +113,3 @@ def prebuilt_jar(*args, **kwargs):

def is_apple_platform():
return True

0 comments on commit 9550126

Please sign in to comment.