From patchwork Wed Jun 16 01:36:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 461332 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp111184jae; Tue, 15 Jun 2021 18:41:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoQM7rLCKV3l23J6h4Pldd2nHMOUsWCKK7z+vSmbLEhByiDqeE0n/GLh+6AsTJPUXcuq61 X-Received: by 2002:a05:620a:140c:: with SMTP id d12mr2622645qkj.228.1623807673750; Tue, 15 Jun 2021 18:41:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623807673; cv=none; d=google.com; s=arc-20160816; b=QK/Aehsukra2Rjsv7AT32nI9Cl1FTI2YWoNeVqB2yM8OnEL+bOqts8I2bTgzHfZh/m RcZ+xsiapAVIPXiSpEkuaS6Dl84UvtCnosg/WR7Kb2/NVghRNM07uKSvLwoSy/xcElnE gj2OkJA3NYeHmcTTt+pk2CRV6J+HGt+ZTKE6TFWV5V5GrFRGs+gttmXnjijlbPr0Oam1 iRmmuaPFtUVzMIl84OhSAcUYCDguC9FNGpKLrhDg+4ut4A7+NLJtx9Evz0L4o4SPfksQ 955UZ+DLrHH9QImmMvPRxM2gNsgXxTM88Y1iohH9EDLsxsHb41svkqxoxUVpw5PINvDi F9Qg== 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=AQdvWRX1hZO0Z1j1TwBSyfUR2Ola+BhQ1+6mdvjTZu8=; b=MSwmR84VZw4xmNe9glakdti25muMGS0CuA9HHBbhS1JTO3E+/Mshiuz7wcFIunnfAb JiE5ICfDlQatYTAPSitrW2xnrcO2rYiv3qD57sD/oJtVEbk5ovPyuPbmjtFhEZv3IYnk 7N8Fmz2MgYqinVbUS1dsyYAzCrlZ4YgJQAQXD0J0IYUeVKQomK1a3AmBXgvnG0KkjUer 6h1NOyj49lWEhRn0ZP2BlhFpmW2DbzGJ+FBzoYRBaPtxz/L8HjHsPk8CUDlY7NJSbpSB 35gBdVsBOb3x8FYmDkOvsy81ptzft4Y7BMXji3NxGy2zWFAaET/wQnwZ+2WHRdB3vHy7 LXjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vPOQ4kbl; 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=pass (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 c18si570176qtn.98.2021.06.15.18.41.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 Jun 2021 18:41:13 -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=pass header.i=@linaro.org header.s=google header.b=vPOQ4kbl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltKYL-0005tV-3u for patch@linaro.org; Tue, 15 Jun 2021 21:41:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltKTu-0008WP-1e for qemu-devel@nongnu.org; Tue, 15 Jun 2021 21:36:38 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:42913) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ltKTs-0005dm-8w for qemu-devel@nongnu.org; Tue, 15 Jun 2021 21:36:37 -0400 Received: by mail-pf1-x42e.google.com with SMTP id s14so857531pfd.9 for ; Tue, 15 Jun 2021 18:36:35 -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=AQdvWRX1hZO0Z1j1TwBSyfUR2Ola+BhQ1+6mdvjTZu8=; b=vPOQ4kblqHHKFJFGhsoJ+34RHM+LE0OI1Rc/YOuVIbBRlsWBS83oSnESr46+HWtDr9 QDCejuyic5MOZ76vzAR4IkIG585sOGmdXpQOsU7/F2e6r1CQS2gBoML9wiHPsSYgGmvO kB8C++9oAHLZyw3BrebegUneTn0X33zzSB5U3RtGVVfEyfGdE9HXiRJvJ1b5OO8Ai2TC NTm10oe4/cXW4dqIyvZpS/f4aEAGy0EE7UkJVRhxs+SImnPqUKXvQcK8gc0tIV0slMGr hW7KXKwG3BIRpkRXcgw6Y7zMquqxg3ZBKMt42QnjzVUdG9RRQ06sfb3/0chSre4oQh+G 9scg== 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=AQdvWRX1hZO0Z1j1TwBSyfUR2Ola+BhQ1+6mdvjTZu8=; b=AT4yUyG4EPO+CG15R4lQSol5uuwhdwoZta8d62f+C6JuNcqQedXURkZ8DNfV3cgOnW lt/KIXhRvs5Nf8yMdJ+4J23pjI8/WCFtMb1gnsdm+vYni5QkGR3nZ34L44BKvnaYVhF5 0ZcewQ7VxdacC9r3oZO8pVLnv+pY/IrXB9ONbPR8seSUoR+jpK4GkL+wc5e34E8ZKj4Y 7FfwgUQBeDWVm7xBpiddziXrjYwupJgDYLWNdQiv6LGT5Dfu95kGblSFbwm4FtKohM2n f2gi6r31zUvfmYMwxzeDzYjNW+3dDEejKLUsk4r1HMcuhv0x6cmQE5HklTlbIGiQEx5q BhTA== X-Gm-Message-State: AOAM532p2yoEuBGlctIMQYXl6MHmAYywxBMLI5XAON5yo+Mu4RcNJ9yJ 8KAal6hOju29ZjtxSQMyAjZtkuUJ6T4mKQ== X-Received: by 2002:a05:6a00:1a41:b029:2ef:9721:879e with SMTP id h1-20020a056a001a41b02902ef9721879emr7126393pfv.74.1623807394992; Tue, 15 Jun 2021 18:36:34 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id o1sm321595pjf.56.2021.06.15.18.36.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jun 2021 18:36:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 7/8] qemu/compiler: Remove QEMU_GENERIC Date: Tue, 15 Jun 2021 18:36:28 -0700 Message-Id: <20210616013629.1458790-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210616013629.1458790-1-richard.henderson@linaro.org> References: <20210616013629.1458790-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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> --- 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() *