-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc][complex] Testing infra for MPC #121261
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
Merged
Merged
Changes from all commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
d37cba9
header file for mpc
Sh0g0-1758 46b6d8e
mpc testing infra init
Sh0g0-1758 b6157ef
add separate rounding mode for real and imaginary
Sh0g0-1758 7dedaa6
fmt
Sh0g0-1758 a22292b
added MPCNumber
Sh0g0-1758 f06817f
fmt
Sh0g0-1758 09c6880
more fmt
Sh0g0-1758 fd7ccfc
cmake for MPCWrapper
Sh0g0-1758 c8956f6
init
Sh0g0-1758 5a1594c
Merge branch 'carg' into mpc_testing_infra
Sh0g0-1758 9ce03e9
fixed a couple bugs
Sh0g0-1758 d939e5c
fmt
Sh0g0-1758 da739e4
Implement a basic MPC test
Sh0g0-1758 5d8bc06
fmt
Sh0g0-1758 7a2df72
nit
Sh0g0-1758 8b6d3c5
Merge branch 'main' into mpc_testing_infra
Sh0g0-1758 b711cf5
bug fix
Sh0g0-1758 6089ad6
give useful error message
Sh0g0-1758 9e65cd0
fmt
Sh0g0-1758 659abcd
fix: only one rounding mode
Sh0g0-1758 5cd8c63
fmt
Sh0g0-1758 3284f80
remove mpfr functions and add cmake module for mpc
Sh0g0-1758 66500f3
MPC fmt
Sh0g0-1758 9dac333
add custom cmake function to skip mpc tests when in full build mode
Sh0g0-1758 a497f18
remove cargf and add cproj for verification
Sh0g0-1758 e65fe59
free mpc
Sh0g0-1758 17663c6
MPC fmt
Sh0g0-1758 f80dff3
fix: only check for mpc if mpfr is present
Sh0g0-1758 e56a349
Expose a single rounding mode
Sh0g0-1758 3de816a
MPC fmt
Sh0g0-1758 a04923e
move project and conjugate to complex_basic_ops
Sh0g0-1758 14bb02e
use complex_type in MPCWrapper
Sh0g0-1758 2d7b90b
fmt
Sh0g0-1758 cf88bba
nit
Sh0g0-1758 2ab8f32
nit
Sh0g0-1758 5ef5975
nit
Sh0g0-1758 eb44508
nit
Sh0g0-1758 ab3c5bf
nit
Sh0g0-1758 16a615c
nit
Sh0g0-1758 81226da
generalize add_fp_unittest
Sh0g0-1758 363e238
nit
Sh0g0-1758 b482b4b
nit
Sh0g0-1758 a9a12a3
fmt
Sh0g0-1758 6c5620a
nit
Sh0g0-1758 37e5681
fmt
Sh0g0-1758 6565b14
bug fix
Sh0g0-1758 af06fd9
separate the definitions and declarations needed for mpc
Sh0g0-1758 d593619
fmt
Sh0g0-1758 2ed5fc3
move extra precision to header
Sh0g0-1758 ea7203c
fmt
Sh0g0-1758 78c7f28
nit
Sh0g0-1758 5ea22aa
2 linker errors resolved
Sh0g0-1758 7f72499
fmt
Sh0g0-1758 7c95bb0
moved extraprecision
Sh0g0-1758 cfaea9d
Revert "moved extraprecision"
Sh0g0-1758 0e58f6e
solved all linker error
Sh0g0-1758 590379e
clean up
Sh0g0-1758 a7d540d
simplify target libraries
Sh0g0-1758 e51e8b8
fix full build
Sh0g0-1758 7f6c9d3
clang-fmt
Sh0g0-1758 ee25c97
simplify deps
Sh0g0-1758 f3c3898
fix overlay build
Sh0g0-1758 d1d9e70
simplify dependencies
Sh0g0-1758 48a44f1
fmt
Sh0g0-1758 e82fe51
nit
Sh0g0-1758 420d3bc
a couple fixes
Sh0g0-1758 fbae743
fmt
Sh0g0-1758 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
if(LIBC_TESTS_CAN_USE_MPFR) | ||
set(LLVM_LIBC_MPC_INSTALL_PATH "" CACHE PATH "Path to where MPC is installed (e.g. C:/src/install or ~/src/install)") | ||
|
||
if(LLVM_LIBC_MPC_INSTALL_PATH) | ||
set(LIBC_TESTS_CAN_USE_MPC TRUE) | ||
elseif(LIBC_TARGET_OS_IS_GPU OR LLVM_LIBC_FULL_BUILD) | ||
# In full build mode, the MPC library should be built using our own facilities, | ||
# which is currently not possible. | ||
set(LIBC_TESTS_CAN_USE_MPC FALSE) | ||
else() | ||
try_compile( | ||
LIBC_TESTS_CAN_USE_MPC | ||
${CMAKE_CURRENT_BINARY_DIR} | ||
SOURCES | ||
${LIBC_SOURCE_DIR}/utils/MPCWrapper/check_mpc.cpp | ||
COMPILE_DEFINITIONS | ||
${LIBC_COMPILE_OPTIONS_DEFAULT} | ||
LINK_LIBRARIES | ||
-lmpc -lmpfr -lgmp -latomic | ||
) | ||
endif() | ||
endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
//===-- complex basic operations --------------------------------*- 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___SUPPORT_COMPLEX_BASIC_OPERATIONS_H | ||
#define LLVM_LIBC_SRC___SUPPORT_COMPLEX_BASIC_OPERATIONS_H | ||
|
||
#include "complex_type.h" | ||
#include "src/__support/CPP/bit.h" | ||
#include "src/__support/FPUtil/FPBits.h" | ||
|
||
namespace LIBC_NAMESPACE_DECL { | ||
|
||
template <typename T> LIBC_INLINE constexpr T conjugate(T c) { | ||
Complex<make_real_t<T>> c_c = cpp::bit_cast<Complex<make_real_t<T>>>(c); | ||
c_c.imag = -c_c.imag; | ||
return cpp::bit_cast<T>(c_c); | ||
} | ||
|
||
template <typename T> LIBC_INLINE constexpr T project(T c) { | ||
using real_t = make_real_t<T>; | ||
Complex<real_t> c_c = cpp::bit_cast<Complex<real_t>>(c); | ||
if (fputil::FPBits<real_t>(c_c.real).is_inf() || | ||
fputil::FPBits<real_t>(c_c.imag).is_inf()) | ||
return cpp::bit_cast<T>( | ||
Complex<real_t>{(fputil::FPBits<real_t>::inf(Sign::POS).get_val()), | ||
static_cast<real_t>(c_c.imag > 0 ? 0.0 : -0.0)}); | ||
return c; | ||
} | ||
|
||
} // namespace LIBC_NAMESPACE_DECL | ||
#endif // LLVM_LIBC_SRC___SUPPORT_COMPLEX_BASIC_OPERATIONS_H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.