Skip to content

Commit 3dea4ee

Browse files
RoseZhang03yuxuanchen1997
authored andcommitted
[libc] Removed __LIBC_CONST_ATTR attribute and updated math.yaml with the new math functions (#99571)
- deleted attribute from fabs function - added math functions from #98972 - also updated statvfs files so that it can be generated
1 parent 163bce8 commit 3dea4ee

File tree

5 files changed

+69
-8
lines changed

5 files changed

+69
-8
lines changed

libc/config/linux/api.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,5 +267,5 @@ def SearchAPI : PublicAPI<"search.h"> {
267267
}
268268

269269
def SysStatvfsAPI : PublicAPI<"sys/statvfs.h"> {
270-
let Types = ["fsblkcnt_t", "fsfilcnt_t", "struct statvfs"];
270+
let Types = ["struct statvfs"];
271271
}

libc/config/linux/x86_64/headers.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ set(TARGET_PUBLIC_HEADERS
4545
libc.include.sys_select
4646
libc.include.sys_socket
4747
libc.include.sys_stat
48-
# statvfs is broken, will uncomment once it's fixed.
49-
# libc.include.sys_statvfs
48+
libc.include.sys_statvfs
5049
libc.include.sys_syscall
5150
libc.include.sys_time
5251
libc.include.sys_types

libc/newhdrgen/yaml/math.yaml

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ functions:
6464
return_type: double
6565
arguments:
6666
- type: double
67-
attributes:
68-
- __LIBC_CONST_ATTR
6967
- name: fabsf
7068
standards:
7169
- stdc
@@ -364,6 +362,20 @@ functions:
364362
arguments:
365363
- type: double
366364
- type: double
365+
- name: fmull
366+
standards:
367+
- stdc
368+
return_type: float
369+
arguments:
370+
- type: long double
371+
- type: long double
372+
- name: dmull
373+
standards:
374+
- stdc
375+
return_type: double
376+
arguments:
377+
- type: long double
378+
- type: long double
367379
- name: frexp
368380
standards:
369381
- stdc
@@ -1323,6 +1335,30 @@ functions:
13231335
- type: long double
13241336
- type: long double
13251337
guard: LIBC_TYPES_HAS_FLOAT16
1338+
- name: f16mul
1339+
standards:
1340+
- llvm_libc_ext
1341+
return_type: _Float16
1342+
arguments:
1343+
- type: double
1344+
- type: double
1345+
guard: LIBC_TYPES_HAS_FLOAT16
1346+
- name: f16mulf
1347+
standards:
1348+
- llvm_libc_ext
1349+
return_type: _Float16
1350+
arguments:
1351+
- type: float
1352+
- type: float
1353+
guard: LIBC_TYPES_HAS_FLOAT16
1354+
- name: f16mull
1355+
standards:
1356+
- llvm_libc_ext
1357+
return_type: _Float16
1358+
arguments:
1359+
- type: long double
1360+
- type: long double
1361+
guard: LIBC_TYPES_HAS_FLOAT16
13261362
- name: f16sqrt
13271363
standards:
13281364
- llvm_libc_ext
@@ -1756,6 +1792,14 @@ functions:
17561792
- type: float128
17571793
- type: float128
17581794
guard: LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128
1795+
- name: f16mulf128
1796+
standards:
1797+
- stdc
1798+
return_type: _Float16
1799+
arguments:
1800+
- type: float128
1801+
- type: float128
1802+
guard: LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128
17591803
- name: f16sqrtf128
17601804
standards:
17611805
- llvm_libc_ext
@@ -1896,6 +1940,22 @@ functions:
18961940
- type: float128
18971941
- type: float128
18981942
guard: LIBC_TYPES_HAS_FLOAT128
1943+
- name: fmulf128
1944+
standards:
1945+
- llvm_libc_ext
1946+
return_type: float
1947+
arguments:
1948+
- type: float128
1949+
- type: float128
1950+
guard: LIBC_TYPES_HAS_FLOAT128
1951+
- name: dmulf128
1952+
standards:
1953+
- llvm_libc_ext
1954+
return_type: double
1955+
arguments:
1956+
- type: float128
1957+
- type: float128
1958+
guard: LIBC_TYPES_HAS_FLOAT128
18991959
- name: frexpf128
19001960
standards:
19011961
- stdc

libc/newhdrgen/yaml/sys/statvfs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ header: sys-statvfs.h
22
macros: []
33
types:
44
- type_name: struct_statvfs
5+
- type_name: fsblkcnt_t
6+
- type_name: fsfilcnt_t
57
enums: []
68
objects: []
79
functions:

libc/src/sys/statvfs/linux/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ add_header_library(
88
libc.src.__support.common
99
libc.src.__support.CPP.optional
1010
libc.include.sys_syscall
11-
libc.include.llvm-libc-types.struct_statvfs
11+
libc.include.sys_statvfs
1212
)
1313

1414
add_entrypoint_object(
@@ -19,7 +19,7 @@ add_entrypoint_object(
1919
../statvfs.h
2020
DEPENDS
2121
libc.src.__support.libc_assert
22-
libc.include.llvm-libc-types.struct_statvfs
22+
libc.include.sys_statvfs
2323
.statfs_utils
2424
)
2525

@@ -31,7 +31,7 @@ add_entrypoint_object(
3131
../fstatvfs.h
3232
DEPENDS
3333
libc.src.__support.libc_assert
34-
libc.include.llvm-libc-types.struct_statvfs
34+
libc.include.sys_statvfs
3535
.statfs_utils
3636
)
3737

0 commit comments

Comments
 (0)