Skip to content

Commit

Permalink
WIP: trying to isolate compilation error on ARM
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravenwater committed Oct 8, 2024
1 parent d151c15 commit 4cdf801
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 4 deletions.
17 changes: 17 additions & 0 deletions elastic/decimal/api/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,24 @@ int BigNumberComputation() {
return nrOfFailedTestCases;
}

#include <universal/verification/test_status.hpp>

// Regression testing guards: typically set by the cmake configuration, but MANUAL_TESTING is an override
#define MANUAL_TESTING 0
// REGRESSION_LEVEL_OVERRIDE is set by the cmake file to drive a specific regression intensity
// It is the responsibility of the regression test to organize the tests in a quartile progression.
//#undef REGRESSION_LEVEL_OVERRIDE
#ifndef REGRESSION_LEVEL_OVERRIDE
#undef REGRESSION_LEVEL_1
#undef REGRESSION_LEVEL_2
#undef REGRESSION_LEVEL_3
#undef REGRESSION_LEVEL_4
#define REGRESSION_LEVEL_1 1
#define REGRESSION_LEVEL_2 1
#define REGRESSION_LEVEL_3 1
#define REGRESSION_LEVEL_4 1
#endif

#define STRESS_TESTING 0

int main()
Expand Down
37 changes: 37 additions & 0 deletions elastic/decimal/api/example.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include <iostream>
#include <iomanip>

#include <universal/number/edecimal/edecimal.hpp>

int main(int argc, char** argv)
try {
using namespace sw::universal;
edecimal d, e, f;

e = 1.0f;
f = 0xFFFF'FFFF'FFFF'FFFFull;
d = e + f;

std::cout << "one e : " << e << '\n';
std::cout << "max unsigned long long f : " << f << '\n';
std::cout << " d : " << d << std::endl;

return EXIT_SUCCESS;

}
catch (const char* msg) {
std::cerr << msg << std::endl;
return EXIT_FAILURE;
}
catch (const sw::universal::universal_arithmetic_exception& err) {
std::cerr << "Unprocessed universal arithmetic exception: " << err.what() << std::endl;
return EXIT_FAILURE;
}
catch (const sw::universal::universal_internal_exception& err) {
std::cerr << "Unprocessed universal internal exception: " << err.what() << std::endl;
return EXIT_FAILURE;
}
catch (...) {
std::cerr << "Caught unknown exception" << std::endl;
return EXIT_FAILURE;
}
2 changes: 1 addition & 1 deletion include/universal/native/set_fields.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace sw { namespace universal {

inline BIT_CAST_CONSTEXPR void setbit(float& v, unsigned index, bool b = true) {
uint32_t raw = std::bit_cast<uint32_t, float>(v);
uint32_t mask = (1ull << index); // do we want to bound check?
uint32_t mask = (1u << index); // do we want to bound check?
if (b) raw |= mask; else raw &= ~mask;
v = std::bit_cast<float, uint32_t>(raw);
}
Expand Down
3 changes: 2 additions & 1 deletion include/universal/number/edecimal/edecimal_impl.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#pragma once
// edecimal_impl.hpp: definition of adaptive precision decimal integer data type
//
// Copyright (C) 2017-2023 Stillwater Supercomputing, Inc.
// Copyright (C) 2017 Stillwater Supercomputing, Inc.
// SPDX-License-Identifier: MIT
//
// This file is part of the universal numbers project, which is released under an MIT Open Source license.

Expand Down
5 changes: 3 additions & 2 deletions static/integer/decimal/api/api.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// api.cpp: test suite runner for class interface tests of the decimal integer type
// api.cpp: test suite runner for class interface tests of the static (fixed-size) decimal integer type
//
// Copyright (C) 2017-2023 Stillwater Supercomputing, Inc.
// Copyright (C) 2017 Stillwater Supercomputing, Inc.
// SPDX-License-Identifier: MIT
//
// This file is part of the universal numbers project, which is released under an MIT Open Source license.
#include <universal/utility/directives.hpp>
Expand Down

0 comments on commit 4cdf801

Please sign in to comment.