[flang-commits] [PATCH] D111281: [flang] More work on SYSTEM_CLOCK runtime API and implementation
Diana Picus via Phabricator via flang-commits
flang-commits at lists.llvm.org
Thu Oct 7 04:08:42 PDT 2021
rovka added inline comments.
================
Comment at: flang/runtime/time-intrinsic.cpp:122
+ constexpr auto max_clock_t{std::numeric_limits<std::clock_t>::max()};
+ unsigned_count_t maxCount{GetHUGE(kind)};
+ return max_clock_t <= maxCount ? static_cast<count_t>(max_clock_t)
----------------
Isn't maxCount actually GetHUGE - 1? (Since you're doing % at the end of GetSystemClockCount).
================
Comment at: flang/runtime/time-intrinsic.cpp:153
+ ? unsignedNsecs
+ : unsignedNsecs / (NSECS_PER_SEC / MILLIS_PER_SEC)};
+ // Return the modulus of the unsigned integral count with HUGE(COUNT).
----------------
Should we extract this into a helper, so it stays in sync with GetSystemClockCountMax?
================
Comment at: flang/unittests/Runtime/Time.cpp:71
+ EXPECT_GE(start8, 0);
+ EXPECT_LT(start8, max8);
----------------
Maybe also add tests for kind = 16?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111281/new/
https://reviews.llvm.org/D111281
More information about the flang-commits
mailing list