[libc-commits] [libc] 4a1fdeb - [libc] reordered Function class parameters and moved yaml files (#97329)
via libc-commits
libc-commits at lists.llvm.org
Wed Jul 3 14:40:24 PDT 2024
Author: RoseZhang03
Date: 2024-07-03T21:40:20Z
New Revision: 4a1fdeb04d10f5562687568ea8c494b3ef46c587
URL: https://github.com/llvm/llvm-project/commit/4a1fdeb04d10f5562687568ea8c494b3ef46c587
DIFF: https://github.com/llvm/llvm-project/commit/4a1fdeb04d10f5562687568ea8c494b3ef46c587.diff
LOG: [libc] reordered Function class parameters and moved yaml files (#97329)
Reordered Function class parameter "standards" to make more logical
sense and to match the ordering in the add_function function.
Deleted the yaml_combined folder and moved contained files to the yaml
folder.
Updated math.yaml file with the recently added math functions in spec.td
Added:
libc/newhdrgen/yaml/ctype.yaml
libc/newhdrgen/yaml/fenv.yaml
libc/newhdrgen/yaml/math.yaml
libc/newhdrgen/yaml/pthread.yaml
libc/newhdrgen/yaml/sched.yaml
libc/newhdrgen/yaml/signal.yaml
libc/newhdrgen/yaml/stdfix.yaml
libc/newhdrgen/yaml/stdio.yaml
libc/newhdrgen/yaml/stdlib.yaml
libc/newhdrgen/yaml/string.yaml
libc/newhdrgen/yaml/strings.yaml
libc/newhdrgen/yaml/sys_mman.yaml
libc/newhdrgen/yaml/sys_wait.yaml
libc/newhdrgen/yaml/time.yaml
Modified:
libc/newhdrgen/yaml/sys_auxv.yaml
libc/newhdrgen/yaml/sys_types.yaml
Removed:
libc/newhdrgen/yaml_combined/ctype.yaml
libc/newhdrgen/yaml_combined/fenv.yaml
libc/newhdrgen/yaml_combined/math.yaml
libc/newhdrgen/yaml_combined/pthread.yaml
libc/newhdrgen/yaml_combined/sched.yaml
libc/newhdrgen/yaml_combined/signal.yaml
libc/newhdrgen/yaml_combined/stdfix.yaml
libc/newhdrgen/yaml_combined/stdio.yaml
libc/newhdrgen/yaml_combined/stdlib.yaml
libc/newhdrgen/yaml_combined/string.yaml
libc/newhdrgen/yaml_combined/strings.yaml
libc/newhdrgen/yaml_combined/sys_mman.yaml
libc/newhdrgen/yaml_combined/sys_wait.yaml
libc/newhdrgen/yaml_combined/time.yaml
################################################################################
diff --git a/libc/newhdrgen/yaml_combined/ctype.yaml b/libc/newhdrgen/yaml/ctype.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/ctype.yaml
rename to libc/newhdrgen/yaml/ctype.yaml
diff --git a/libc/newhdrgen/yaml_combined/fenv.yaml b/libc/newhdrgen/yaml/fenv.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/fenv.yaml
rename to libc/newhdrgen/yaml/fenv.yaml
diff --git a/libc/newhdrgen/yaml_combined/math.yaml b/libc/newhdrgen/yaml/math.yaml
similarity index 89%
rename from libc/newhdrgen/yaml_combined/math.yaml
rename to libc/newhdrgen/yaml/math.yaml
index dbb1e6ec63030..18a49ad1c62c4 100644
--- a/libc/newhdrgen/yaml_combined/math.yaml
+++ b/libc/newhdrgen/yaml/math.yaml
@@ -563,6 +563,15 @@ functions:
- type: float
- type: float
- type: float
+ - name: f16fma
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: double
+ - type: double
+ - type: double
+ guard: LIBC_TYPES_HAS_FLOAT16
- name: f16fmaf
standards:
- stdc
@@ -572,6 +581,24 @@ functions:
- type: float
- type: float
guard: LIBC_TYPES_HAS_FLOAT16
+ - name: f16fmal
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: long double
+ - type: long double
+ - type: long double
+ guard: LIBC_TYPES_HAS_FLOAT16
+ - name: f16fmaf128
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: float128
+ - type: float128
+ - type: float128
+ guard: LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128
- name: fmod
standards:
- stdc
@@ -913,6 +940,14 @@ functions:
arguments:
- type: long double
- type: int
+ - name: ldexpf16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ - type: int
+ guard: LIBC_TYPES_HAS_FLOAT16
- name: ldexpf128
standards:
- stdc
@@ -1761,6 +1796,14 @@ functions:
return_type: float
arguments:
- type: float
+ - name: scalblnf16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ - type: long
+ guard: LIBC_TYPES_HAS_FLOAT16
- name: scalbn
standards:
- stdc
@@ -1782,6 +1825,13 @@ functions:
arguments:
- type: long double
- type: int
+ - name: scalbnf16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ - type: int
- name: scalbnf128
standards:
- stdc
@@ -1875,10 +1925,150 @@ functions:
- type: _Float16 *
- type: _Float16 *
guard: LIBC_TYPES_HAS_FLOAT16
- - name: f16sqrtf
+ - name: getpayloadf16
standards:
- stdc
return_type: _Float16
+ arguments:
+ - type: _Float16 *
+ guard: LIBC_TYPES_HAS_FLOAT16
+ - name: setpayloadf16
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: _Float16 *
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
+ - name: setpayloadsigf16
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: _Float16 *
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
+ - name: f16addf128
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: float128
+ - type: float128
+ guard: LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128
+ - name: f16subf128
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: float128
+ - type: float128
+ guard: LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128
+ - name: f16sqrtf
+ standards:
+ - llvm_libc_ext
+ return_type: _Float16
arguments:
- type: float
guard: LIBC_TYPES_HAS_FLOAT16
+ - name: f16sqrtf128
+ standards:
+ - llvm_libc_ext
+ return_type: _Float16
+ arguments:
+ - type: float128
+ guard: LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128
+ - name: f16add
+ standards:
+ - llvm_libc_ext
+ return_type: _Float16
+ arguments:
+ - type: double
+ - type: double
+ guard: LIBC_TYPES_HAS_FLOAT16
+ - name: f16addf
+ standards:
+ - llvm_libc_ext
+ return_type: _Float16
+ arguments:
+ - type: float
+ - type: float
+ guard: LIBC_TYPES_HAS_FLOAT16
+ - name: f16addl
+ standards:
+ - llvm_libc_ext
+ return_type: _Float16
+ arguments:
+ - type: long double
+ - type: long double
+ guard: LIBC_TYPES_HAS_FLOAT16
+ - name: f16sub
+ standards:
+ - llvm_libc_ext
+ return_type: _Float16
+ arguments:
+ - type: double
+ - type: double
+ guard: LIBC_TYPES_HAS_FLOAT16
+ - name: f16subf
+ standards:
+ - llvm_libc_ext
+ return_type: _Float16
+ arguments:
+ - type: float
+ - type: float
+ guard: LIBC_TYPES_HAS_FLOAT16
+ - name: f16subl
+ standards:
+ - llvm_libc_ext
+ return_type: _Float16
+ arguments:
+ - type: long double
+ - type: long double
+ guard: LIBC_TYPES_HAS_FLOAT16
+ - name: f16div
+ standards:
+ - llvm_libc_ext
+ return_type: _Float16
+ arguments:
+ - type: double
+ - type: double
+ guard: LIBC_TYPES_HAS_FLOAT16
+ - name: f16divf
+ standards:
+ - llvm_libc_ext
+ return_type: _Float16
+ arguments:
+ - type: float
+ - type: float
+ guard: LIBC_TYPES_HAS_FLOAT16
+ - name: f16divf128
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: float128
+ - type: float128
+ guard: LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128
+ - name: f16divl
+ 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
+ return_type: _Float16
+ arguments:
+ - type: double
+ guard: LIBC_TYPES_HAS_FLOAT16
+ - name: f16sqrtl
+ standards:
+ - llvm_libc_ext
+ return_type: _Float16
+ arguments:
+ - type: long double
+ guard: LIBC_TYPES_HAS_FLOAT16
diff --git a/libc/newhdrgen/yaml_combined/pthread.yaml b/libc/newhdrgen/yaml/pthread.yaml
similarity index 87%
rename from libc/newhdrgen/yaml_combined/pthread.yaml
rename to libc/newhdrgen/yaml/pthread.yaml
index 5a1ede32e53e3..9ffcf454035ff 100644
--- a/libc/newhdrgen/yaml_combined/pthread.yaml
+++ b/libc/newhdrgen/yaml/pthread.yaml
@@ -366,3 +366,51 @@ functions:
arguments:
- type: pthread_key_t
- type: const void *
+ - name: pthread_rwlock_init
+ standards: POSIX
+ return_type: int
+ arguments:
+ - type: pthread_rwlock_t *
+ - type: const pthread_rwlockattr_t *__restrict
+ - name: pthread_rwlock_tryrdlock
+ standards: POSIX
+ return_type: int
+ arguments:
+ - type: pthread_rwlock_t *
+ - name: pthread_rwlock_trywrlock
+ standards: POSIX
+ return_type: int
+ arguments:
+ - type: pthread_rwlock_t *
+ - name: pthread_rwlock_timedrdlock
+ standards: POSIX
+ return_type: int
+ arguments:
+ - type: pthread_rwlock_t *__restrict
+ - type: const struct timespec *__restrict
+ - name: pthread_rwlock_timedwrlock
+ standards: POSIX
+ return_type: int
+ arguments:
+ - type: pthread_rwlock_t *__restrict
+ - type: const struct timespec *__restrict
+ - name: pthread_rwlock_rdlock
+ standards: POSIX
+ return_type: int
+ arguments:
+ - type: pthread_rwlock_t *
+ - name: pthread_rwlock_wrlock
+ standards: POSIX
+ return_type: int
+ arguments:
+ - type: pthread_rwlock_t *
+ - name: pthread_rwlock_unlock
+ standards: POSIX
+ return_type: int
+ arguments:
+ - type: pthread_rwlock_t *
+ - name: pthread_rwlock_destroy
+ standards: POSIX
+ return_type: int
+ arguments:
+ - type: pthread_rwlock_t *
diff --git a/libc/newhdrgen/yaml_combined/sched.yaml b/libc/newhdrgen/yaml/sched.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/sched.yaml
rename to libc/newhdrgen/yaml/sched.yaml
diff --git a/libc/newhdrgen/yaml_combined/signal.yaml b/libc/newhdrgen/yaml/signal.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/signal.yaml
rename to libc/newhdrgen/yaml/signal.yaml
diff --git a/libc/newhdrgen/yaml_combined/stdfix.yaml b/libc/newhdrgen/yaml/stdfix.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/stdfix.yaml
rename to libc/newhdrgen/yaml/stdfix.yaml
diff --git a/libc/newhdrgen/yaml_combined/stdio.yaml b/libc/newhdrgen/yaml/stdio.yaml
similarity index 98%
rename from libc/newhdrgen/yaml_combined/stdio.yaml
rename to libc/newhdrgen/yaml/stdio.yaml
index 928a8d5228c21..2fdc772da122c 100644
--- a/libc/newhdrgen/yaml_combined/stdio.yaml
+++ b/libc/newhdrgen/yaml/stdio.yaml
@@ -130,6 +130,13 @@ functions:
return_type: int
arguments:
- type: FILE *
+ - name: fdopen
+ standards:
+ - POSIX
+ return_type: FILE *
+ arguments:
+ - type: int
+ - type: const char *
- name: clearerr
standards:
- stdc
diff --git a/libc/newhdrgen/yaml_combined/stdlib.yaml b/libc/newhdrgen/yaml/stdlib.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/stdlib.yaml
rename to libc/newhdrgen/yaml/stdlib.yaml
diff --git a/libc/newhdrgen/yaml_combined/string.yaml b/libc/newhdrgen/yaml/string.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/string.yaml
rename to libc/newhdrgen/yaml/string.yaml
diff --git a/libc/newhdrgen/yaml_combined/strings.yaml b/libc/newhdrgen/yaml/strings.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/strings.yaml
rename to libc/newhdrgen/yaml/strings.yaml
diff --git a/libc/newhdrgen/yaml/sys_auxv.yaml b/libc/newhdrgen/yaml/sys_auxv.yaml
index beea1d8b5f09f..bbf756a1ffe6a 100644
--- a/libc/newhdrgen/yaml/sys_auxv.yaml
+++ b/libc/newhdrgen/yaml/sys_auxv.yaml
@@ -5,4 +5,10 @@ macros: []
types: []
enums: []
objects: []
-functions: []
+functions:
+ - name: getauxval
+ standards:
+ - GNUExtensions
+ return_type: unsigned long
+ arguments:
+ - type: unsigned long
diff --git a/libc/newhdrgen/yaml_combined/sys_mman.yaml b/libc/newhdrgen/yaml/sys_mman.yaml
similarity index 97%
rename from libc/newhdrgen/yaml_combined/sys_mman.yaml
rename to libc/newhdrgen/yaml/sys_mman.yaml
index 7b858db2de11a..16a6463b0917d 100644
--- a/libc/newhdrgen/yaml_combined/sys_mman.yaml
+++ b/libc/newhdrgen/yaml/sys_mman.yaml
@@ -1,8 +1,6 @@
-#known as sys/mman in POSIX
header: sys-mman.h
standards: POSIX
macros: []
-macros: []
types:
- type_name: mode_t
- type_name: size_t
diff --git a/libc/newhdrgen/yaml/sys_types.yaml b/libc/newhdrgen/yaml/sys_types.yaml
index 6b08254a7fab1..20cf9bcd39da3 100644
--- a/libc/newhdrgen/yaml/sys_types.yaml
+++ b/libc/newhdrgen/yaml/sys_types.yaml
@@ -26,5 +26,5 @@ types:
- type_name: pthread_key_t
- type_name: pthread_condattr_t
enums: []
-functions: []
objects: []
+functions: []
diff --git a/libc/newhdrgen/yaml_combined/sys_wait.yaml b/libc/newhdrgen/yaml/sys_wait.yaml
similarity index 94%
rename from libc/newhdrgen/yaml_combined/sys_wait.yaml
rename to libc/newhdrgen/yaml/sys_wait.yaml
index 56a6066e925d6..2f2f70d0e9745 100644
--- a/libc/newhdrgen/yaml_combined/sys_wait.yaml
+++ b/libc/newhdrgen/yaml/sys_wait.yaml
@@ -1,4 +1,4 @@
-header: sys-wait.h #sys/wait.h
+header: sys-wait.h
macros: []
types:
- type_name: siginfo_t
diff --git a/libc/newhdrgen/yaml_combined/time.yaml b/libc/newhdrgen/yaml/time.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/time.yaml
rename to libc/newhdrgen/yaml/time.yaml
More information about the libc-commits
mailing list