From patchwork Thu Jun 17 09:31:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 462136 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp282497jae; Thu, 17 Jun 2021 02:59:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZhcuh7px47rb5Xvd7L2hW2JOB4M07OGlSEbtpChM3DGeg0TcjmBChXp2lIBNRN9lEWIUb X-Received: by 2002:ae9:e912:: with SMTP id x18mr2958206qkf.495.1623923959801; Thu, 17 Jun 2021 02:59:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623923959; cv=none; d=google.com; s=arc-20160816; b=veb8gPqr7K46mO1JmLHsEV9eDbv6e3QI6S9Zzn5SRS0EcJEIcxgXVGPI9UrnTnIZ0x P1BLOdNdCvKKZATyKJD0kJl0Wc0BN8u1fcs1TDGZ736GTxHkog9ukP4p1E/Errtx6dnR Z8r45lSd2ejq+NqW3VLvj6TJW/zoXZfi+YrG/Ts3LEVy+u3vgmGk6xPpp76uOK0kJxyo BPSVYqsmtvl172TPeNPAj7XFtD2wku3iVNhqzwRMwXOHms4Qb/Ya0Mdq31PjUvwroQiG j0ELgpZsCvoSjklBPRBAqHtH9sLqgwn9NEkT5tCS7KUvD1R/QFXIqtLdNfHXmPHkYsju 4VXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=w/ZDHFj/sj/zgSbYdluGkx019Z0PuVQHSdt6mo9xSR4=; b=rebzvXupiDpssobVyk26OsuE0pduUTPRgSY+hPuT5UDfWRdIOwzKMRMM029/NeLH9E jfOnZn16bzgKPeUaKkAF5P/lS3cUT0E0/yqtCJ07vdUtWrLgBG5pDJrye6HQHykunSR6 J9mCpSpn+mCXgHpU8bxJr8dG42Aa2fw9aZEnoV/yX4yh7MNuljfVCxFyUxoG+68dFWin S5d0r3LBLd0eQg5IfRrY93ja0OJxf692xSIgIV2m/NPmS4wvvdI8WTjui56/djuePoVM 4QpUecWoKoy56JDNuqCVKkzpQ202N7USTTWfnWsqJ8pUsGDfh/DK16NPXg/JhFrX5Ww+ 5FFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="MrXphbJ/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h18si1791497qka.118.2021.06.17.02.59.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Jun 2021 02:59:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="MrXphbJ/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:38494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltonv-0003u9-8H for patch@linaro.org; Thu, 17 Jun 2021 05:59:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltoNe-0003Fl-Vc for qemu-devel@nongnu.org; Thu, 17 Jun 2021 05:32:11 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]:38905) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ltoNc-0006Rx-SZ for qemu-devel@nongnu.org; Thu, 17 Jun 2021 05:32:10 -0400 Received: by mail-ed1-x52c.google.com with SMTP id t7so3048386edd.5 for ; Thu, 17 Jun 2021 02:32:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=w/ZDHFj/sj/zgSbYdluGkx019Z0PuVQHSdt6mo9xSR4=; b=MrXphbJ/KQ/joNv3lsNS+yXiCVYhwrhLx7EMEn7Vn5FnZDoEJYaGcdhq2EdPGPtiKo DmV+fRLDkrI8LUVLV4h4pNq1QdIiuV1G+i6NAxp0BF3GFi3oBWM+C9COjQIzhxwWV0kI IWJfbjiESS9MP4TpyxKLD/V+DQqkLEf2B8LNpLvRkitvIUkDGsozkxC363lg0goGjZcD WR65MTwpPYBQhavnWIQmyGE0Z2Zcu6c5zm4HM6SBnrewFOx0hRqeEGUwc7urmIqlSfm8 U9vTwYTUU6sTK53VpMUzpBOWAmtKzHBjKHKzJroeBTofmvw8e4gdO4cCnMNXkS7zcaCw 1fdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=w/ZDHFj/sj/zgSbYdluGkx019Z0PuVQHSdt6mo9xSR4=; b=ta+od7WrDDBMs6WESGz6bwYPRJhLBoAmsY3Ig2cBRrRVJsbw930EeGRGFhZEs58iBR s7uj6NQWM4SUJ8sEzlprR/IOK3i6aTqg12IibL7HZ30KAv+v87r4I5ndOdnoo740wX6a rl81jNLQ3lWqujuDfBb/J97xX3OpICcI7Pr7/0NPkObwpQM8fj+jWfdKOOlsZf7z7npV rJe8Cb80W9Dyn1e+YCv7B2Mvb5rUrhA/w/i/r8eMYnaWz+PGeD1ZwogEyH8PCQ4L0Xbd DHNuseUZ/s6hHO+StfOgafTNC8Z28QyKtU4A8aIFu2mG75pmY0OQUFAPGJvwwIHJSpko OdoQ== X-Gm-Message-State: AOAM530h7hFLzWOY9LTrKo2GpwXX1N55NTtFZdLN8HrIXpdoO+Dfocnt 5Ox0WDkZV2+crBGZ3HdmAQ1hVqNaaYw= X-Received: by 2002:a05:6402:4255:: with SMTP id g21mr5252335edb.103.1623922327685; Thu, 17 Jun 2021 02:32:07 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id m18sm3328140ejx.56.2021.06.17.02.32.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 02:32:07 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 44/45] qemu/compiler: Remove QEMU_GENERIC Date: Thu, 17 Jun 2021 11:31:33 +0200 Message-Id: <20210617093134.900014-45-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210617093134.900014-1-pbonzini@redhat.com> References: <20210617093134.900014-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52c.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson All previous users now use C11 _Generic. Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée Message-Id: <20210614233143.1221879-8-richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini --- include/qemu/compiler.h | 40 ---------------------------------------- 1 file changed, 40 deletions(-) -- 2.31.1 diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index 091c45248b..5766d61589 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -173,46 +173,6 @@ #define QEMU_ALWAYS_INLINE #endif -/* Implement C11 _Generic via GCC builtins. Example: - * - * QEMU_GENERIC(x, (float, sinf), (long double, sinl), sin) (x) - * - * The first argument is the discriminator. The last is the default value. - * The middle ones are tuples in "(type, expansion)" format. - */ - -/* First, find out the number of generic cases. */ -#define QEMU_GENERIC(x, ...) \ - QEMU_GENERIC_(typeof(x), __VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) - -/* There will be extra arguments, but they are not used. */ -#define QEMU_GENERIC_(x, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, count, ...) \ - QEMU_GENERIC##count(x, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) - -/* Two more helper macros, this time to extract items from a parenthesized - * list. - */ -#define QEMU_FIRST_(a, b) a -#define QEMU_SECOND_(a, b) b - -/* ... and a final one for the common part of the "recursion". */ -#define QEMU_GENERIC_IF(x, type_then, else_) \ - __builtin_choose_expr(__builtin_types_compatible_p(x, \ - QEMU_FIRST_ type_then), \ - QEMU_SECOND_ type_then, else_) - -/* CPP poor man's "recursion". */ -#define QEMU_GENERIC1(x, a0, ...) (a0) -#define QEMU_GENERIC2(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC1(x, __VA_ARGS__)) -#define QEMU_GENERIC3(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC2(x, __VA_ARGS__)) -#define QEMU_GENERIC4(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC3(x, __VA_ARGS__)) -#define QEMU_GENERIC5(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC4(x, __VA_ARGS__)) -#define QEMU_GENERIC6(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC5(x, __VA_ARGS__)) -#define QEMU_GENERIC7(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC6(x, __VA_ARGS__)) -#define QEMU_GENERIC8(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC7(x, __VA_ARGS__)) -#define QEMU_GENERIC9(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC8(x, __VA_ARGS__)) -#define QEMU_GENERIC10(x, a0, ...) QEMU_GENERIC_IF(x, a0, QEMU_GENERIC9(x, __VA_ARGS__)) - /** * qemu_build_not_reached() *