Skip to content

Commit 30b5d4a

Browse files
[libc][math][c23] Add dfma{l,f128} and dsub{l,f128} C23 math functions (llvm#101089)
Co-authored-by: OverMighty <[email protected]>
1 parent 3626443 commit 30b5d4a

30 files changed

+421
-7
lines changed

libc/config/darwin/arm/entrypoints.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ set(TARGET_LIBM_ENTRYPOINTS
136136
libc.src.math.cos
137137
libc.src.math.cosf
138138
libc.src.math.cospif
139+
libc.src.math.dfmal
139140
libc.src.math.dsqrtl
141+
libc.src.math.dsubl
140142
libc.src.math.erff
141143
libc.src.math.exp
142144
libc.src.math.expf

libc/config/darwin/x86_64/entrypoints.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ set(TARGET_LIBM_ENTRYPOINTS
119119
#libc.src.math.ceill
120120
#libc.src.math.coshf
121121
#libc.src.math.cosf
122+
#libc.src.math.dfmal
122123
#libc.src.math.dsqrtl
124+
#libc.src.math.dsubl
123125
#libc.src.math.expf
124126
#libc.src.math.exp2f
125127
#libc.src.math.expm1f

libc/config/linux/aarch64/entrypoints.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,10 @@ set(TARGET_LIBM_ENTRYPOINTS
361361
libc.src.math.cosf
362362
libc.src.math.coshf
363363
libc.src.math.cospif
364+
libc.src.math.dfmal
364365
libc.src.math.dmull
365366
libc.src.math.dsqrtl
367+
libc.src.math.dsubl
366368
libc.src.math.erff
367369
libc.src.math.exp
368370
libc.src.math.exp10
@@ -612,7 +614,9 @@ if(LIBC_TYPES_HAS_FLOAT128)
612614
# math.h C23 _Float128 entrypoints
613615
libc.src.math.ceilf128
614616
libc.src.math.copysignf128
617+
libc.src.math.dfmaf128
615618
libc.src.math.dsqrtf128
619+
libc.src.math.dsubf128
616620
libc.src.math.fabsf128
617621
libc.src.math.fdimf128
618622
libc.src.math.floorf128

libc/config/linux/arm/entrypoints.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@ set(TARGET_LIBM_ENTRYPOINTS
228228
libc.src.math.cos
229229
libc.src.math.cosf
230230
libc.src.math.coshf
231+
libc.src.math.dfmal
231232
libc.src.math.dsqrtl
233+
libc.src.math.dsubl
232234
libc.src.math.erff
233235
libc.src.math.exp
234236
libc.src.math.exp10

libc/config/linux/riscv/entrypoints.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,10 @@ set(TARGET_LIBM_ENTRYPOINTS
383383
libc.src.math.cosf
384384
libc.src.math.coshf
385385
libc.src.math.cospif
386+
libc.src.math.dfmal
386387
libc.src.math.dmull
387388
libc.src.math.dsqrtl
389+
libc.src.math.dsubl
388390
libc.src.math.erff
389391
libc.src.math.exp
390392
libc.src.math.exp10

libc/config/linux/x86_64/entrypoints.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,10 @@ set(TARGET_LIBM_ENTRYPOINTS
383383
libc.src.math.cosf
384384
libc.src.math.coshf
385385
libc.src.math.cospif
386+
libc.src.math.dfmal
386387
libc.src.math.dmull
387388
libc.src.math.dsqrtl
389+
libc.src.math.dsubl
388390
libc.src.math.erff
389391
libc.src.math.exp
390392
libc.src.math.exp10
@@ -653,8 +655,10 @@ if(LIBC_TYPES_HAS_FLOAT128)
653655
libc.src.math.canonicalizef128
654656
libc.src.math.ceilf128
655657
libc.src.math.copysignf128
658+
libc.src.math.dfmaf128
656659
libc.src.math.dmulf128
657660
libc.src.math.dsqrtf128
661+
libc.src.math.dsubf128
658662
libc.src.math.fabsf128
659663
libc.src.math.fdimf128
660664
libc.src.math.floorf128

libc/config/windows/entrypoints.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ set(TARGET_LIBM_ENTRYPOINTS
133133
libc.src.math.cos
134134
libc.src.math.cosf
135135
libc.src.math.coshf
136+
libc.src.math.dfmal
137+
libc.src.math.dsubl
136138
libc.src.math.erff
137139
libc.src.math.exp
138140
libc.src.math.expf

libc/docs/math/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ Basic Operations
118118
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
119119
| ddiv | N/A | N/A | | N/A | | 7.12.14.4 | F.10.11 |
120120
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
121-
| dfma | N/A | N/A | | N/A | | 7.12.14.5 | F.10.11 |
121+
| dfma | N/A | N/A | |check| | N/A | |check|\* | 7.12.14.5 | F.10.11 |
122122
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
123123
| dmul | N/A | N/A | |check| | N/A | |check|\* | 7.12.14.3 | F.10.11 |
124124
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
125-
| dsub | N/A | N/A | | N/A | | 7.12.14.2 | F.10.11 |
125+
| dsub | N/A | N/A | |check| | N/A | |check|\* | 7.12.14.2 | F.10.11 |
126126
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
127127
| f16add | |check|\* | |check|\* | |check|\* | N/A | |check| | 7.12.14.1 | F.10.11 |
128128
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+

libc/spec/llvm_libc_ext.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ def LLVMLibcExt : StandardSpec<"llvm_libc_ext"> {
5757
[], // Types
5858
[], // Enumerations
5959
[
60+
GuardedFunctionSpec<"dfmaf128", RetValSpec<DoubleType>, [ArgSpec<Float128Type>, ArgSpec<Float128Type>, ArgSpec<Float128Type>], "LIBC_TYPES_HAS_FLOAT128">,
6061
GuardedFunctionSpec<"dsqrtf128", RetValSpec<DoubleType>, [ArgSpec<Float128Type>], "LIBC_TYPES_HAS_FLOAT128">,
62+
GuardedFunctionSpec<"dsubf128", RetValSpec<DoubleType>, [ArgSpec<Float128Type>, ArgSpec<Float128Type>], "LIBC_TYPES_HAS_FLOAT128">,
63+
6164

6265
GuardedFunctionSpec<"f16add", RetValSpec<Float16Type>, [ArgSpec<DoubleType>, ArgSpec<DoubleType>], "LIBC_TYPES_HAS_FLOAT16">,
6366
GuardedFunctionSpec<"f16addf", RetValSpec<Float16Type>, [ArgSpec<FloatType>, ArgSpec<FloatType>], "LIBC_TYPES_HAS_FLOAT16">,

libc/spec/stdc.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,9 @@ def StdC : StandardSpec<"stdc"> {
397397
GuardedFunctionSpec<"ceilf16", RetValSpec<Float16Type>, [ArgSpec<Float16Type>], "LIBC_TYPES_HAS_FLOAT16">,
398398
GuardedFunctionSpec<"ceilf128", RetValSpec<Float128Type>, [ArgSpec<Float128Type>], "LIBC_TYPES_HAS_FLOAT128">,
399399

400+
FunctionSpec<"dfmal", RetValSpec<DoubleType>, [ArgSpec<LongDoubleType>, ArgSpec<LongDoubleType>, ArgSpec<LongDoubleType>]>,
401+
FunctionSpec<"dsubl", RetValSpec<DoubleType>, [ArgSpec<LongDoubleType>, ArgSpec<LongDoubleType>]>,
402+
400403
FunctionSpec<"fabs", RetValSpec<DoubleType>, [ArgSpec<DoubleType>], [ConstAttr]>,
401404
FunctionSpec<"fabsf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
402405
FunctionSpec<"fabsl", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>]>,

0 commit comments

Comments
 (0)