From patchwork Fri Jun 11 23:33:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 458528 Delivered-To: patch@linaro.org Received: by 2002:a17:907:7409:0:0:0:0 with SMTP id gj9csp701628ejc; Fri, 11 Jun 2021 16:38:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypWZ7F6M4nHQoccREQ8hoc7uCucUFVVhyuNASz/Z4I55ZHA3DOrGFrynhifSL5aW2jJlcM X-Received: by 2002:ac8:7289:: with SMTP id v9mr6079286qto.282.1623454682996; Fri, 11 Jun 2021 16:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623454682; cv=none; d=google.com; s=arc-20160816; b=0cTAhPnLf0f9fWwGkPIzOYbSw8MmAxpFkjdwGH7bj31O3JdriaLFLD9O/i8teogE63 5gNuvcbsffPKPEJIHh1dx72w8G2UINdqE58kOF59I8ONTRB0jaxP/6Qof1Nj2KZDFPM8 JhtN48czwwD0AHUkiEipTPs2+Dcba0cwlQOtdQkotmqi6Jv3KYi3k6M5u7STwAedYrTd sriNlyIF5mjjeDLoRv9w9lkAANSHQj8drMd2S5MPD58OKnk5Kyqw4+kXacPJBpt1LzvB B0wmSaMkeBGpQvWmoC+95CieHR8ADqXS1v7zsSJP7ZnlnmVB1dLIHgPaVevBZVjAAinp BStQ== 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=RxSlL47QCgmK8Iv/OFfxyjnBl/oZ5mr2j/ZWvknI6kU=; b=f1BQNT37cXELcRVlxCCeKFvgekGBi2m9gKoeeY4TUW9otGLYv5dXgDsJGhNHKQs0bN 4UhbbF3+MdBFsHLnMqZCxhlUXE7xyp6TRnwRjMIfiro+1S3IBPSHqh+/KJrcvi8mff1J tlA8REeGSgeOOQaw0h2zvwP5Gz3xhdNfiRbHRFeo7BhRb+nbFt7VEaCR4BQuhodQpsHL kWRs6JQn5C4LaHVE/zPSN0mF+FU/EM0hE2q54Ijjy7HcPgxvBF8B1CdrK/ZqSvIfMBKC soaS+DHCNbGLh0Hww9/USr5tUtMhY/uD36FC2gurxtYeVu0JaAiMjdcbemZGDBNHYOeT PbtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nxsIGjv9; 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=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b9si5299398qvv.185.2021.06.11.16.38.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Jun 2021 16:38:02 -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=@linaro.org header.s=google header.b=nxsIGjv9; 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=linaro.org Received: from localhost ([::1]:35188 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrqis-0001f5-Eb for patch@linaro.org; Fri, 11 Jun 2021 19:37:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrqex-0004IV-Aj for qemu-devel@nongnu.org; Fri, 11 Jun 2021 19:33:55 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:39527) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lrqev-0006Rc-Is for qemu-devel@nongnu.org; Fri, 11 Jun 2021 19:33:55 -0400 Received: by mail-pj1-x1032.google.com with SMTP id w14-20020a17090aea0eb029016e9e0e7983so179152pjy.4 for ; Fri, 11 Jun 2021 16:33:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RxSlL47QCgmK8Iv/OFfxyjnBl/oZ5mr2j/ZWvknI6kU=; b=nxsIGjv92sdm8ViNINgPIcps2G1dt9JkIDKiyAaCsZGZ9RGvK/C8s2pScqcKGNbyxo dHR2qmJU3vFQ2zT3Pt3uXnIcdufx0YMLRMDfOp4CmBjKjCNEnssMQeJrvYKZp7lg3cpx FmGE5xuW5+9fmBpxQa0SqTeKYG7MPn64ieGywBWK99rJ97UGsxg3binbqC6e5osSwXsZ OyLuIQ36kcrch5CfbDhfIH9O5KeBUVrDma021Iv6UBXhOfiBeftJgLAr98U7w2Br+GsF anVs8AZENYJ3xz751aqqxEPTWP3RDQjZRprIZDcponY0E6dJ0NPJyocI/pqkNn0FMLZx 0ATA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RxSlL47QCgmK8Iv/OFfxyjnBl/oZ5mr2j/ZWvknI6kU=; b=WTKQD4xlbOq7o9VgYeerlh4aXdLCr8vIo7cnLHr9G2mYJxe9iDgmTc+GaBZC0Xc5vm 70QxLstmlDvyWtkjkNP+gopllj9EpT/tKWPjgZ//dyFEMmeQMzc4dbjtNDpB2YB0BHjz EqYPKl6p2DrJ4eD03F3qcGCy5mjHC8Z5ScZsT9sAlPrBHvRTWLcBGb2UoJUOJvOUs1wL CQLi0qxNnkxkAmQUa38ecnG2Jo3GdS9x2VeJJpxNqp+mSDz4w94v+X8EK1dkS/NyjGvf vE5BFmaepq21mfyPeEQDmhxcB99J4X5YcmJdMatgLVsFJz51hb9s9SmkqcdKaSfR98vL w4nw== X-Gm-Message-State: AOAM5311aBEQiREh77sL4aqSy68mgx/L17BMcnxJPNUIXtgUJslbySst qu/5v5K0MHdioGXCbJGOQMuTOWzOn/z9rQ== X-Received: by 2002:a17:90a:bb97:: with SMTP id v23mr6637529pjr.148.1623454432236; Fri, 11 Jun 2021 16:33:52 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id m134sm6349606pfd.148.2021.06.11.16.33.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jun 2021 16:33:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 7/8] qemu/compiler: Remove QEMU_GENERIC Date: Fri, 11 Jun 2021 16:33:46 -0700 Message-Id: <20210611233347.653129-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210611233347.653129-1-richard.henderson@linaro.org> References: <20210611233347.653129-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: pbonzini@redhat.com, thuth@redhat.com, ehabkost@redhat.com, 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 --- include/qemu/compiler.h | 40 ---------------------------------------- 1 file changed, 40 deletions(-) -- 2.25.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() *