From patchwork Tue Nov 20 12:15:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 151575 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp533662ljp; Tue, 20 Nov 2018 04:19:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/VMrjBGM5X8a6oMM0B5xq8ydJyFsqXR0HUZO51GACNNws1yQ5HV6kKM7NiJwtHKdGHf6aS6 X-Received: by 2002:a25:aae2:: with SMTP id t89-v6mr1449348ybi.200.1542716340042; Tue, 20 Nov 2018 04:19:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542716340; cv=none; d=google.com; s=arc-20160816; b=axkzF8ofH3LkVXErppOYdb79aVMQxR4PV9/e99EE3+206IL3/61rDLpuMQiBNRKZ6u 6kMxWoQMf3AHwqB1fZu5+fIhHS6S6WeM62Ihjrir6p5rDmPh5ZfZWOjrXzSKm2bBRDhQ tKMqb37r/q10qQh/3WP4f+x6PLkfECK6/LAR3KfbFRxRMfr/Jx2k/0cEPOfWWurl5kZs p8Xz3sT5dQAc+ZT9OPJfBVzgxjkkVpcIsdvHLhtaX4rkLuD1sTuBDxGuWOxQ/jVKhDSl dhjp5c0X78nJ8CwWjZI+ezXE28zm+dNrlHQ5oZ4g/PJ1g+oyKy3GEvQXcCCBvtxwCe7R HJxA== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=tusyFviTXg3Z07DzPNMpcS9w3/27t1wRBGHj82A/Eoc=; b=c+tH0kT1T46PKVBuBbQfLUwXDhYVHWzw5PDWdETjPOEixstZ+K7aQS9dwuQedTrWdL 1+fNfpwhO5WYMNCPzaBl0YgmxsK+dnv0HrmWSObywcRX1iAdg6NWcRfr0ctZS61G09Uh FETCd+oUtI8GI1itf0KZYm65oW6RngV4hr8p9gXbTsrOHgCpeRkD4lmjr2m3iipCmt4t cDQ4QMk+zR456qw2+Nv8GPFSs3m5H7y5D42BAC8XTI6N76RgtiE+BBOlGIkKB5xAe+NF hNoQ9JKMnhZ7Sr7zX6hEug2Vk2B1KeeSvy81w7wBJ8ZiwzgAOwIUeKYAIUNpnBobrDrK 9TSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RJHcIXbe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id l5-v6si24884890ybl.418.2018.11.20.04.18.59 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 20 Nov 2018 04:19:00 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RJHcIXbe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33355 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gP4zb-0002bk-Br for patch@linaro.org; Tue, 20 Nov 2018 07:18:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gP4x2-0001i0-Az for qemu-devel@nongnu.org; Tue, 20 Nov 2018 07:16:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gP4x0-00050t-Je for qemu-devel@nongnu.org; Tue, 20 Nov 2018 07:16:20 -0500 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]:42377) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gP4x0-00050h-EO for qemu-devel@nongnu.org; Tue, 20 Nov 2018 07:16:18 -0500 Received: by mail-pf1-x429.google.com with SMTP id 64so911817pfr.9 for ; Tue, 20 Nov 2018 04:16:18 -0800 (PST) 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; bh=tusyFviTXg3Z07DzPNMpcS9w3/27t1wRBGHj82A/Eoc=; b=RJHcIXbetB6nMpgeFo50iNKQUfJNRz6Hn0aF7xlIyk3Yh3AQBI0jJUB3v/xagwO8VU aMbbZsSpNDzD8X2Oxvg4Lp9Zwc5cd7kS0h/NKpav0K2nWXNhBmZCyRvBRwovSwqFL20x sroiTNLGWiwj/dBvAcVU0TeXYX7DjiRnuOhas= 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; bh=tusyFviTXg3Z07DzPNMpcS9w3/27t1wRBGHj82A/Eoc=; b=q4K9tgFFwjP/HCTUcapcV1EZ/YPOnJpMoEJRtJblpplZUe6gw6XTKhWzBICpEibH2I UDk27q7jbCxXXy6gXUfspTwBQ+meTwoSYn1LRsRycyqW4L1FGqwF3U9PHrwPtBPMNoQ/ mf14zsePznk5uF20vpznXyGA94KY+D4gD8DfBSH5zGyBGAn9pPF+JWSNO3trDL0GntF/ 9hVwmPt8kABpRwnkBH/4EijluAGfHHPFbcQACEMrJW90cc7DO0Yl72gFla0dssf1Fjr0 aOQoQ+WQO9bLbi1Kc2vAbMlazg+L5NmRBDbnCCi0zM3jhlhWwvnHguqLwbYR/E+ulD9W cTnQ== X-Gm-Message-State: AGRZ1gKnuD8gxpfWOGPURU1eHwzmon2AgEB/TLZoGTt33WCq3nQX5cEn zk0p5W9MSGccLdfsq5ugnZPyAreuoeusWw== X-Received: by 2002:aa7:868f:: with SMTP id d15mr1874324pfo.225.1542716177141; Tue, 20 Nov 2018 04:16:17 -0800 (PST) Received: from cloudburst.twiddle.net ([172.56.31.89]) by smtp.gmail.com with ESMTPSA id p11sm39244346pgn.60.2018.11.20.04.16.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Nov 2018 04:16:16 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 20 Nov 2018 13:15:55 +0100 Message-Id: <20181120121558.7660-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181120121558.7660-1-richard.henderson@linaro.org> References: <20181120121558.7660-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::429 Subject: [Qemu-devel] [PATCH 2/5] tcg/optimize: Optimize bswap X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair.Francis@wdc.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Somehow we forgot these operations, once upon a time. This will allow immediate stores to have their bswap optimized away. Signed-off-by: Richard Henderson --- tcg/optimize.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- 2.17.2 diff --git a/tcg/optimize.c b/tcg/optimize.c index 5dbe11c3c8..6b98ec13e6 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -353,6 +353,15 @@ static TCGArg do_constant_folding_2(TCGOpcode op, TCGArg x, TCGArg y) CASE_OP_32_64(ext16u): return (uint16_t)x; + CASE_OP_32_64(bswap16): + return bswap16(x); + + CASE_OP_32_64(bswap32): + return bswap32(x); + + case INDEX_op_bswap64_i64: + return bswap64(x); + case INDEX_op_ext_i32_i64: case INDEX_op_ext32s_i64: return (int32_t)x; @@ -1105,6 +1114,9 @@ void tcg_optimize(TCGContext *s) CASE_OP_32_64(ext16s): CASE_OP_32_64(ext16u): CASE_OP_32_64(ctpop): + CASE_OP_32_64(bswap16): + CASE_OP_32_64(bswap32): + case INDEX_op_bswap64_i64: case INDEX_op_ext32s_i64: case INDEX_op_ext32u_i64: case INDEX_op_ext_i32_i64: