-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
1,536 additions
and
1,375 deletions.
There are no files selected for viewing
This file contains 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,29 @@ | ||
cmake_minimum_required(VERSION 3.14) | ||
project(wjr | ||
LANGUAGES CXX | ||
) | ||
|
||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE Release) | ||
endif() | ||
|
||
set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -std=c++17 -march=native -Wall -Wextra") | ||
|
||
set(WJR_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include) | ||
set(WJR_LIB_DIR ${PROJECT_SOURCE_DIR}/src) | ||
|
||
file(GLOB_RECURSE WJR_SRCS ${WJR_LIB_DIR}/*.cpp) | ||
|
||
target_include_directories(wjr PUBLIC | ||
${WJR_INCLUDE_DIR} | ||
) | ||
|
||
target_precompile_headers( | ||
wjr | ||
PUBLIC ${WJR_INCLUDE_DIR}/wjr/preprocessor.hpp | ||
PUBLIC ${WJR_INCLUDE_DIR}/wjr/assert.hpp | ||
PUBLIC ${WJR_INCLUDE_DIR}/wjr/type_traits.hpp | ||
PUBLIC ${WJR_INCLUDE_DIR}/wjr/x86/simd/simd.hpp | ||
) | ||
|
||
add_library(wjr STATIC ${WJR_SRCS}) |
This file contains 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 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 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 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 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,72 @@ | ||
#ifndef WJR_GENERIC_MATH_BIGNUM_CONFIG_HPP__ | ||
#define WJR_GENERIC_MATH_BIGNUM_CONFIG_HPP__ | ||
|
||
#ifndef WJR_TOOM22_MUL_THRESHOLD | ||
#define WJR_TOOM22_MUL_THRESHOLD 22 | ||
#endif | ||
|
||
#ifndef WJR_TOOM33_MUL_THRESHOLD | ||
#define WJR_TOOM33_MUL_THRESHOLD 84 | ||
#endif | ||
|
||
#ifndef WJR_TOOM44_MUL_THRESHOLD | ||
#define WJR_TOOM44_MUL_THRESHOLD 208 | ||
#endif | ||
|
||
#ifndef WJR_TOOM55_MUL_THRESHOLD | ||
#define WJR_TOOM55_MUL_THRESHOLD 800 | ||
#endif | ||
|
||
#ifndef WJR_TOOM32_TO_TOOM43_MUL_THRESHOLD | ||
#define WJR_TOOM32_TO_TOOM43_MUL_THRESHOLD 73 | ||
#endif | ||
|
||
#ifndef WJR_TOOM32_TO_TOOM53_MUL_THRESHOLD | ||
#define WJR_TOOM32_TO_TOOM53_MUL_THRESHOLD 153 | ||
#endif | ||
|
||
#ifndef WJR_TOOM42_TO_TOOM53_MUL_THRESHOLD | ||
#define WJR_TOOM42_TO_TOOM53_MUL_THRESHOLD 137 | ||
#endif | ||
|
||
#ifndef WJR_TOOM42_TO_TOOM63_MUL_THRESHOLD | ||
#define WJR_TOOM42_TO_TOOM63_MUL_THRESHOLD 153 | ||
#endif | ||
|
||
#ifndef WJR_TOOM2_SQR_THRESHOLD | ||
#define WJR_TOOM2_SQR_THRESHOLD 34 | ||
#endif | ||
|
||
#ifndef WJR_TOOM3_SQR_THRESHOLD | ||
#define WJR_TOOM3_SQR_THRESHOLD 124 | ||
#endif | ||
|
||
#ifndef WJR_TOOM4_SQR_THRESHOLD | ||
#define WJR_TOOM4_SQR_THRESHOLD 288 | ||
#endif | ||
|
||
#ifndef WJR_TOOM5_SQR_THRESHOLD | ||
#define WJR_TOOM5_SQR_THRESHOLD 980 | ||
#endif | ||
|
||
#ifndef WJR_DC_DIV_QR_THRESHOLD | ||
#define WJR_DC_DIV_QR_THRESHOLD (WJR_TOOM22_MUL_THRESHOLD * 2) | ||
#endif // WJR_DC_DIV_QR_THRESHOLD | ||
|
||
#ifndef WJR_DC_BIGNUM_TO_CHARS_THRESHOLD | ||
#define WJR_DC_BIGNUM_TO_CHARS_THRESHOLD 20 | ||
#endif | ||
|
||
#ifndef WJR_DC_BIGNUM_TO_CHARS_PRECOMPUTE_THRESHOLD | ||
#define WJR_DC_BIGNUM_TO_CHARS_PRECOMPUTE_THRESHOLD 20 | ||
#endif | ||
|
||
#ifndef WJR_DC_BIGNUM_FROM_CHARS_THRESHOLD | ||
#define WJR_DC_BIGNUM_FROM_CHARS_THRESHOLD 1670 | ||
#endif | ||
|
||
#ifndef WJR_DC_BIGNUM_FROM_CHARS_PRECOMPUTE_THRESHOLD | ||
#define WJR_DC_BIGNUM_FROM_CHARS_PRECOMPUTE_THRESHOLD 3105 | ||
#endif | ||
|
||
#endif // WJR_GENERIC_MATH_BIGNUM_CONFIG_HPP__ |
This file contains 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 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 |
---|---|---|
@@ -1,72 +1,6 @@ | ||
#ifndef WJR_MATH_BIGNUM_CONFIG_HPP__ | ||
#define WJR_MATH_BIGNUM_CONFIG_HPP__ | ||
|
||
#ifndef WJR_TOOM22_MUL_THRESHOLD | ||
#define WJR_TOOM22_MUL_THRESHOLD 22 | ||
#endif | ||
|
||
#ifndef WJR_TOOM33_MUL_THRESHOLD | ||
#define WJR_TOOM33_MUL_THRESHOLD 84 | ||
#endif | ||
|
||
#ifndef WJR_TOOM44_MUL_THRESHOLD | ||
#define WJR_TOOM44_MUL_THRESHOLD 208 | ||
#endif | ||
|
||
#ifndef WJR_TOOM55_MUL_THRESHOLD | ||
#define WJR_TOOM55_MUL_THRESHOLD 800 | ||
#endif | ||
|
||
#ifndef WJR_TOOM32_TO_TOOM43_MUL_THRESHOLD | ||
#define WJR_TOOM32_TO_TOOM43_MUL_THRESHOLD 73 | ||
#endif | ||
|
||
#ifndef WJR_TOOM32_TO_TOOM53_MUL_THRESHOLD | ||
#define WJR_TOOM32_TO_TOOM53_MUL_THRESHOLD 153 | ||
#endif | ||
|
||
#ifndef WJR_TOOM42_TO_TOOM53_MUL_THRESHOLD | ||
#define WJR_TOOM42_TO_TOOM53_MUL_THRESHOLD 137 | ||
#endif | ||
|
||
#ifndef WJR_TOOM42_TO_TOOM63_MUL_THRESHOLD | ||
#define WJR_TOOM42_TO_TOOM63_MUL_THRESHOLD 153 | ||
#endif | ||
|
||
#ifndef WJR_TOOM2_SQR_THRESHOLD | ||
#define WJR_TOOM2_SQR_THRESHOLD 34 | ||
#endif | ||
|
||
#ifndef WJR_TOOM3_SQR_THRESHOLD | ||
#define WJR_TOOM3_SQR_THRESHOLD 124 | ||
#endif | ||
|
||
#ifndef WJR_TOOM4_SQR_THRESHOLD | ||
#define WJR_TOOM4_SQR_THRESHOLD 288 | ||
#endif | ||
|
||
#ifndef WJR_TOOM5_SQR_THRESHOLD | ||
#define WJR_TOOM5_SQR_THRESHOLD 980 | ||
#endif | ||
|
||
#ifndef WJR_DC_DIV_QR_THRESHOLD | ||
#define WJR_DC_DIV_QR_THRESHOLD (WJR_TOOM22_MUL_THRESHOLD * 2) | ||
#endif // WJR_DC_DIV_QR_THRESHOLD | ||
|
||
#ifndef WJR_DC_BIGNUM_TO_CHARS_THRESHOLD | ||
#define WJR_DC_BIGNUM_TO_CHARS_THRESHOLD 20 | ||
#endif | ||
|
||
#ifndef WJR_DC_BIGNUM_TO_CHARS_PRECOMPUTE_THRESHOLD | ||
#define WJR_DC_BIGNUM_TO_CHARS_PRECOMPUTE_THRESHOLD 20 | ||
#endif | ||
|
||
#ifndef WJR_DC_BIGNUM_FROM_CHARS_THRESHOLD | ||
#define WJR_DC_BIGNUM_FROM_CHARS_THRESHOLD 1670 | ||
#endif | ||
|
||
#ifndef WJR_DC_BIGNUM_FROM_CHARS_PRECOMPUTE_THRESHOLD | ||
#define WJR_DC_BIGNUM_FROM_CHARS_PRECOMPUTE_THRESHOLD 3105 | ||
#endif | ||
#include <wjr/generic/math/bignum-config.hpp> | ||
|
||
#endif // WJR_MATH_BIGNUM_CONFIG_HPP__ |
Oops, something went wrong.