From patchwork Fri Dec 14 03:19:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 153739 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1610369ljp; Thu, 13 Dec 2018 19:46:32 -0800 (PST) X-Google-Smtp-Source: AFSGD/XmFJzCLfbxNjLqV65s4nebXB4NlZTgedIP4Srcl18oy5QnBKdzPBrYAm1MD0kzpJyttkOL X-Received: by 2002:aed:2314:: with SMTP id h20mr1292584qtc.286.1544759192207; Thu, 13 Dec 2018 19:46:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544759192; cv=none; d=google.com; s=arc-20160816; b=RSHKM1z6tk3NL6YshUwb0hFymmYwj7KE/qlorBnqK1Z8RNgnG9ZGvGvmrDcwhANJVO fz0KQN+EiYUGzYP+f6zc+wgQzk/x6BNFRy5fuuwOjnEryxWAGB93fiJvk3QoR86hMfRX yaJconHiVEpba1TwFP93Bnvl1cyNK0JHdBB1B0tvBy+PHfJMcIPmQFl+Y6D522MqfD+f u6z0ybW86N/YbS2FEC0NmTxrh5yjhvwLLjgpCGDZ5as8T4tV+ech2Oo5LOCECn7FgFA9 MguXb+FBWSDJZgb5aVpFsKSa0ENa0n4JzoOcFput1FcbURf51xJ7KL6gDj/a1YpPwXNY uNtQ== 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=ljzkS2u5NxEGQo13KaByeCKX+sZpEQt0JYFHUtF/Kd0=; b=DrqgZ3XYtdpdHQK9LrjA8VDXUYVCvrAaD0he2YuYB5CdjcawjMFuxN1r88QRnhOMKV TRI1Oj12EMYsvgGDev18JT3XdcL2PMstQ6nUryq7bcYkj5ow8xk0IdknJ3cz4U1z9QuI pKduFos9pH1XxIblS1i4Y0WTV5bznCjPyGI5eMnVA13r70yZ5OzagBepngoRU88up+qf NlkB+hVsjJ/D94HCwV91hTH3PaHe853jM7UA0wrfK/cZQqkM0kaV5GtSMIZMiTC132/a QNpg0bn4Xxqqvs6uH1SUNjZvgAvs4W7k3oeXzzQMVvvnKxeH14zKgjNq22yWFrfuwHxY zOnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EwvzMQlA; 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 x24si2126271qkh.97.2018.12.13.19.46.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 13 Dec 2018 19:46:32 -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=EwvzMQlA; 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]:59206 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXeQp-0004ku-N0 for patch@linaro.org; Thu, 13 Dec 2018 22:46:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58997) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXe1D-0006Hx-D9 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 22:20:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXe1C-0007jO-CO for qemu-devel@nongnu.org; Thu, 13 Dec 2018 22:20:03 -0500 Received: from mail-ot1-x334.google.com ([2607:f8b0:4864:20::334]:41317) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gXe1C-0007VL-16 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 22:20:02 -0500 Received: by mail-ot1-x334.google.com with SMTP id u16so4105691otk.8 for ; Thu, 13 Dec 2018 19:19:57 -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=ljzkS2u5NxEGQo13KaByeCKX+sZpEQt0JYFHUtF/Kd0=; b=EwvzMQlAEo799vykSY+bRCClQRv1dlnn0/15eICVg497tI2K2uJTq+1mDy/LrF/V/B ncx79iTjoKwQx3ifjYfgX4qpfDlhMCb0lxDVHP01XHgbg7oFRlh3ZPCvDNB9zn2Nqm63 Xgqw0lVzAMIo1rr95GIiVJXeZDf8MaMJyuF9Q= 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=ljzkS2u5NxEGQo13KaByeCKX+sZpEQt0JYFHUtF/Kd0=; b=qX1vkcoOMIFIaF/7npXLM9Vx/cOUQBh2+AwOmqBvTuAkkpGc4O9BjHmXsCFt/yjiPj 7daqgL/LsPb0PSsORzYgcvJBhnRoj+I+0+zv60lS4QsRgoIzR8fAin0w6dE9RDkxumBN /EbOeorbNJUV3+hmx2WiO2w/nvl3ze0R252LPqjULngp++LUawm4152267rm7i2BvlCP 64aIgC2aFcAFDt7YEvH8Nl0ckcLZDrwj61MXRhjU96RkM4mrW58VZAdmkMJMhLZHfKVu y/+MIA+HeSFKare0T9iO6LzeihwTZvqWwxRw5oJU47aEFHzG7WcvWAYTWmUQTAAmfVol FIhg== X-Gm-Message-State: AA+aEWZdzitqJ8ZTEnPuf/qFOC3EMf8EYFPGj3ziSYcdwoTw4ClJY5hu GXj49dFC6AAAd+HcAgabyrvYlJtWlS1mvQ== X-Received: by 2002:a05:6830:1543:: with SMTP id l3mr1028759otp.180.1544757596461; Thu, 13 Dec 2018 19:19:56 -0800 (PST) Received: from cloudburst.twiddle.net ([187.217.227.243]) by smtp.gmail.com with ESMTPSA id g138sm2367537oib.26.2018.12.13.19.19.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Dec 2018 19:19:55 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 21:19:18 -0600 Message-Id: <20181214031923.29527-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181214031923.29527-1-richard.henderson@linaro.org> References: <20181214031923.29527-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::334 Subject: [Qemu-devel] [PULL 27/32] tcg/mips: Improve the add2/sub2 command to use TCG_TARGET_REG_BITS 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: peter.maydell@linaro.org, Alistair Francis Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alistair Francis Instead of hard coding 31 for the shift right use TCG_TARGET_REG_BITS - 1. Signed-off-by: Alistair Francis Message-Id: <7dfbddf7014a595150aa79011ddb342c3cc17ec3.1544648105.git.alistair.francis@wdc.com> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- tcg/mips/tcg-target.inc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.2 diff --git a/tcg/mips/tcg-target.inc.c b/tcg/mips/tcg-target.inc.c index a06ff257fa..be0bc92e8e 100644 --- a/tcg/mips/tcg-target.inc.c +++ b/tcg/mips/tcg-target.inc.c @@ -792,7 +792,7 @@ static void tcg_out_addsub2(TCGContext *s, TCGReg rl, TCGReg rh, TCGReg al, tcg_out_opc_imm(s, OPC_ADDIU, rl, al, bl); tcg_out_opc_imm(s, OPC_SLTIU, TCG_TMP0, rl, bl); } else if (rl == al && rl == bl) { - tcg_out_opc_sa(s, OPC_SRL, TCG_TMP0, al, 31); + tcg_out_opc_sa(s, OPC_SRL, TCG_TMP0, al, TCG_TARGET_REG_BITS - 1); tcg_out_opc_reg(s, OPC_ADDU, rl, al, bl); } else { tcg_out_opc_reg(s, OPC_ADDU, rl, al, bl);