From patchwork Tue May 23 13:47:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 684929 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1729405wrt; Tue, 23 May 2023 06:50:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5kqPWV5WKc5QLwe0TqnoHuTMixXq5zcVcO1OFapickL3bpXnAyMSBLTTTP9wP9ramzPBS9 X-Received: by 2002:a37:c16:0:b0:75b:23a1:d846 with SMTP id 22-20020a370c16000000b0075b23a1d846mr4484346qkm.8.1684849803905; Tue, 23 May 2023 06:50:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684849803; cv=none; d=google.com; s=arc-20160816; b=sDI+teZxC6u4gWpZNMqqgNtPSqGlrABM8804UH7M8zHwsOWdDMI5GBlG4EFq+iMqoG +9JbPd9dcsH0AFjAbR+u5DX9j4NM8SxkC7r122zqiA+Jd9ZAS5gaQ4TEVbAMqiBIfVpC e7wKiVe+qQnN89/34oeX4Ufh4Nb/fxO3b0AU1G0/XLzDijOoUmcahwDWwzzVE6t052BX aKMrdRIn5N6dvYWFGptuOM7segy0W7yKB3Z+iC1tDvxxAflUdAegbCYpQAZD6QN7z+KL r3s/izD2yFKGPd7yBrptBzb0vCnDhZpH5C5rUo0apif3oK7dM4R5M65qlggIzE8I2a5m ZKiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=2/tTPPnUnjG19dY5X021rmXFRG/giw/axI09dO2DG2Y=; b=KDlombvxof5IhRgQLNAEUU4zXti+FpdaCF3CCBWjI4cyrhDIE4Zn8vl1OnLubq7Vay COmTw4GYUpBwL6YUT2BXS88CZKDdfqhU6uHKQO4XdbuwvSm3zfj26X/RD5Eo8JHNe1xW 0wobzX0BpH1NP4J3NuS+yCLZEE8O1AgG1sLVI1S0id8nqhjUPBYunb/p226CfVyaLox+ 6WoAVGOQiFxkLdV/UTKQYW4+LFDLxUJe//Iv2i/Ijb1rSbZ7ldkKTid4UnGlsoLKNwhZ OAFEgAS6exuWmWfNVP4gJtIZu3F1f7Gzmvr8NGjSvoq6YH03Df+seRkAcokxoag0sJNy h6Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Cv/xlKbw"; 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 iy7-20020a0562140f6700b006239c39fcabsi5345676qvb.540.2023.05.23.06.50.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 May 2023 06:50:03 -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="Cv/xlKbw"; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1SMr-000151-4i; Tue, 23 May 2023 09:48:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1SMq-0000zB-1T for qemu-devel@nongnu.org; Tue, 23 May 2023 09:48:00 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1SMn-00019t-9g for qemu-devel@nongnu.org; Tue, 23 May 2023 09:47:59 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-64d44b198baso2519528b3a.0 for ; Tue, 23 May 2023 06:47:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684849676; x=1687441676; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2/tTPPnUnjG19dY5X021rmXFRG/giw/axI09dO2DG2Y=; b=Cv/xlKbwfHDjFIVEvo52S3jsphYvFbzTMmeei6lnkN1/zTl8n+VjGvVmFw0C3hH0lN AAb+m2pmrpT3Tw7By4VlSWWF2g7QUIiAJxbBojtVNjKYNpJHj/zS9U4XyT73gpyod7F5 p5JET3zAq+U36ZFmbd1sv5kNiSQkSF4pBzCf3ny97KTJNUzNcTRcfVQnao1MM0n6FicC FEBKdQ4Oj7fCpzHJjUbnOjSWRsyTyQcFsNr99Fplmk67WtbgTfzvc4Wh5aNYHI1rQuCU hp16a50scpkrtRFItQu1a4IXQ/iu52EjAg7c+AnOoBQoH5kOEocZxCdb5XdHeUESmYz2 xLFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684849676; x=1687441676; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2/tTPPnUnjG19dY5X021rmXFRG/giw/axI09dO2DG2Y=; b=AnMYWUqkWybc0X4NNh9fX9KqbbH5EMJYAXhN83S2dZwIpNRptjZUGyD62r1WOTtfth 2fXaVi93QffDfpIvkv12RDn9Dh3VwFBwntQxmIf/4ksXkCzn/6DM72t1r6S3XaNIOwOg 2123mtkuf0MW1gvM7H1vRQYMTT6Utqd9RfJOLrF/d+LFkW5zlMm2YBfb5ou/cl5dMF0e 7xFtDEkLEbP08yj1iPqEMYqvJ7AZk6NEdpLxjE+SMRvxn1fKtIWGTLCCbh3OYoi3JLUJ T1YRxIlq+SCfPMlidkkLB2x03iAwF1jvZ4zmLDTbpC6qgKbS/YTjOMxxV1o6sXuVJgTJ KcCg== X-Gm-Message-State: AC+VfDzJFBrnFXZ3KnP+ZjXa7es5/+/ifedxgv4DbsB3kDsRX7BA2vI5 Uctzn/GA3iaoZEbRtVNPCn0YJERkYc6leo6MSAA= X-Received: by 2002:a05:6a00:1d1d:b0:64d:5683:1977 with SMTP id a29-20020a056a001d1d00b0064d56831977mr8699175pfx.9.1684849675784; Tue, 23 May 2023 06:47:55 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:c13a:d73:4f88:3654]) by smtp.gmail.com with ESMTPSA id j4-20020aa79284000000b0064d1349dc31sm5737122pfa.199.2023.05.23.06.47.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 06:47:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 24/27] tcg: Split out tcg/debug-assert.h Date: Tue, 23 May 2023 06:47:30 -0700 Message-Id: <20230523134733.678646-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230523134733.678646-1-richard.henderson@linaro.org> References: <20230523134733.678646-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée --- include/tcg/debug-assert.h | 17 +++++++++++++++++ include/tcg/tcg.h | 9 +-------- MAINTAINERS | 1 + 3 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 include/tcg/debug-assert.h diff --git a/include/tcg/debug-assert.h b/include/tcg/debug-assert.h new file mode 100644 index 0000000000..596765a3d2 --- /dev/null +++ b/include/tcg/debug-assert.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define tcg_debug_assert + * Copyright (c) 2008 Fabrice Bellard + */ + +#ifndef TCG_DEBUG_ASSERT_H +#define TCG_DEBUG_ASSERT_H + +#if defined CONFIG_DEBUG_TCG || defined QEMU_STATIC_ANALYSIS +# define tcg_debug_assert(X) do { assert(X); } while (0) +#else +# define tcg_debug_assert(X) \ + do { if (!(X)) { __builtin_unreachable(); } } while (0) +#endif + +#endif diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index cd6327b175..072c35f7f5 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -34,6 +34,7 @@ #include "tcg/tcg-mo.h" #include "tcg-target.h" #include "tcg/tcg-cond.h" +#include "tcg/debug-assert.h" /* XXX: make safe guess about sizes */ #define MAX_OP_PER_INSTR 266 @@ -222,14 +223,6 @@ typedef uint64_t tcg_insn_unit; /* The port better have done this. */ #endif - -#if defined CONFIG_DEBUG_TCG || defined QEMU_STATIC_ANALYSIS -# define tcg_debug_assert(X) do { assert(X); } while (0) -#else -# define tcg_debug_assert(X) \ - do { if (!(X)) { __builtin_unreachable(); } } while (0) -#endif - typedef struct TCGRelocation TCGRelocation; struct TCGRelocation { QSIMPLEQ_ENTRY(TCGRelocation) next; diff --git a/MAINTAINERS b/MAINTAINERS index 1b6466496d..a1b99a31df 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -157,6 +157,7 @@ F: include/exec/helper*.h F: include/sysemu/cpus.h F: include/sysemu/tcg.h F: include/hw/core/tcg-cpu-ops.h +F: include/tcg/ FPU emulation M: Aurelien Jarno