Skip to content

[libc] Removed __LIBC_CONST_ATTR attribute and updated math.yaml with the new math functions #99571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libc/config/linux/api.td
Original file line number Diff line number Diff line change
Expand Up @@ -267,5 +267,5 @@ def SearchAPI : PublicAPI<"search.h"> {
}

def SysStatvfsAPI : PublicAPI<"sys/statvfs.h"> {
let Types = ["fsblkcnt_t", "fsfilcnt_t", "struct statvfs"];
let Types = ["struct statvfs"];
}
3 changes: 1 addition & 2 deletions libc/config/linux/x86_64/headers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ set(TARGET_PUBLIC_HEADERS
libc.include.sys_select
libc.include.sys_socket
libc.include.sys_stat
# statvfs is broken, will uncomment once it's fixed.
# libc.include.sys_statvfs
libc.include.sys_statvfs
libc.include.sys_syscall
libc.include.sys_time
libc.include.sys_types
Expand Down
64 changes: 62 additions & 2 deletions libc/newhdrgen/yaml/math.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ functions:
return_type: double
arguments:
- type: double
attributes:
- __LIBC_CONST_ATTR
- name: fabsf
standards:
- stdc
Expand Down Expand Up @@ -364,6 +362,20 @@ functions:
arguments:
- type: double
- type: double
- name: fmull
standards:
- stdc
return_type: float
arguments:
- type: long double
- type: long double
- name: dmull
standards:
- stdc
return_type: double
arguments:
- type: long double
- type: long double
- name: frexp
standards:
- stdc
Expand Down Expand Up @@ -1323,6 +1335,30 @@ functions:
- type: long double
- type: long double
guard: LIBC_TYPES_HAS_FLOAT16
- name: f16mul
standards:
- llvm_libc_ext
return_type: _Float16
arguments:
- type: double
- type: double
guard: LIBC_TYPES_HAS_FLOAT16
- name: f16mulf
standards:
- llvm_libc_ext
return_type: _Float16
arguments:
- type: float
- type: float
guard: LIBC_TYPES_HAS_FLOAT16
- name: f16mull
standards:
- llvm_libc_ext
return_type: _Float16
arguments:
- type: long double
- type: long double
guard: LIBC_TYPES_HAS_FLOAT16
- name: f16sqrt
standards:
- llvm_libc_ext
Expand Down Expand Up @@ -1756,6 +1792,14 @@ functions:
- type: float128
- type: float128
guard: LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128
- name: f16mulf128
standards:
- stdc
return_type: _Float16
arguments:
- type: float128
- type: float128
guard: LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128
- name: f16sqrtf128
standards:
- llvm_libc_ext
Expand Down Expand Up @@ -1896,6 +1940,22 @@ functions:
- type: float128
- type: float128
guard: LIBC_TYPES_HAS_FLOAT128
- name: fmulf128
standards:
- llvm_libc_ext
return_type: float
arguments:
- type: float128
- type: float128
guard: LIBC_TYPES_HAS_FLOAT128
- name: dmulf128
standards:
- llvm_libc_ext
return_type: double
arguments:
- type: float128
- type: float128
guard: LIBC_TYPES_HAS_FLOAT128
- name: frexpf128
standards:
- stdc
Expand Down
2 changes: 2 additions & 0 deletions libc/newhdrgen/yaml/sys/statvfs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ header: sys-statvfs.h
macros: []
types:
- type_name: struct_statvfs
- type_name: fsblkcnt_t
- type_name: fsfilcnt_t
enums: []
objects: []
functions:
Expand Down
6 changes: 3 additions & 3 deletions libc/src/sys/statvfs/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ add_header_library(
libc.src.__support.common
libc.src.__support.CPP.optional
libc.include.sys_syscall
libc.include.llvm-libc-types.struct_statvfs
libc.include.sys_statvfs
)

add_entrypoint_object(
Expand All @@ -19,7 +19,7 @@ add_entrypoint_object(
../statvfs.h
DEPENDS
libc.src.__support.libc_assert
libc.include.llvm-libc-types.struct_statvfs
libc.include.sys_statvfs
.statfs_utils
)

Expand All @@ -31,7 +31,7 @@ add_entrypoint_object(
../fstatvfs.h
DEPENDS
libc.src.__support.libc_assert
libc.include.llvm-libc-types.struct_statvfs
libc.include.sys_statvfs
.statfs_utils
)

Loading