未验证 提交 260c8033 编写于 作者: O openharmony_ci 提交者: Gitee

!752 Cherry-pick math function optimization to monthly1018

Merge pull request !752 from guzhihao4/cherry-pick-1671432268
......@@ -91,7 +91,6 @@ math_list = [
"j0",
"j0f",
"j1",
"j1f",
"jn",
"jnf",
"ldexp",
......
......@@ -134,8 +134,6 @@ template("musl_libs") {
cflags_c99fse = [
"-std=c99",
"-nostdinc",
"-ffreestanding",
"-frounding-math",
"-Wa,--noexecstack",
]
......@@ -292,6 +290,7 @@ template("musl_libs") {
configs += [ ":soft_musl_config" ]
cflags = [
"-fPIC",
"-ffreestanding",
"-fno-stack-protector",
]
......@@ -341,6 +340,8 @@ template("musl_libs") {
"src/math/pow.c",
"src/math/powf.c",
"src/math/powl.c",
"src/math/sinf.c",
"src/math/cosf.c",
]
} else if (musl_arch == "aarch64") {
sources_orig -= [
......@@ -358,6 +359,23 @@ template("musl_libs") {
"src/string/strnlen.c",
"src/string/strncmp.c",
"src/math/sincosf.c",
"src/math/sinf.c",
"src/math/cosf.c",
"src/math/cos.c",
"src/math/exp.c",
"src/math/exp2.c",
"src/math/exp2f.c",
"src/math/expf.c",
"src/math/log.c",
"src/math/log10.c",
"src/math/log2.c",
"src/math/log2f.c",
"src/math/logb.c",
"src/math/logf.c",
"src/math/sin.c",
"src/math/sincos.c",
"src/math/pow.c",
"src/math/powf.c",
]
} else if (musl_arch == "x86_64") {
sources_orig -= [ "src/thread/${musl_arch}/__set_thread_area.s" ]
......@@ -382,6 +400,7 @@ template("musl_libs") {
}
if (musl_arch == "arm") {
sources += [
"$OPTRTDIR/math/cosf.c",
"$OPTRTDIR/math/exp2.c",
"$OPTRTDIR/math/exp2f.c",
"$OPTRTDIR/math/exp2f_data.c",
......@@ -398,6 +417,7 @@ template("musl_libs") {
"$OPTRTDIR/math/powf.c",
"$OPTRTDIR/math/sincosf.c",
"$OPTRTDIR/math/sincosf_data.c",
"$OPTRTDIR/math/sinf.c",
"$OPTRTDIR/string/arm/memchr.S",
"$OPTRTDIR/string/arm/memcpy.S",
"$OPTRTDIR/string/arm/memset.S",
......@@ -412,10 +432,6 @@ template("musl_libs") {
"-D__strlen_armv6t2 = strlen",
]
} else if (musl_arch == "aarch64") {
sources += [
"$OPTRTDIR/math/sincosf.c",
"$OPTRTDIR/math/sincosf_data.c",
]
if (defined(ARM_FEATURE_SVE)) {
sources += [
"$OPTRTDIR/string/aarch64/memchr-sve.S",
......@@ -510,6 +526,7 @@ template("musl_libs") {
cflags = [
"-O3",
"-fPIC",
"-ffreestanding",
"-fstack-protector-strong",
]
......@@ -543,6 +560,57 @@ template("musl_libs") {
}
}
source_set("soft_musl_src_optimize") {
sources = []
sources_orig = []
if (musl_arch == "aarch64") {
sources_orig += [
"src/math/cos.c",
"src/math/exp.c",
"src/math/exp2.c",
"src/math/exp2f.c",
"src/math/expf.c",
"src/math/log.c",
"src/math/log10.c",
"src/math/log2.c",
"src/math/log2f.c",
"src/math/logb.c",
"src/math/logf.c",
"src/math/sin.c",
"src/math/sincos.c",
"src/math/pow.c",
"src/math/powf.c",
]
}
foreach(s, sources_orig) {
sources += [ "${target_out_dir}/${musl_ported_dir}/${s}" ]
}
if (musl_arch == "aarch64") {
sources += [
"$OPTRTDIR/math/cosf.c",
"$OPTRTDIR/math/sincosf.c",
"$OPTRTDIR/math/sincosf_data.c",
"$OPTRTDIR/math/sinf.c",
]
}
configs -= musl_inherited_configs
configs += [ ":soft_musl_config" ]
cflags = [
"-mllvm",
"-instcombine-max-iterations=0",
"-ffp-contract=fast",
"-O3",
"-fPIC",
"-fstack-protector-strong",
]
deps = porting_deps
}
source_set("soft_musl_src_nossp") {
sources = []
sources_orig = [
......@@ -572,6 +640,7 @@ template("musl_libs") {
cflags = [
"-O3",
"-fPIC",
"-ffreestanding",
"-fno-stack-protector",
]
......@@ -590,6 +659,7 @@ template("musl_libs") {
configs += [ ":soft_musl_config" ]
cflags = [
"-fPIC",
"-ffreestanding",
"-fno-stack-protector",
]
if (is_asan) {
......@@ -673,6 +743,7 @@ template("musl_libs") {
":soft_musl_ldso",
":soft_musl_src",
":soft_musl_src_nossp",
":soft_musl_src_optimize",
]
deps += dfx_deps
if (!startup_init_with_param_base) {
......@@ -773,6 +844,7 @@ template("musl_libs") {
":soft_musl_ldso",
":soft_musl_src",
":soft_musl_src_nossp",
":soft_musl_src_optimize",
]
deps += dfx_deps
if (!startup_init_with_param_base) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册