[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 5/5] include/qemu/host-utils.h: Simplify the compiler check in mul
From: |
Laurent Vivier |
Subject: |
[PULL 5/5] include/qemu/host-utils.h: Simplify the compiler check in mulu128() |
Date: |
Thu, 4 Aug 2022 21:22:16 +0200 |
From: Thomas Huth <thuth@redhat.com>
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>
---
include/qemu/host-utils.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/include/qemu/host-utils.h b/include/qemu/host-utils.h
index 29f3a9987880..88d476161ccb 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;
--
2.37.1
- [PULL 0/5] Trivial branch for 7.1 patches, Laurent Vivier, 2022/08/04
- [PULL 3/5] docs/about/removed-features: Move the -soundhw into the right section, Laurent Vivier, 2022/08/04
- [PULL 5/5] include/qemu/host-utils.h: Simplify the compiler check in mulu128(),
Laurent Vivier <=
- [PULL 2/5] vdpa: Fix file descriptor leak on get features error, Laurent Vivier, 2022/08/04
- [PULL 4/5] ppc: Remove redundant macro MSR_BOOK3S_MASK., Laurent Vivier, 2022/08/04
- [PULL 1/5] README.rst: fix link formatting, Laurent Vivier, 2022/08/04
- Re: [PULL 0/5] Trivial branch for 7.1 patches, Richard Henderson, 2022/08/04
- Re: [PULL 0/5] Trivial branch for 7.1 patches, Markus Armbruster, 2022/08/05