Skip to content

Commit b79cbc0

Browse files
authored
Merge pull request #657 from ckormanyos/cumulative_trivial_syntax
Cumulative trivial syntax
2 parents 6c17446 + 9db4c06 commit b79cbc0

3 files changed

Lines changed: 18 additions & 19 deletions

File tree

ref_app/src/app/benchmark/app_benchmark_non_std_decimal.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,11 @@ static_assert(std::numeric_limits<builtin_float_type>::digits == 53,
3434

3535

3636
#if 0
37-
GCC11, arm-none-eabi, float-abi=soft, -O2
37+
GCC14.2, arm-none-eabi, float-abi=soft, -O2
3838

3939
Calculation exp() via Pade approximation approx. 15 decimal digits.
4040
Code-size includes about 2kb for startup, clock-init, skinny MCAL and cooperative time-scheduler.
4141

42-
4342
target-specific flags
4443
---------------------
4544
-O2
@@ -52,15 +51,14 @@ target-specific flags
5251
-mno-unaligned-access
5352
-mno-long-calls
5453

55-
// TBD: These are very old numbers. Today's decimal is expected
56-
// to be significantly speedier. Update these numbers sometime.
57-
54+
// These are the updated numbers from boost::decimal Git-hash 0b474bf05f339f21d87dd1902dc6294bb9914254.
5855

59-
| Type | runtime [us] | relative | code-size [kb] |
60-
|--------------------------------|---------------|------------|-------------------|
61-
| double (built-in, no FPU) | 22 | 1.0 | 5.6 |
62-
| ::math::softfloat::float64_t | 27 | 1.2 | 8.5 |
63-
| boost::decimal::decimal64_t | 490 | 22 | 20 |
56+
| Type | runtime [us] | relative | code-size [kb] |
57+
|------------------------------------|---------------|------------|-------------------|
58+
| `double` (built-in, no FPU) | $22$ | $1.0$ | $5.6$ |
59+
| `::math::softfloat::float64_t` | $27$ | $1.2$ | $8.5$ |
60+
| `boost::decimal::decimal_fast64_t` | $170$ | $7.7$ | $18$ |
61+
| `boost::decimal::decimal64_t` | $200$ | $9.1$ | $20$ |
6462
#endif
6563

6664
namespace local

ref_app/src/mcal/mcal_gcc_cxx_completion.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ extern "C"
146146
#endif
147147

148148
std::uint8_t __fdlib_version;
149+
150+
// Patched DSO label.
151+
void* __dso_handle;
149152
}
150153

151154
void mcal_gcc_cxx_dummy()

ref_app/src/util/STL/algorithm

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -207,22 +207,20 @@
207207
input_iterator2 first2,
208208
input_iterator2 last2)
209209
{
210-
while(first1 != last1)
210+
for( ; (first1 != last1) && (first2 != last2); static_cast<void>(++first1), static_cast<void>(++first2))
211211
{
212-
if((first2 == last2) || (*first2 < *first1))
213-
{
214-
return false;
215-
}
216-
else if(*first1 < *first2)
212+
if(*first1 < *first2)
217213
{
218214
return true;
219215
}
220216

221-
++first1;
222-
++first2;
217+
if(*first2 < *first1)
218+
{
219+
return false;
220+
}
223221
}
224222

225-
return (first2 != last2);
223+
return ((first1 == last1) && (first2 != last2));
226224
}
227225

228226
template<typename input_iterator,

0 commit comments

Comments
 (0)