From patchwork Tue May 23 23:58:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 685245 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1989045wrt; Tue, 23 May 2023 17:03:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6yUDgpahFk+8nwAwVYj6c00zZLqtcdj+yfqpeGCjzcUimWrOLkiNFfckQ7l3ste8UZi8RH X-Received: by 2002:a05:6214:27cf:b0:625:aa48:def7 with SMTP id ge15-20020a05621427cf00b00625aa48def7mr43267qvb.55.1684886584731; Tue, 23 May 2023 17:03:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684886584; cv=none; d=google.com; s=arc-20160816; b=a30X7pRnKFlyhCfmdShyaI6SxW9hGikqIZlnXrJ9gnkQdYa3b1idN2EzzMSXiBgzaE C9mIKXTccSE8+U9NqtQG5YWujrbOn7d0ES51DcFt6VGVyyJhiPkD5yuCEiIqWnN60unz o+iH44Yjv9MJ0kW78pMxMvKaGd+rcoxgh7zIt5Y6/Y2zULbsCMnNMZIeSOBSXChsX9bp JgMr+5aaNI7wY+ivCWmIkYOppLrMHbXx+XCU2ME636MUrNoiuOMlChCTYySEphr5kTj7 arCG7dDasTtC7kWMJOWKx4n10VtV8XhHROkx7qjHrY0ewoDy7O12laq+7T4U6AhuKiB6 kChg== 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=r5f4Ylw8IiZ84PTvuG5q1Iu6daSgx3AqNPjCHwsi6/0=; b=Zap+1MVy0ACyQ95WX+EGN+0DM4Q3Gj6qf/hZaWZ5YVm2e/2YWkVG8RiBLF9855Q60C 5u9Ds2ThFkMDtDvaVUcYYVowadyjWgBQT/VSN+sBnY583fbclooqp0duZ3f3w3CIoI/k R8b2xOXS32tcnZOBByDBAO742ayfwZRZFtVDIHWa5BvR206u3Y+yELL4Y9/jRyQFDp29 bYrBfL5bwr4dVW7Cl0mAn87f6CH+LA5+1GVCcGXXR+tt4U1e652fQmxve12uSwL9ZUy0 MlBKM3ZLfhc9O6uHMqBeGHFzBQHXhl29y3941r7fTbA/F0EB0QpgIHC6USVwQgniMyEy l/Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qPwjaFS0; 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 3-20020ad45ba3000000b006257782665csi4345004qvq.131.2023.05.23.17.03.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 May 2023 17:03:04 -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=qPwjaFS0; 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 1q1btx-0004Mb-6l; Tue, 23 May 2023 19:58:49 -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 1q1btl-0004J4-Cv for qemu-devel@nongnu.org; Tue, 23 May 2023 19:58:37 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1btb-0001ng-5j for qemu-devel@nongnu.org; Tue, 23 May 2023 19:58:37 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-64d426e63baso168733b3a.0 for ; Tue, 23 May 2023 16:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684886306; x=1687478306; 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=r5f4Ylw8IiZ84PTvuG5q1Iu6daSgx3AqNPjCHwsi6/0=; b=qPwjaFS0qgy3Ro2PjaQ0cezPAsMbPyAi2tZlsGpAbg27vZHmH9vJ9SaN7N2RSnkehn LLo1+XEBB1zeQI1eunjmXKa1+xBupSc7m/NXto82qk8hUd/G8mdgqvFuqA0X4HGZ590y wn6OMbm4F+VbQSTxHrjKjs27OyPcvicsDN5ZEdiQK5+CKeqMwMyNTloStmRPoeH5UbnY 66dv5kl50BrLL63YhptlJr/ggjuUpw0/AvIw6DNr+jPjPlQ0PDDIrw8HWzBxsHrrlPES 8j472ZFNSHazRRgetQK++On+OUoj2RoGvYLmOKHaIXDFV/E2JxoMs3bL16FmEo0PFIhp jNRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684886306; x=1687478306; 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=r5f4Ylw8IiZ84PTvuG5q1Iu6daSgx3AqNPjCHwsi6/0=; b=CjsZmw4MlMNFCSpRScP+IYHcELibgm1DxsqR77Vm4ZKr3mSVW15xvPO/nohWGIRb7H HZPS8Y/4KF5wrmwJ5lZEgGq69hUULU/U27w8CFg8dSP15V68+GEmx2UxxJQZ6y21sihO aW0ufGQtujEAB1G4NQNZBY2Wj0VIKCzCH1Yo2roDQKF/sUQPTT/6y3zNvDjMNd7ZpJ/F b+dtgmZcopc3flEnLZbNoHPPjKq754FkIB6yyuKPPOh7hVsBbzild4is2V1xw0pwhEYI KC4mDJSTuMzSjZi5tSy52lrOTozbt7J2gk84XCiWDbm5iQqqlAgQh9mR0FfBkQ+pfQKe /PqQ== X-Gm-Message-State: AC+VfDwE4HQFssaWkWLcXtOAbqjaV1sH1Y/GqHXYvACxIE3C1ImowApl aqeIX93vj+zb7UnFYjF5+iNoqTzoYcsGuLTRkHk= X-Received: by 2002:a05:6a21:3293:b0:10b:7b64:706 with SMTP id yt19-20020a056a21329300b0010b7b640706mr10352933pzb.13.1684886306417; Tue, 23 May 2023 16:58:26 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:c13a:d73:4f88:3654]) by smtp.gmail.com with ESMTPSA id p18-20020aa78612000000b0063b7c42a070sm6285041pfn.68.2023.05.23.16.58.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 16:58:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PULL 24/28] tcg: Split out tcg/debug-assert.h Date: Tue, 23 May 2023 16:58:00 -0700 Message-Id: <20230523235804.747803-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230523235804.747803-1-richard.henderson@linaro.org> References: <20230523235804.747803-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- 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 1a32066231..1c93ab0ee5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -159,6 +159,7 @@ F: include/sysemu/tcg.h F: include/hw/core/tcg-cpu-ops.h F: host/include/*/host/cpuinfo.h F: util/cpuinfo-*.c +F: include/tcg/ FPU emulation M: Aurelien Jarno