Skip to content

Commit 7b51777

Browse files
author
Job Henandez Lara
authored
[libc][math][c23] add entrypoints and tests for totalordermag{f,l,f128} (llvm#100159)
Fixes llvm#100139
1 parent 3f6eb13 commit 7b51777

23 files changed

+344
-4
lines changed

libc/config/darwin/arm/entrypoints.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ set(TARGET_LIBM_ENTRYPOINTS
241241
libc.src.math.tan
242242
libc.src.math.tanf
243243
libc.src.math.tanhf
244+
libc.src.math.totalordermag
245+
libc.src.math.totalordermagf
246+
libc.src.math.totalordermagl
244247
libc.src.math.trunc
245248
libc.src.math.truncf
246249
libc.src.math.truncl

libc/config/darwin/x86_64/entrypoints.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ set(TARGET_LIBM_ENTRYPOINTS
207207
#libc.src.math.sqrtl
208208
#libc.src.math.tanf
209209
#libc.src.math.tanhf
210+
#libc.src.math.totalordermag
211+
#libc.src.math.totalordermagf
212+
#libc.src.math.totalordermagl
210213
#libc.src.math.trunc
211214
#libc.src.math.truncf
212215
#libc.src.math.truncl

libc/config/linux/aarch64/entrypoints.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,9 @@ set(TARGET_LIBM_ENTRYPOINTS
514514
libc.src.math.tan
515515
libc.src.math.tanf
516516
libc.src.math.tanhf
517+
libc.src.math.totalordermag
518+
libc.src.math.totalordermagf
519+
libc.src.math.totalordermagl
517520
libc.src.math.trunc
518521
libc.src.math.truncf
519522
libc.src.math.truncl
@@ -637,6 +640,7 @@ if(LIBC_TYPES_HAS_FLOAT128)
637640
libc.src.math.roundevenf128
638641
libc.src.math.scalbnf128
639642
libc.src.math.sqrtf128
643+
libc.src.math.totalordermagf128
640644
libc.src.math.truncf128
641645
libc.src.math.ufromfpf128
642646
libc.src.math.ufromfpxf128

libc/config/linux/arm/entrypoints.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,9 @@ set(TARGET_LIBM_ENTRYPOINTS
373373
libc.src.math.tan
374374
libc.src.math.tanf
375375
libc.src.math.tanhf
376+
libc.src.math.totalordermag
377+
libc.src.math.totalordermagf
378+
libc.src.math.totalordermagl
376379
libc.src.math.trunc
377380
libc.src.math.truncf
378381
libc.src.math.truncl

libc/config/linux/riscv/entrypoints.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,9 @@ set(TARGET_LIBM_ENTRYPOINTS
542542
libc.src.math.tan
543543
libc.src.math.tanf
544544
libc.src.math.tanhf
545+
libc.src.math.totalordermag
546+
libc.src.math.totalordermagf
547+
libc.src.math.totalordermagl
545548
libc.src.math.trunc
546549
libc.src.math.truncf
547550
libc.src.math.truncl
@@ -600,6 +603,7 @@ if(LIBC_TYPES_HAS_FLOAT128)
600603
libc.src.math.roundf128
601604
libc.src.math.scalbnf128
602605
libc.src.math.sqrtf128
606+
libc.src.math.totalordermagf128
603607
libc.src.math.truncf128
604608
libc.src.math.ufromfpf128
605609
libc.src.math.ufromfpxf128

libc/config/linux/x86_64/entrypoints.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,9 @@ set(TARGET_LIBM_ENTRYPOINTS
542542
libc.src.math.tan
543543
libc.src.math.tanf
544544
libc.src.math.tanhf
545+
libc.src.math.totalordermag
546+
libc.src.math.totalordermagf
547+
libc.src.math.totalordermagl
545548
libc.src.math.trunc
546549
libc.src.math.truncf
547550
libc.src.math.truncl
@@ -686,6 +689,7 @@ if(LIBC_TYPES_HAS_FLOAT128)
686689
libc.src.math.roundf128
687690
libc.src.math.scalbnf128
688691
libc.src.math.sqrtf128
692+
libc.src.math.totalordermagf128
689693
libc.src.math.truncf128
690694
libc.src.math.ufromfpf128
691695
libc.src.math.ufromfpxf128

libc/docs/math/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ Basic Operations
230230
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
231231
| totalorder | | | | |check| | | F.10.12.1 | N/A |
232232
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
233-
| totalordermag | | | | |check| | | F.10.12.2 | N/A |
233+
| totalordermag | |check| | |check| | |check| | |check| | |check| | F.10.12.2 | N/A |
234234
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
235235
| trunc | |check| | |check| | |check| | |check| | |check| | 7.12.9.9 | F.10.6.9 |
236236
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+

libc/spec/stdc.td

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -720,10 +720,13 @@ def StdC : StandardSpec<"stdc"> {
720720

721721
FunctionSpec<"dsqrtl", RetValSpec<DoubleType>, [ArgSpec<LongDoubleType>]>,
722722

723+
GuardedFunctionSpec<"totalorderf16", RetValSpec<IntType>, [ArgSpec<Float16Ptr>, ArgSpec<Float16Ptr>], "LIBC_TYPES_HAS_FLOAT16">,
723724

724-
GuardedFunctionSpec<"totalorderf16", RetValSpec<IntType>, [ArgSpec<Float16Ptr>, ArgSpec<Float16Ptr>], "LIBC_TYPES_HAS_FLOAT16">,
725-
726-
GuardedFunctionSpec<"totalordermagf16", RetValSpec<IntType>, [ArgSpec<Float16Ptr>, ArgSpec<Float16Ptr>], "LIBC_TYPES_HAS_FLOAT16">,
725+
FunctionSpec<"totalordermag", RetValSpec<IntType>, [ArgSpec<DoublePtr>, ArgSpec<DoublePtr>]>,
726+
FunctionSpec<"totalordermagf", RetValSpec<IntType>, [ArgSpec<FloatPtr>, ArgSpec<FloatPtr>]>,
727+
FunctionSpec<"totalordermagl", RetValSpec<IntType>, [ArgSpec<LongDoublePtr>, ArgSpec<LongDoublePtr>]>,
728+
GuardedFunctionSpec<"totalordermagf16", RetValSpec<IntType>, [ArgSpec<Float16Ptr>, ArgSpec<Float16Ptr>], "LIBC_TYPES_HAS_FLOAT16">,
729+
GuardedFunctionSpec<"totalordermagf128", RetValSpec<IntType>, [ArgSpec<Float128Ptr>, ArgSpec<Float128Ptr>], "LIBC_TYPES_HAS_FLOAT128">,
727730

728731
GuardedFunctionSpec<"getpayloadf16", RetValSpec<Float16Type>, [ArgSpec<Float16Ptr>], "LIBC_TYPES_HAS_FLOAT16">,
729732

libc/src/math/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,11 @@ add_math_entrypoint_object(tgammaf)
435435

436436
add_math_entrypoint_object(totalorderf16)
437437

438+
add_math_entrypoint_object(totalordermag)
439+
add_math_entrypoint_object(totalordermagf)
440+
add_math_entrypoint_object(totalordermagl)
438441
add_math_entrypoint_object(totalordermagf16)
442+
add_math_entrypoint_object(totalordermagf128)
439443

440444
add_math_entrypoint_object(trunc)
441445
add_math_entrypoint_object(truncf)

libc/src/math/generic/CMakeLists.txt

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3965,6 +3965,42 @@ add_entrypoint_object(
39653965
-O3
39663966
)
39673967

3968+
add_entrypoint_object(
3969+
totalordermag
3970+
SRCS
3971+
totalordermag.cpp
3972+
HDRS
3973+
../totalordermag.h
3974+
DEPENDS
3975+
libc.src.__support.FPUtil.basic_operations
3976+
COMPILE_OPTIONS
3977+
-O3
3978+
)
3979+
3980+
add_entrypoint_object(
3981+
totalordermagf
3982+
SRCS
3983+
totalordermagf.cpp
3984+
HDRS
3985+
../totalordermagf.h
3986+
DEPENDS
3987+
libc.src.__support.FPUtil.basic_operations
3988+
COMPILE_OPTIONS
3989+
-O3
3990+
)
3991+
3992+
add_entrypoint_object(
3993+
totalordermagl
3994+
SRCS
3995+
totalordermagl.cpp
3996+
HDRS
3997+
../totalordermagl.h
3998+
DEPENDS
3999+
libc.src.__support.FPUtil.basic_operations
4000+
COMPILE_OPTIONS
4001+
-O3
4002+
)
4003+
39684004
add_entrypoint_object(
39694005
totalordermagf16
39704006
SRCS
@@ -3977,6 +4013,19 @@ add_entrypoint_object(
39774013
-O3
39784014
)
39794015

4016+
add_entrypoint_object(
4017+
totalordermagf128
4018+
SRCS
4019+
totalordermagf128.cpp
4020+
HDRS
4021+
../totalordermagf128.h
4022+
DEPENDS
4023+
libc.src.__support.FPUtil.basic_operations
4024+
libc.src.__support.macros.properties.types
4025+
COMPILE_OPTIONS
4026+
-O3
4027+
)
4028+
39804029
add_entrypoint_object(
39814030
getpayloadf16
39824031
SRCS

0 commit comments

Comments
 (0)