Skip to content

Commit eddfd50

Browse files
authored
[libc][math][c23] Add ddivl C23 math function. (llvm#102468)
1 parent 722c066 commit eddfd50

File tree

19 files changed

+125
-9
lines changed

19 files changed

+125
-9
lines changed

libc/config/darwin/arm/entrypoints.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ set(TARGET_LIBM_ENTRYPOINTS
149149
libc.src.math.dfmal
150150
libc.src.math.dsqrtl
151151
libc.src.math.daddl
152+
libc.src.math.ddivl
152153
libc.src.math.dsubl
153154
libc.src.math.erff
154155
libc.src.math.exp

libc/config/darwin/x86_64/entrypoints.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ set(TARGET_LIBM_ENTRYPOINTS
120120
#libc.src.math.coshf
121121
#libc.src.math.cosf
122122
#libc.src.math.daddl
123+
#libc.src.math.ddivl
123124
#libc.src.math.dfmal
124125
#libc.src.math.dsqrtl
125126
#libc.src.math.dsubl

libc/config/linux/aarch64/entrypoints.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ set(TARGET_LIBM_ENTRYPOINTS
389389
libc.src.math.coshf
390390
libc.src.math.cospif
391391
libc.src.math.daddl
392+
libc.src.math.ddivl
392393
libc.src.math.dfmal
393394
libc.src.math.dmull
394395
libc.src.math.dsqrtl

libc/config/linux/riscv/entrypoints.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ set(TARGET_LIBM_ENTRYPOINTS
388388
libc.src.math.coshf
389389
libc.src.math.cospif
390390
libc.src.math.daddl
391+
libc.src.math.ddivl
391392
libc.src.math.dfmal
392393
libc.src.math.dmull
393394
libc.src.math.dsqrtl

libc/config/linux/x86_64/entrypoints.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ set(TARGET_LIBM_ENTRYPOINTS
391391
libc.src.math.dmull
392392
libc.src.math.dsqrtl
393393
libc.src.math.daddl
394+
libc.src.math.ddivl
394395
libc.src.math.dsubl
395396
libc.src.math.erff
396397
libc.src.math.exp

libc/config/windows/entrypoints.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ set(TARGET_LIBM_ENTRYPOINTS
137137
libc.src.math.cosf
138138
libc.src.math.coshf
139139
libc.src.math.daddl
140+
libc.src.math.ddivl
140141
libc.src.math.dfmal
141142
libc.src.math.dsubl
142143
libc.src.math.erff

libc/docs/math/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Basic Operations
116116
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
117117
| dadd | N/A | N/A | |check| | N/A | |check|\* | 7.12.14.1 | F.10.11 |
118118
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
119-
| ddiv | N/A | N/A | | N/A | |check|\* | 7.12.14.4 | F.10.11 |
119+
| ddiv | N/A | N/A | |check| | N/A | |check|\* | 7.12.14.4 | F.10.11 |
120120
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
121121
| dfma | N/A | N/A | |check| | N/A | |check|\* | 7.12.14.5 | F.10.11 |
122122
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+

libc/newhdrgen/yaml/math.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,3 +2352,10 @@ functions:
23522352
arguments:
23532353
- type: long double
23542354
- type: int *
2355+
- name: ddivl
2356+
standards:
2357+
- stdc
2358+
return_type: long double
2359+
arguments:
2360+
- type: long double
2361+
- type: long double

libc/spec/stdc.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def StdC : StandardSpec<"stdc"> {
398398
GuardedFunctionSpec<"ceilf128", RetValSpec<Float128Type>, [ArgSpec<Float128Type>], "LIBC_TYPES_HAS_FLOAT128">,
399399

400400
FunctionSpec<"daddl", RetValSpec<DoubleType>, [ArgSpec<LongDoubleType>, ArgSpec<LongDoubleType>]>,
401-
401+
FunctionSpec<"ddivl", RetValSpec<DoubleType>, [ArgSpec<LongDoubleType>, ArgSpec<LongDoubleType>]>,
402402
FunctionSpec<"dfmal", RetValSpec<DoubleType>, [ArgSpec<LongDoubleType>, ArgSpec<LongDoubleType>, ArgSpec<LongDoubleType>]>,
403403
FunctionSpec<"dsubl", RetValSpec<DoubleType>, [ArgSpec<LongDoubleType>, ArgSpec<LongDoubleType>]>,
404404

libc/src/__support/FPUtil/generic/div.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ div(InType x, InType y) {
3535
using InFPBits = FPBits<InType>;
3636
using InStorageType = typename InFPBits::StorageType;
3737
using DyadicFloat =
38-
DyadicFloat<cpp::bit_ceil(static_cast<size_t>(InFPBits::FRACTION_LEN))>;
38+
DyadicFloat<cpp::bit_ceil(static_cast<size_t>(InFPBits::SIG_LEN + 1))>;
3939

4040
InFPBits x_bits(x);
4141
InFPBits y_bits(y);

0 commit comments

Comments
 (0)