From patchwork Wed Oct 13 18:22:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515748 Delivered-To: patch@linaro.org Received: by 2002:ac0:b5cc:0:0:0:0:0 with SMTP id x12csp135860ime; Wed, 13 Oct 2021 11:43:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzKtrNAvhK9fExPNYrHbsN9CH1mY5u/NfaXyBKkw+JzRw9psxyHgHgBRtVdnRCqEGxqP1s X-Received: by 2002:a05:622a:1343:: with SMTP id w3mr1175848qtk.203.1634150624002; Wed, 13 Oct 2021 11:43:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634150623; cv=none; d=google.com; s=arc-20160816; b=UVRP6ZvipRdBTVZy1a+mbou8IxOi1K/FeSUxOfM1DP4f1ZOMSW67uBqkrHvaWIr3rS +C5bB8XCECs0HK2NE+Arq4GyXhS+LTgKVGWpH+mSYMHrryI2kTohspTBherX27NlJ165 Ib5T9P3Vf/z2sUuaJlYeVbYLFrUtAr55egdUPzCPzh52maMGdRsVJ2nVcWFqIyM+54dp ufgebUYeP/qqzR4JZxWKqIUnhsVm+dDDSfQTH9KCxxORzv6m3aqT9FvORekG0tH+P1gy Q/Rr/AUcpB+EFavrO4VO1+DN+WBfZ07Gi+e2kcTwyzc7fHz12HzD0esY+Qpq4Zuas52w yh0A== 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=bz2REULCzHKajB4ycqBwv38V9RL9tjgGVW5Wur1hkTg=; b=Z519ie+ZHaqouggPlphoNVjvEJjgbRXZo7EUHJfFac0jYcdne4T3aDNlhckhtj89bD 7ZkMy5ccGjtNVkrZmNi5PDzJV2kDHOGLR/0FpUIhz9yidx0RBkOfIFVjjqWqvHycswwR xiC6NJtkUauzyyuug+Qv8njajrWiV/XYsNtano+GtOvUz5WDzqEcIcvep4kipet3+baS fPkR7XkGZQtU+X7L7OxGPzB3cnybyPX0T1UzjEbmi55Kr+eDKycrIFsxGGpVtWsH81UW ilgDgIxcs+UNQSsnL4moex6qMgVer6jDRxuQ8aodib5A9wzak7Se+911VAOpUu0JQxdv eHMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wcTxMbgk; 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 bk24si251614qkb.399.2021.10.13.11.43.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Oct 2021 11:43:43 -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=wcTxMbgk; 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]:53356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1majE7-0004ZJ-Gt for patch@linaro.org; Wed, 13 Oct 2021 14:43:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maiu6-0004FX-1q for qemu-devel@nongnu.org; Wed, 13 Oct 2021 14:23:02 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]:42730) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maiu4-00039C-Ch for qemu-devel@nongnu.org; Wed, 13 Oct 2021 14:23:01 -0400 Received: by mail-pl1-x62e.google.com with SMTP id l6so2396312plh.9 for ; Wed, 13 Oct 2021 11:22:59 -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=bz2REULCzHKajB4ycqBwv38V9RL9tjgGVW5Wur1hkTg=; b=wcTxMbgkpmTvsOGlBpJsfZRbMFqy1HF9MT0Fa37X3uxs9ae2vgORV6XYWKcZ6zwGYF WSYL42vrB/ndpXFw5WSFns/QkEr8CW3MPY96CIBnNFciVsZDl7ozeR2ndAQknJYsuGPG Pu1JF/xzsuAYUEYujk8bpO8JsYYIv7r27qMGwPDxF7m70XNftirFCJy4nFk3+0Cm2giu 5yobQLLjKuSC88Sm2S/VtOatpuMVrTgpvLJlYueXo034JOmd8ijq3gkMdyLhb/eZLaoZ OLQPq8u0k7q3N1a9tgYrDNm7Jh+mlH/ZFJoFjZe58/I//en1kFUFx1lByoPWTG9Nk3fd J/Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bz2REULCzHKajB4ycqBwv38V9RL9tjgGVW5Wur1hkTg=; b=PKkda110Sy6LvtrGHAwzNLM+s9U6RoZ+dKpIMnsZVuDTxsqeWES9SVYe8brXkKyFaH dJY0bgZjha/qC7/YRqqK6O5Hll3xhE7VCVZh6yMjvArR3Ra7GLSZt/IDPg2mD9RdARMm jJMLU/7AOlsUphl07NaDK+RsfNZwY96Zqg0St7shiHP4LSiJooJQGCp6l8o/Ja4fdCBI uxXeowfDV2LISol0cgXffKhZOLCQjLG3SNOUxfhlD95hBdsbnbc5j0hzGTwCrmHROfxe uLe7gTjmB/FSXB+e8JSNdaqiJRUtCOMr4bNaYBdKMZpFehjXgumfERMJ5nRtm/GswmgC ts2w== X-Gm-Message-State: AOAM533MdPzLfsdUR3Mam/weWMvW3hf7tj1LA4Fp/JJupT1APb5VxQIf Ag9f0ovP6v0u+cInc4H0orb7Lhb+QsHCwA== X-Received: by 2002:a17:90b:3148:: with SMTP id ip8mr952658pjb.62.1634149378942; Wed, 13 Oct 2021 11:22:58 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id z2sm177140pfe.210.2021.10.13.11.22.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 11:22:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 15/15] tcg: Canonicalize alignment flags in MemOp Date: Wed, 13 Oct 2021 11:22:39 -0700 Message-Id: <20211013182239.991127-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211013182239.991127-1-richard.henderson@linaro.org> References: <20211013182239.991127-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Having observed e.g. al8+leq in dumps, canonicalize to al+leq. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg-op.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index b1cfd36f29..61b492d89f 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -2765,7 +2765,12 @@ void tcg_gen_lookup_and_goto_ptr(void) static inline MemOp tcg_canonicalize_memop(MemOp op, bool is64, bool st) { /* Trigger the asserts within as early as possible. */ - (void)get_alignment_bits(op); + unsigned a_bits = get_alignment_bits(op); + + /* Prefer MO_ALIGN+MO_XX over MO_ALIGN_XX+MO_XX */ + if (a_bits == (op & MO_SIZE)) { + op = (op & ~MO_AMASK) | MO_ALIGN; + } switch (op & MO_SIZE) { case MO_8: