Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Musl
提交
ec8b0dcc
T
Third Party Musl
项目概览
OpenHarmony
/
Third Party Musl
1 年多 前同步成功
通知
37
Star
125
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Musl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ec8b0dcc
编写于
12月 16, 2021
作者:
O
openharmony_ci
提交者:
Gitee
12月 16, 2021
浏览文件
操作
浏览文件
下载
差异文件
!174 M核C库新增接口
Merge pull request !174 from Zhaotianyu/1214musl_add
上级
133e9801
b3d3a305
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
130 addition
and
4 deletion
+130
-4
porting/liteos_m/kernel/BUILD.gn
porting/liteos_m/kernel/BUILD.gn
+15
-4
porting/liteos_m/kernel/src/math/__math_divzero.c
porting/liteos_m/kernel/src/math/__math_divzero.c
+6
-0
porting/liteos_m/kernel/src/math/__math_divzerof.c
porting/liteos_m/kernel/src/math/__math_divzerof.c
+6
-0
porting/liteos_m/kernel/src/math/__math_invalid.c
porting/liteos_m/kernel/src/math/__math_invalid.c
+6
-0
porting/liteos_m/kernel/src/math/__math_invalidf.c
porting/liteos_m/kernel/src/math/__math_invalidf.c
+6
-0
porting/liteos_m/kernel/src/math/__math_oflow.c
porting/liteos_m/kernel/src/math/__math_oflow.c
+6
-0
porting/liteos_m/kernel/src/math/__math_oflowf.c
porting/liteos_m/kernel/src/math/__math_oflowf.c
+6
-0
porting/liteos_m/kernel/src/math/__math_uflow.c
porting/liteos_m/kernel/src/math/__math_uflow.c
+6
-0
porting/liteos_m/kernel/src/math/__math_uflowf.c
porting/liteos_m/kernel/src/math/__math_uflowf.c
+6
-0
porting/liteos_m/kernel/src/math/__math_xflow.c
porting/liteos_m/kernel/src/math/__math_xflow.c
+6
-0
porting/liteos_m/kernel/src/math/__math_xflowf.c
porting/liteos_m/kernel/src/math/__math_xflowf.c
+6
-0
porting/liteos_m/kernel/src/math/arm/fabs.c
porting/liteos_m/kernel/src/math/arm/fabs.c
+15
-0
porting/liteos_m/kernel/src/math/fabs.c
porting/liteos_m/kernel/src/math/fabs.c
+9
-0
porting/liteos_m/kernel/src/math/floor.c
porting/liteos_m/kernel/src/math/floor.c
+31
-0
未找到文件。
porting/liteos_m/kernel/BUILD.gn
浏览文件 @
ec8b0dcc
...
...
@@ -59,6 +59,7 @@ static_library(libc) {
"src/internal/shgetc.c",
"src/locale/__lctrans.c",
"src/locale/c_locale.c",
"src/locale/iconv.c",
"src/locale/langinfo.c",
"src/misc/dirname.c",
"src/misc/realpath.c",
...
...
@@ -110,21 +111,19 @@ static_library(libc) {
"src/stdio/stderr.c",
"src/stdio/stdin.c",
"src/stdio/stdout.c",
"src/stdio/ungetc.c",
"src/stdio/vfprintf.c",
"src/stdio/vsnprintf.c",
"src/stdio/vsprintf.c",
"src/stdlib/abs.c",
"src/stdlib/atof.c",
"src/stdlib/atoi.c",
#"src/stdlib/strtol.c",
"src/locale/iconv.c",
"src/stdio/ungetc.c",
"src/stdlib/atol.c",
"src/stdlib/atoll.c",
"src/stdlib/bsearch.c",
"src/stdlib/llabs.c",
"src/stdlib/strtod.c",
"src/stdlib/strtol.c",
"src/string/memchr.c",
"src/string/memcmp.c",
"src/string/memcpy.c",
...
...
@@ -188,9 +187,21 @@ static_library(libm) {
sources = [
"src/math/__fpclassify.c",
"src/math/__fpclassifyl.c",
"src/math/__math_divzero.c",
"src/math/__math_divzerof.c",
"src/math/__math_invalid.c",
"src/math/__math_invalidf.c",
"src/math/__math_oflow.c",
"src/math/__math_oflowf.c",
"src/math/__math_uflow.c",
"src/math/__math_uflowf.c",
"src/math/__math_xflow.c",
"src/math/__math_xflowf.c",
"src/math/__signbit.c",
"src/math/__signbitl.c",
"src/math/arm/fabs.c",
"src/math/exp_data.c",
"src/math/floor.c",
"src/math/frexp.c",
"src/math/frexpl.c",
"src/math/log.c",
...
...
porting/liteos_m/kernel/src/math/__math_divzero.c
0 → 100644
浏览文件 @
ec8b0dcc
#include "libm.h"
double
__math_divzero
(
uint32_t
sign
)
{
return
fp_barrier
(
sign
?
-
1
.
0
:
1
.
0
)
/
0
.
0
;
}
porting/liteos_m/kernel/src/math/__math_divzerof.c
0 → 100644
浏览文件 @
ec8b0dcc
#include "libm.h"
float
__math_divzerof
(
uint32_t
sign
)
{
return
fp_barrierf
(
sign
?
-
1
.
0
f
:
1
.
0
f
)
/
0
.
0
f
;
}
porting/liteos_m/kernel/src/math/__math_invalid.c
0 → 100644
浏览文件 @
ec8b0dcc
#include "libm.h"
double
__math_invalid
(
double
x
)
{
return
(
x
-
x
)
/
(
x
-
x
);
}
porting/liteos_m/kernel/src/math/__math_invalidf.c
0 → 100644
浏览文件 @
ec8b0dcc
#include "libm.h"
float
__math_invalidf
(
float
x
)
{
return
(
x
-
x
)
/
(
x
-
x
);
}
porting/liteos_m/kernel/src/math/__math_oflow.c
0 → 100644
浏览文件 @
ec8b0dcc
#include "libm.h"
double
__math_oflow
(
uint32_t
sign
)
{
return
__math_xflow
(
sign
,
0x1
p769
);
}
porting/liteos_m/kernel/src/math/__math_oflowf.c
0 → 100644
浏览文件 @
ec8b0dcc
#include "libm.h"
float
__math_oflowf
(
uint32_t
sign
)
{
return
__math_xflowf
(
sign
,
0x1
p97f
);
}
porting/liteos_m/kernel/src/math/__math_uflow.c
0 → 100644
浏览文件 @
ec8b0dcc
#include "libm.h"
double
__math_uflow
(
uint32_t
sign
)
{
return
__math_xflow
(
sign
,
0x1
p
-
767
);
}
porting/liteos_m/kernel/src/math/__math_uflowf.c
0 → 100644
浏览文件 @
ec8b0dcc
#include "libm.h"
float
__math_uflowf
(
uint32_t
sign
)
{
return
__math_xflowf
(
sign
,
0x1
p
-
95
f
);
}
porting/liteos_m/kernel/src/math/__math_xflow.c
0 → 100644
浏览文件 @
ec8b0dcc
#include "libm.h"
double
__math_xflow
(
uint32_t
sign
,
double
y
)
{
return
eval_as_double
(
fp_barrier
(
sign
?
-
y
:
y
)
*
y
);
}
porting/liteos_m/kernel/src/math/__math_xflowf.c
0 → 100644
浏览文件 @
ec8b0dcc
#include "libm.h"
float
__math_xflowf
(
uint32_t
sign
,
float
y
)
{
return
eval_as_float
(
fp_barrierf
(
sign
?
-
y
:
y
)
*
y
);
}
porting/liteos_m/kernel/src/math/arm/fabs.c
0 → 100644
浏览文件 @
ec8b0dcc
#include <math.h>
#if __ARM_PCS_VFP
double
fabs
(
double
x
)
{
__asm__
(
"vabs.f64 %P0, %P1"
:
"=w"
(
x
)
:
"w"
(
x
));
return
x
;
}
#else
#include "../fabs.c"
#endif
porting/liteos_m/kernel/src/math/fabs.c
0 → 100644
浏览文件 @
ec8b0dcc
#include <math.h>
#include <stdint.h>
double
fabs
(
double
x
)
{
union
{
double
f
;
uint64_t
i
;}
u
=
{
x
};
u
.
i
&=
-
1ULL
/
2
;
return
u
.
f
;
}
porting/liteos_m/kernel/src/math/floor.c
0 → 100644
浏览文件 @
ec8b0dcc
#include "libm.h"
#if FLT_EVAL_METHOD==0 || FLT_EVAL_METHOD==1
#define EPS DBL_EPSILON
#elif FLT_EVAL_METHOD==2
#define EPS LDBL_EPSILON
#endif
static
const
double_t
toint
=
1
/
EPS
;
double
floor
(
double
x
)
{
union
{
double
f
;
uint64_t
i
;}
u
=
{
x
};
int
e
=
u
.
i
>>
52
&
0x7ff
;
double_t
y
;
if
(
e
>=
0x3ff
+
52
||
x
==
0
)
return
x
;
/* y = int(x) - x, where int(x) is an integer neighbor of x */
if
(
u
.
i
>>
63
)
y
=
x
-
toint
+
toint
-
x
;
else
y
=
x
+
toint
-
toint
-
x
;
/* special case because of non-nearest rounding modes */
if
(
e
<=
0x3ff
-
1
)
{
FORCE_EVAL
(
y
);
return
u
.
i
>>
63
?
-
1
:
0
;
}
if
(
y
>
0
)
return
x
+
y
-
1
;
return
x
+
y
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录