aboutsummaryrefslogtreecommitdiff
path: root/include/qemu/host-utils.h
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2022-07-21 09:48:09 +0200
committerLaurent Vivier <laurent@vivier.eu>2022-08-04 13:49:47 +0200
commit21d4e557e2fd0cb7f10b632b35f51146a1b6d892 (patch)
treebe34257d4acfeebe952a28316957f0ed4353fadd /include/qemu/host-utils.h
parent1e2dd311491565a58b30f29e71c6e429fc8e7e84 (diff)
downloadqemu-21d4e557e2fd0cb7f10b632b35f51146a1b6d892.zip
qemu-21d4e557e2fd0cb7f10b632b35f51146a1b6d892.tar.gz
qemu-21d4e557e2fd0cb7f10b632b35f51146a1b6d892.tar.bz2
include/qemu/host-utils.h: Simplify the compiler check in mulu128()
We currently require at least GCC 7.4 or Clang 6.0 for compiling QEMU. GCC has __builtin_mul_overflow since version 5 already, and Clang 6.0 also provides this built-in function (see its documentation on this page: https://releases.llvm.org/6.0.0/tools/clang/docs/LanguageExtensions.html ). So we can simplify the #if statement here. Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220721074809.1513357-1-thuth@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'include/qemu/host-utils.h')
-rw-r--r--include/qemu/host-utils.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/qemu/host-utils.h b/include/qemu/host-utils.h
index 29f3a99..88d4761 100644
--- a/include/qemu/host-utils.h
+++ b/include/qemu/host-utils.h
@@ -533,8 +533,7 @@ static inline bool umul64_overflow(uint64_t x, uint64_t y, uint64_t *ret)
*/
static inline bool mulu128(uint64_t *plow, uint64_t *phigh, uint64_t factor)
{
-#if defined(CONFIG_INT128) && \
- (__has_builtin(__builtin_mul_overflow) || __GNUC__ >= 5)
+#if defined(CONFIG_INT128)
bool res;
__uint128_t r;
__uint128_t f = ((__uint128_t)*phigh << 64) | *plow;