Skip to content
Snippets Groups Projects
Commit 21d4e557 authored by Thomas Huth's avatar Thomas Huth Committed by Laurent Vivier
Browse files

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: default avatarThomas Huth <thuth@redhat.com>
Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
Message-Id: <20220721074809.1513357-1-thuth@redhat.com>
Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
parent 1e2dd311
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment