Skip to content

Commit de32b44

Browse files
committed
in CMakeLists.txt fetch the util lib using the up to date git tag, improve the readme.md, and add a missing programming by contract macro
1 parent cb5e74a commit de32b44

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@ If you prefer not to use the high level interface of MontgomeryForm, and instead
7777

7878
## Performance Notes
7979

80-
If you're interested in experimenting, predefining certain macros when compiling might improve performance - see [macros_for_performance.md](macros_for_performance.md).
80+
If you're interested in experimenting, defining certain macros when compiling might improve performance - see [macros_for_performance.md](macros_for_performance.md).

build_tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,7 @@ elif [ "${mode,,}" = "debug" ]; then
568568
-DCMAKE_BUILD_TYPE=Debug \
569569
-DCMAKE_EXE_LINKER_FLAGS="$clang_ubsan_link_flags" \
570570
-DCMAKE_CXX_FLAGS="-DHURCHALLA_CLOCKWORK_ENABLE_ASSERTS=1 \
571+
-DHURCHALLA_UTIL_CHECK_API_PRECONDITIONS=1 \
571572
$cpp_standard $cpp_stdlib \
572573
$clang_ubsan $gcc_ubsan \
573574
$test_avoid_cselect $test_heavyweight \

macros_for_performance.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

2-
Optional macros to predefine to tune performance
3-
------------------------------------------------
4-
There are a number of macros you can optionally predefine to tune the
2+
Optional macros you can define to tune performance
3+
--------------------------------------------------
4+
There are a number of macros you can optionally define when you compile, to tune the
55
performance on your system for the modular arithmetic functions. It is
66
generally recommended not to do so, but in some cases you may find it useful.
7-
You would predefine one or more of these macros when compiling *your* sources,
7+
You would define one or more of these macros when compiling *your* sources,
88
given that Clockwork is a header-only library.
99

1010
For example, if you are compiling using clang or gcc from the command line, you would
@@ -15,17 +15,17 @@ to your CMakeLists.txt, similarly to the following:
1515
target_compile_definitions(<your_target_name> PRIVATE HURCHALLA_ALLOW_INLINE_ASM_ALL)
1616
\
1717
\
18-
HURCHALLA_TARGET_ISA_HAS_NO_DIVIDE - predefine this macro if your target system's
18+
HURCHALLA_TARGET_ISA_HAS_NO_DIVIDE - define this macro if your target system's
1919
instruction set does not include division. Although it is unusual, some
20-
microcontrollers do not have division, and predefining this macro might improve
20+
microcontrollers do not have division, and defining this macro might improve
2121
performance in such a case.
2222

23-
HURCHALLA_AVOID_CSELECT - you may wish to predefine this macro if your target
23+
HURCHALLA_AVOID_CSELECT - you may wish to define this macro if your target
2424
system's instruction set does not include conditional move or conditional
2525
select. It may improve performance in such a case. This macro is normally
26-
already predefined for RISC-V.
26+
already defined for RISC-V.
2727

28-
HURCHALLA_ALLOW_INLINE_ASM_ALL - predefining this macro will enable all
28+
HURCHALLA_ALLOW_INLINE_ASM_ALL - defining this macro will enable all
2929
available inline asm functions. Although this is the easiest macro to use, you
3030
can more selectively enable inline asm for particular functions, using macros
3131
listed below. In some cases HURCHALLA_ALLOW_INLINE_ASM_ALL may improve

modular_arithmetic/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ include(FetchContent)
7575
FetchContent_Declare(
7676
hurchalla_util
7777
GIT_REPOSITORY https://github.com/hurchalla/util.git
78-
GIT_TAG 9163344ee69f21a21cb8928dd30fc2ff15e94f0c
78+
GIT_TAG 0e5a34dbd1d7b364f54934f8245214386673c509
7979
)
8080
FetchContent_MakeAvailable(hurchalla_util)
8181

modular_arithmetic/include/hurchalla/modular_arithmetic/detail/clockwork_programming_by_contract.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@
176176

177177
#else
178178

179+
# define HPBC_CLOCKWORK_CONSTEXPR_ASSERT(...) HPBC_CLOCKWORK_DO_NOTHING(__VA_ARGS__)
179180
# define HPBC_CLOCKWORK_CONSTEXPR_PRECONDITION(...) HPBC_CLOCKWORK_DO_NOTHING(__VA_ARGS__)
180181
# define HPBC_CLOCKWORK_CONSTEXPR_POSTCONDITION(...) HPBC_CLOCKWORK_DO_NOTHING(__VA_ARGS__)
181182
# define HPBC_CLOCKWORK_CONSTEXPR_INVARIANT(...) HPBC_CLOCKWORK_DO_NOTHING(__VA_ARGS__)

montgomery_arithmetic/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ include(FetchContent)
7878
FetchContent_Declare(
7979
hurchalla_util
8080
GIT_REPOSITORY https://github.com/hurchalla/util.git
81-
GIT_TAG 9163344ee69f21a21cb8928dd30fc2ff15e94f0c
81+
GIT_TAG 0e5a34dbd1d7b364f54934f8245214386673c509
8282
)
8383
FetchContent_MakeAvailable(hurchalla_util)
8484

0 commit comments

Comments
 (0)