From patchwork Mon Jun 21 23:18:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464631 Delivered-To: patch@linaro.org Received: by 2002:a17:906:71d0:0:0:0:0 with SMTP id i16csp4674029ejk; Mon, 21 Jun 2021 16:29:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxT5BqiYW7hYKH6IwdFWnR0VHT+IgtuW82G2P5sJtzEVdcEUxfdH0WMuAGdj/e3ytVLdiqe X-Received: by 2002:a05:622a:14d:: with SMTP id v13mr975775qtw.119.1624318183912; Mon, 21 Jun 2021 16:29:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624318183; cv=none; d=google.com; s=arc-20160816; b=NsVbDkirUwFA+CEXB3Myb40VlzgpRS0wBbFsMmr/Rcqh9o3/reydprCMvN2wP/XOCt KbK11OL4894Dzx8oESefeMt0ofv5cI1xMtSRuozSKtskA7Xao4Cf4Etvr0Kcicx0wvFL tc2qn3fV+DTu+i7fmq8opCBZ4zCxJBjptzYYk/BZVOaPMEpGnl9+eP21fZG0aJIrhjVt Vq0uD8y1xohSFvMyOPnpLAdxVu6FrYa5+tC4W8ibZEz1py2BZ9c7qTEAjZq/cFoxCOZN gbB1YIMOsDfaUItoWzbqZZzVrq9VFvN92mJu2V78epjqkY3izl3HQWelLcDCqgKE61sS 9Jbg== 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=hFW7/uteqhUz14as6VIJ+oMkuxFCaj8xI5hXiJ/YKgI=; b=ndqoIAhl9RyJM0tcAaSCzluGJL5WRPtdwhefjHzsjPJ5KiWzPf8id7Jtfty65pe642 ZqJbEBVRh70nYCgfDSDGQ0IUuiLTMRQrTFF0GctnJ0SgH2bO2hYVM1rXevwxUt7OK3JX SYnGVbFWc/QPXDtcoGzIRMQWWfgCJxFF/Cy7m3xaNs7UbwGI8Aw031+5oKCB8qm9RDVo Jlt5LPtB7g20aNk47p/e1NxKLv0L6iNLYlU5QpfBQhc/f2JPiBXuF8jK0gW0+qOHmrGR fAhjIk6233dAcoL74N3edfyOo1FMQlFWxB0gG2bHZDpTr1C+NsyqDIBBgPgIpfrtjrWf qgFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QWDYQFI0; 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 g19si327528qtu.350.2021.06.21.16.29.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Jun 2021 16:29: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=QWDYQFI0; 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]:36166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvTMN-0000MR-5p for patch@linaro.org; Mon, 21 Jun 2021 19:29:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvTC9-00016a-8P for qemu-devel@nongnu.org; Mon, 21 Jun 2021 19:19:09 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:44627) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lvTC4-00060Q-Vy for qemu-devel@nongnu.org; Mon, 21 Jun 2021 19:19:09 -0400 Received: by mail-pl1-x62c.google.com with SMTP id x22so7868067pll.11 for ; Mon, 21 Jun 2021 16:19:04 -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=hFW7/uteqhUz14as6VIJ+oMkuxFCaj8xI5hXiJ/YKgI=; b=QWDYQFI0LBjXyfF2Ce2krLlYi+SZY3ziVkdfg0oTOOeV3UxLRi/FJNovh4TVfRdCEP 1MqXLXTz7G3qH5e1Duy2wvYoHaPJGrjJfNujfMwQKNBPosgAJRCJJS84RTwjctSUwW1w pE5rylffjwUvCZHVC3EoEkgK6GSe7Ytk9H0LKTzpMPIlhJO0yY6Wydm2A6ibXfqChNEq AHP+LJHqnmBegM2AgbpleuIFM5cz9g9tCNwUD/GzdXaVfF6SxEygW288EL2Nn0NhPs9Q 4L1/DQDoTmf02aNh+12rS2/aWlzcnqfDjyEL8UFCrWEXmdYizXg1eGnwk5D4vpCtFSeE hd6A== 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=hFW7/uteqhUz14as6VIJ+oMkuxFCaj8xI5hXiJ/YKgI=; b=S/DNEM0pqFq6DFdOxxhDa7AUZ7hoEen+EvPowUw5oZi7DsjYjnRmNRMEm9YK0OsRvT cvdEDBGyA3WTpool0N/yxCPstG7s6+axrxE7z6CZ+MvaiMoRLH9KPnWxFDHDMNnCA5st f2kljUwmpKwQAvH1jp7hZtqqDMqiraxGkhnzj688z0dhO88XR53ZDwek0GOhmtOCn6RG b4HRHDEnuFYBvdelsNJ4oH5jY2Fg/QsUm9+h0qam78cbw9fpl+MjEyREbsdNxVnTjVtu at2GsFBiNVLCIOWHnp30fVSbKf1hQFfb408HV0Ng/f8ITBnun8QRn3ZURmHsbqg1BSeP AcAw== X-Gm-Message-State: AOAM531XYMyXegu29UTDCcmudR3ELrPjiwWok9LrwIZgsEU951r0Rl2l MEnImG+IftAOBcufwIT/mBHMP8zqfCPtVA== X-Received: by 2002:a17:90a:de07:: with SMTP id m7mr675142pjv.100.1624317543688; Mon, 21 Jun 2021 16:19:03 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id 135sm14429952pgf.20.2021.06.21.16.19.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jun 2021 16:19:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 20/29] tcg: Make use of bswap flags in tcg_gen_qemu_st_* Date: Mon, 21 Jun 2021 16:18:40 -0700 Message-Id: <20210621231849.1871164-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210621231849.1871164-1-richard.henderson@linaro.org> References: <20210621231849.1871164-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" By removing TCG_BSWAP_IZ we indicate that the input is not zero-extended, and thus can remove an explicit extend. By removing TCG_BSWAP_OZ, we allow the implementation to leave high bits set, which will be ignored by the store. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/tcg-op.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) -- 2.25.1 diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 0eac2d1969..44d711c0fc 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -2915,8 +2915,7 @@ void tcg_gen_qemu_st_i32(TCGv_i32 val, TCGv addr, TCGArg idx, MemOp memop) swap = tcg_temp_new_i32(); switch (memop & MO_SIZE) { case MO_16: - tcg_gen_ext16u_i32(swap, val); - tcg_gen_bswap16_i32(swap, swap, TCG_BSWAP_IZ | TCG_BSWAP_OZ); + tcg_gen_bswap16_i32(swap, val, 0); break; case MO_32: tcg_gen_bswap32_i32(swap, val); @@ -3013,12 +3012,10 @@ void tcg_gen_qemu_st_i64(TCGv_i64 val, TCGv addr, TCGArg idx, MemOp memop) swap = tcg_temp_new_i64(); switch (memop & MO_SIZE) { case MO_16: - tcg_gen_ext16u_i64(swap, val); - tcg_gen_bswap16_i64(swap, swap, TCG_BSWAP_IZ | TCG_BSWAP_OZ); + tcg_gen_bswap16_i64(swap, val, 0); break; case MO_32: - tcg_gen_ext32u_i64(swap, val); - tcg_gen_bswap32_i64(swap, swap, TCG_BSWAP_IZ | TCG_BSWAP_OZ); + tcg_gen_bswap32_i64(swap, val, 0); break; case MO_64: tcg_gen_bswap64_i64(swap, val);