Skip to contentSkip to conversation

s390x: use CONFIG_INT128 to detect __uint128_t

PATCH Applied Gabriel Kerneis 3 participants 3 messages Apr 23, 2013 – Apr 26, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390x: use CONFIG_INT128 to detect __uint128_t

Target s390x uses ad-hoc macro magic to guess if the compiler supports the GCC extension __uint128_t. This patch uses the the dedicated macro CONFIG_INT128 defined by configure instead.

This fixes compilation with the CIL source code analyzer, which uses GCC as a preprocessor but does not support __uint128_t.

---
 target-s390x/int_helper.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
target-s390x/int_helper.c +1 -2
index af16b21..85e49aa 100644
@@ -97,8 +97,7 @@ uint64_t HELPER(divu64)(CPUS390XState *env, uint64_t ah, uint64_t al,
         ret = al / b;
     } else {
         /* ??? Move i386 idivq helper to host-utils.  */
-#if HOST_LONG_BITS == 64 && defined(__GNUC__)
-        /* assuming 64-bit hosts have __uint128_t */
+#ifdef CONFIG_INT128
         __uint128_t a = ((__uint128_t)ah << 64) | al;
         __uint128_t q = a / b;
         env->retxl = a % b;
Signature · 1 line
1.7.10.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Gabriel Kerneis

Target s390x uses ad-hoc macro magic to guess if the compiler supports the GCC extension __uint128_t. This patch uses the the dedicated macro CONFIG_INT128 defined by configure instead.

This fixes compilation with the CIL source code analyzer, which uses GCC as a preprocessor but does not support __uint128_t.

r~

#2 lore raw
In reply to Gabriel Kerneis
Quoted 11 lines · Gabriel Kerneis

Target s390x uses ad-hoc macro magic to guess if the compiler supports the GCC extension __uint128_t. This patch uses the the dedicated macro CONFIG_INT128 defined by configure instead.

This fixes compilation with the CIL source code analyzer, which uses GCC as a preprocessor but does not support __uint128_t.

---
 target-s390x/int_helper.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Thanks, applied to the trivial patches tree:
https://github.com/stefanha/qemu/commits/trivial-patches

Stefan