base: Add M5_LIKELY and M5_UNLIKELY macros to compiler.hh.
authorGabe Black <gabeblack@google.com>
Fri, 18 Sep 2020 03:44:47 +0000 (20:44 -0700)
committerGabe Black <gabeblack@google.com>
Sun, 20 Sep 2020 01:03:24 +0000 (01:03 +0000)
commit2f6a770ccf1b1b477cfa45253eedf57a53d58685
tree3663e2eaf357eeaa38791a00ef35dd294857e3d3
parent8d88d84d95c1e72df93b1412ae1fe89ca384762d
base: Add M5_LIKELY and M5_UNLIKELY macros to compiler.hh.

The clang/gcc implementation uses the nonstandard __builtin_expect(). In
C++20, new standard attributes can be used instead. We can't use those
yet though.

Change-Id: Idd2541a7eca0d97ac6c643abbf2910cbc343d7e5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34816
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/base/compiler.hh