-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
[libc][math][c23] Add totalorderl function. #102564
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1839,6 +1839,27 @@ functions: | |
- type: float128 * | ||
- type: float128 | ||
guard: LIBC_TYPES_HAS_FLOAT128 | ||
- name: totalorder | ||
standards: | ||
- stdc | ||
return_type: int | ||
arguments: | ||
- type: double * | ||
- type: double * | ||
- name: totalorderf | ||
standards: | ||
- stdc | ||
return_type: int | ||
arguments: | ||
- type: float * | ||
- type: float * | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
- name: totalorderl | ||
standards: | ||
- stdc | ||
return_type: int | ||
arguments: | ||
- type: long double * | ||
- type: long double * | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
- name: totalorderf16 | ||
standards: | ||
- stdc | ||
|
@@ -1847,6 +1868,14 @@ functions: | |
- type: _Float16 * | ||
- type: _Float16 * | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mind changing this to |
||
guard: LIBC_TYPES_HAS_FLOAT16 | ||
- name: totalorderf128 | ||
standards: | ||
- stdc | ||
return_type: int | ||
arguments: | ||
- type: float128 * | ||
- type: float128 * | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
guard: LIBC_TYPES_HAS_FLOAT128 | ||
- name: totalordermagf16 | ||
standards: | ||
- stdc | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//===-- Implementation of totalorderl function ----------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "src/math/totalorderl.h" | ||
#include "src/__support/FPUtil/BasicOperations.h" | ||
#include "src/__support/common.h" | ||
#include "src/__support/macros/config.h" | ||
|
||
namespace LIBC_NAMESPACE_DECL { | ||
|
||
LLVM_LIBC_FUNCTION(int, totalorderl, | ||
(const long double *x, const long double *y)) { | ||
return static_cast<int>(fputil::totalorder(*x, *y)); | ||
} | ||
|
||
} // namespace LIBC_NAMESPACE_DECL |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//===-- Implementation header for totalorderl -------------------*- C++ -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef LLVM_LIBC_SRC_MATH_TOTALORDERL_H | ||
#define LLVM_LIBC_SRC_MATH_TOTALORDERL_H | ||
|
||
#include "src/__support/macros/config.h" | ||
|
||
namespace LIBC_NAMESPACE_DECL { | ||
|
||
int totalorderl(const long double *x, const long double *y); | ||
|
||
} // namespace LIBC_NAMESPACE_DECL | ||
|
||
#endif // LLVM_LIBC_SRC_MATH_TOTALORDERL_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//===-- Unittests for totalorderl -----------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "TotalOrderTest.h" | ||
|
||
#include "src/math/totalorderl.h" | ||
|
||
LIST_TOTALORDER_TESTS(long double, LIBC_NAMESPACE::totalorderl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const double *