1. Use __builtin_expect() for panic, fatal, etc. Preexisting library
functions like assert probably already have this, but our versions don't
and have similar behavior patterns. This should improve performance.

2. Create template versions of the bits, etc functions in bitfields.hh
which use static_assert to verify that the bounds are in the right order.
Unless the bounds change at runtime (probably very uncommon in practice)

bits(foo, 2, 1) => bits<2, 1>(foo)

Then we get the free compile time checking of bounds most of the time
without big overhead otherwise. Something like this:

template <int first, int last, typename T>
constexpr T
bits(T val)
{
    static_assert(first > last);
    return bits(val, first, last);
}

3. Our new min gcc is version 5 which supports c++14. Our min clang is 3.1
which does not, but 3.4 does. Do we want to bump the min clang version up
and move from C++11 to C++14? C++17 has more compelling features, but C++14
fixed some annoyances, at least according to wikipedia:

https://en.wikipedia.org/wiki/C%2B%2B14

Gabe
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to