Skip to content

Commit

Permalink
adding compile-time messages for non-MSVC compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravenwater committed Sep 1, 2024
1 parent 22243a9 commit 039a275
Show file tree
Hide file tree
Showing 17 changed files with 64 additions and 32 deletions.
8 changes: 6 additions & 2 deletions include/universal/number/posit/specialized/posit_128_2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
#if POSIT_FAST_POSIT_128_2
#undef POSIT_FAST_POSIT_128_2
#define POSIT_FAST_POSIT_128_2 0
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<128,2> requested but ignored as fast implemention is TBD")
#else
#pragma GCC warning "Fast specialization of posit<128,2> requested but ignored as fast implemention is TBD"
#endif
#endif

namespace sw { namespace universal {
Expand All @@ -27,8 +31,8 @@ namespace sw { namespace universal {
#if POSIT_FAST_POSIT_128_2
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<128,2>")
//#else
//#warning("Fast specialization of posit<128,2>")
#else
#pragma GCC warning message "Fast specialization of posit<128,2>"
#endif

// fast specialized posit<128,2>
Expand Down
8 changes: 6 additions & 2 deletions include/universal/number/posit/specialized/posit_128_4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
#if POSIT_FAST_POSIT_128_4
#undef POSIT_FAST_POSIT_128_4
#define POSIT_FAST_POSIT_128_4 0
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<128,4> requested but ignored as fast implemention is TBD")
#else
#pragma GCC warning "Fast specialization of posit<128,4> requested but ignored as fast implemention is TBD"
#endif
#endif

namespace sw { namespace universal {
Expand All @@ -27,8 +31,8 @@ namespace sw { namespace universal {
#if POSIT_FAST_POSIT_128_4
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<128,4>")
//#else
//#warning("Fast specialization of posit<128,4>")
#else
#pragme GCC warning message "Fast specialization of posit<128,4>"
#endif

// fast specialized posit<128,4>
Expand Down
4 changes: 2 additions & 2 deletions include/universal/number/posit/specialized/posit_16_1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ namespace sw { namespace universal {
#if POSIT_FAST_POSIT_16_1
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<16,1>")
//#else some compile time message that indicates that we are using a specialization for non MS compilers
//#warning("Fast specialization of posit<16,1>")
#else
#pragma message "Fast specialization of posit<16,1>"
#endif

// fast specialized posit<16,1>
Expand Down
4 changes: 2 additions & 2 deletions include/universal/number/posit/specialized/posit_16_2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ namespace sw { namespace universal {
#if POSIT_FAST_POSIT_16_2
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<16,2>")
//#else some compile time message that indicates that we are using a specialization for non MS compilers
//#warning("Fast specialization of posit<16,2>")
#else
#pragma message "Fast specialization of posit<16,2>"
#endif

// fast specialized posit<16,2>
Expand Down
8 changes: 6 additions & 2 deletions include/universal/number/posit/specialized/posit_256_2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
#if POSIT_FAST_POSIT_256_2
#undef POSIT_FAST_POSIT_256_2
#define POSIT_FAST_POSIT_256_2 0
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<256,2> requested but ignored as fast implemention is TBD")
#else
#pragma GCC warning "Fast specialization of posit<256,2> requested but ignored as fast implemention is TBD"
#endif
#endif

namespace sw { namespace universal {
Expand All @@ -27,8 +31,8 @@ namespace sw { namespace universal {
#if POSIT_FAST_POSIT_256_2
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<256,2>")
//#else
//#warning("Fast specialization of posit<256,2>")
#else
#pragma GCC warning message "Fast specialization of posit<256,2>"
#endif

// fast specialized posit<256,2>
Expand Down
8 changes: 6 additions & 2 deletions include/universal/number/posit/specialized/posit_256_5.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
#if POSIT_FAST_POSIT_256_5
#undef POSIT_FAST_POSIT_256_5
#define POSIT_FAST_POSIT_256_5 0
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<256,4> requested but ignored as fast implemention is TBD")
#else
#pragma GCC warning "Fast specialization of posit<256,4> requested but ignored as fast implemention is TBD"
#endif
#endif

namespace sw { namespace universal {
Expand All @@ -27,8 +31,8 @@ namespace sw { namespace universal {
#if POSIT_FAST_POSIT_256_5
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<256,5>")
//#else
//#warning("Fast specialization of posit<256,5>")
#else
#pragma GCC warning message "Fast specialization of posit<256,5>"
#endif

// fast specialized posit<256,5>
Expand Down
4 changes: 2 additions & 2 deletions include/universal/number/posit/specialized/posit_2_0.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ namespace sw { namespace universal {
#if POSIT_FAST_POSIT_2_0
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<2,0>")
//#else
//#warning("Fast specialization of posit<2,0>")
#else
#pragma message "Fast specialization of posit<2,0>"
#endif

/* values of a posit<2,0>
Expand Down
4 changes: 2 additions & 2 deletions include/universal/number/posit/specialized/posit_32_2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ namespace sw { namespace universal {
#if POSIT_FAST_POSIT_32_2
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<32,2>")
//#else
//#warning("Fast specialization of posit<32,2>")
#else
#pragma message "Fast specialization of posit<32,2>"
#endif

// fast specialized posit<32,2>
Expand Down
4 changes: 2 additions & 2 deletions include/universal/number/posit/specialized/posit_3_0.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ namespace sw { namespace universal {
#if POSIT_FAST_POSIT_3_0
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<3,0>")
//#else
//#warning("Fast specialization of posit<3,0>")
#else
#pragma message "Fast specialization of posit<3,0>"
#endif

/* values of a posit<3,0>
Expand Down
4 changes: 2 additions & 2 deletions include/universal/number/posit/specialized/posit_3_1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ namespace sw { namespace universal {
#if POSIT_FAST_POSIT_3_1
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<3,1>")
//#else
//#warning("Fast specialization of posit<3,1>")
#else
#pragma message "Fast specialization of posit<3,1>"
#endif

constexpr uint8_t posit_3_1_addition_lookup[64] = {
Expand Down
8 changes: 6 additions & 2 deletions include/universal/number/posit/specialized/posit_48_2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
#if POSIT_FAST_POSIT_48_2
#undef POSIT_FAST_POSIT_48_2
#define POSIT_FAST_POSIT_48_2 0
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<48,2> requested but ignored as fast implemention is TBD")
#else
#pragma GCC warning "Fast specialization of posit<48,2> requested but ignored as fast implemention is TBD"
#endif
#endif

namespace sw { namespace universal {
Expand All @@ -27,8 +31,8 @@ namespace sw { namespace universal {
#if POSIT_FAST_POSIT_48_2
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<48,2>")
//#else
//#warning("Fast specialization of posit<48,2>")
#else
#pragma GCC warning message "Fast specialization of posit<48,2>"
#endif

// fast specialized posit<48,2>
Expand Down
4 changes: 2 additions & 2 deletions include/universal/number/posit/specialized/posit_4_0.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ namespace sw { namespace universal {
#if POSIT_FAST_POSIT_4_0
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<4,0>")
//#else
//#warning("Fast specialization of posit<4,0>")
#else
#pragma message "Fast specialization of posit<4,0>"
#endif

constexpr uint8_t posit_4_0_addition_lookup[256] = {
Expand Down
8 changes: 6 additions & 2 deletions include/universal/number/posit/specialized/posit_64_2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
#if POSIT_FAST_POSIT_64_2
#undef POSIT_FAST_POSIT_64_2
#define POSIT_FAST_POSIT_64_2 0
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<64,2> requested but ignored as fast implemention is TBD")
#else
#pragma GCC warning "Fast specialization of posit<64,2> requested but ignored as fast implemention is TBD"
#endif
#endif

namespace sw { namespace universal {
Expand All @@ -27,8 +31,8 @@ namespace sw { namespace universal {
#if POSIT_FAST_POSIT_64_2
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<64,2>")
//#else
//#warning("Fast specialization of posit<64,2>")
#else
#pragma GCC warning message "Fast specialization of posit<64,2>"
#endif

// fast specialized posit<64,2>
Expand Down
8 changes: 6 additions & 2 deletions include/universal/number/posit/specialized/posit_64_3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
#if POSIT_FAST_POSIT_64_3
#undef POSIT_FAST_POSIT_64_3
#define POSIT_FAST_POSIT_64_3 0
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<64,3> requested but ignored as fast implemention is TBD")
#else
#pragma GCC warning "Fast specialization of posit<64,3> requested but ignored as fast implemention is TBD"
#endif
#endif

namespace sw { namespace universal {
Expand All @@ -27,8 +31,8 @@ namespace sw { namespace universal {
#if POSIT_FAST_POSIT_64_3
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<64,3>")
//#else
//#warning("Fast specialization of posit<64,3>")
#else
#pragma GCC warning message "Fast specialization of posit<64,3>"
#endif

// fast specialized posit<64,3>
Expand Down
4 changes: 2 additions & 2 deletions include/universal/number/posit/specialized/posit_8_0.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ namespace sw { namespace universal {
#if POSIT_FAST_POSIT_8_0
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<8,0>")
//#else some compile time message that indicates that we are using a specialization for non MS compilers
//#warning("Fast specialization of posit<8,0>")
#else
#pragma message "Fast specialization of posit<8,0>"
#endif

// injecting the C API into namespace sw::universal
Expand Down
4 changes: 4 additions & 0 deletions include/universal/number/posit/specialized/posit_8_1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
#if POSIT_FAST_POSIT_8_1
#undef POSIT_FAST_POSIT_8_1
#define POSIT_FAST_POSIT_8_1 0
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<8,1> requested but ignored as fast implemention is TBD")
#else
#pragma GCC warning "Fast specialization of posit<8,1> requested but ignored as fast implemention is TBD"
#endif
#endif

namespace sw { namespace universal {
Expand Down
4 changes: 2 additions & 2 deletions include/universal/number/posit/specialized/posit_8_2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ namespace sw { namespace universal {
#if POSIT_FAST_POSIT_8_2
#ifdef _MSC_VER
#pragma message("Fast specialization of posit<8,2>")
//#else some compile time message that indicates that we are using a specialization for non MS compilers
//#warning("Fast specialization of posit<8,2>")
#else
#pragma message "Fast specialization of posit<8,2>"
#endif

// fast specialized posit<8,2>
Expand Down

0 comments on commit 039a275

Please sign in to comment.