From nobody Fri Dec 19 18:59:22 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) client-ip=209.85.221.41; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f41.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1635025731; cv=none; d=zohomail.com; s=zohoarc; b=eASm7+1hb9WEVKL57K0WqXpdtFVLp1qJO8Vq1XfEDUgelbIJ3BmTugoZocKy43G3HgI9w5BiXpsNzb7C0G4hVYRA5M/BhB6RDlDZ32bZyGKJ3q8RrzzCvMMXyPJNUpXQjOgobCByB0ThMT+vpvpl95NupvFdiVbxDGWPs8/Yf10= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635025731; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PVaCg6GCUpgKGbLvwmrR25Suk0A+VaCfoj7O99m3aJU=; b=an4m0IHPil3XL8Lg2QUmaShhPO3T0eIg/I5MEhAORk7RJJNC6e0Nk9znpf0ssH8pn1gW5moAcvnvJdbI57DNSjBMDuvo9MB9Z9zw2QjpbG4q+6rqQDNcXh8PRSlUDZgrwuYAL37eSs+cLbg6qZcgRUNmyYWmGb3+nx26JeQiuXw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mx.zohomail.com with SMTPS id 1635025730997688.1576886576067; Sat, 23 Oct 2021 14:48:50 -0700 (PDT) Received: by mail-wr1-f41.google.com with SMTP id v17so3521661wrv.9 for ; Sat, 23 Oct 2021 14:48:50 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (62.red-83-57-168.dynamicip.rima-tde.net. [83.57.168.62]) by smtp.gmail.com with ESMTPSA id z26sm2160562wmi.45.2021.10.23.14.48.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Oct 2021 14:48:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PVaCg6GCUpgKGbLvwmrR25Suk0A+VaCfoj7O99m3aJU=; b=QxDRmOK+MIecQYm56Q/iD3FeD3Mw4WPqXJCMWwhB30Sg5XZzeMMPBB4K+3IGtNF14U m5h61wzDidXAbCiqfX7jSTOkH5kJD8QsviMv0hWJLAW/ponzv6KWSK6qGoXYlFNJ2SQ6 EvDveLwpwkINDeIQknsncxQ2UdJf8s9pipDH3xFKhLbP7G7TSXSqoA9PgkVCjqHIJABM Blhjoy9NdZuhjlO6fh2LpvNqNUlhHi1v6QcfD0CKsoN+NMJIpGjqs5ovO162TCJRXqq2 tzehR32YqrzoVxF515qGA8zV7K9EnT5XUD5ex9CYsvxRGk4nkXO3T8sh19LCN897tDLz Ltuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=PVaCg6GCUpgKGbLvwmrR25Suk0A+VaCfoj7O99m3aJU=; b=JILLk4NDT7xpCShk2aBc9nbsISaOu6nmT3prpQ/1Gf6Boa52s08UfS2mChjEAlHAOY TCe4Vm6Cqa7Hbs6heq3/yZGs/2/UxEh/N3qG27FYRvNnqMv6JeIpfapBSnzBer3PdCbh LDoEvD8hlQEmVx9wFYzi6nkdLqe553YQbv+/euyVclyhwBWJTm8zRZ1o2++jjyJ2bUeD Mwv08axOf1RGXHMC4kZSO1iUSTH8FAKQlHJWo/ckanKSntsLToH0CgunKAFBkR0ehSl5 MjnjhqVyiVKEik29EbE+shcP/r2iVexKEB+JSUd3P7uZjgUYcHix5WUYjOkN8BoFEPUB NIyQ== X-Gm-Message-State: AOAM533v62eDEWgLGKBby8q+wNP5f9FwUtopZPfQUJfc1cmtPkm2QYyx zbEbww3zjWBiSRoYG7KSmurpM9HsEyo= X-Google-Smtp-Source: ABdhPJystEv0Cn7c/tICY5XlHxYqVaUNT9N+6ppn444ag+u0FwCOKfY6qvouwamEVY5lr+BCA73hng== X-Received: by 2002:adf:edd2:: with SMTP id v18mr10614122wro.104.1635025729319; Sat, 23 Oct 2021 14:48:49 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Aleksandar Rikalo , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Luis Pires Subject: [PATCH 09/33] target/mips: Introduce generic TRANS_CHECK() for decodetree helpers Date: Sat, 23 Oct 2021 23:47:39 +0200 Message-Id: <20211023214803.522078-10-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211023214803.522078-1-f4bug@amsat.org> References: <20211023214803.522078-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1635025732519100001 Similar to the TRANS() macro introduced in commit fb3164e412d, introduce TRANS_CHECK() which takes a boolean expression as argument. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/tcg/translate.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/target/mips/tcg/translate.h b/target/mips/tcg/translate.h index 6111493651f..3ef09cc50c9 100644 --- a/target/mips/tcg/translate.h +++ b/target/mips/tcg/translate.h @@ -224,6 +224,15 @@ bool decode_ext_vr54xx(DisasContext *ctx, uint32_t ins= n); static bool trans_##NAME(DisasContext *ctx, arg_##NAME *a) \ { return FUNC(ctx, a, __VA_ARGS__); } =20 +#define TRANS_CHECK(NAME, CHECK_EXPR, FUNC, ...) \ + static bool trans_##NAME(DisasContext *ctx, arg_##NAME *a) \ + { \ + if (!(CHECK_EXPR)) { \ + return false; \ + } \ + return FUNC(ctx, a, __VA_ARGS__); \ + } + static inline bool cpu_is_bigendian(DisasContext *ctx) { return extract32(ctx->CP0_Config0, CP0C0_BE, 1); --=20 2.31.1