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: 10730467 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EA51391E for ; Fri, 14 Dec 2018 03:47:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7EC22CFFE for ; Fri, 14 Dec 2018 03:47:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA7722D002; Fri, 14 Dec 2018 03:47:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 72EC92CFFE for ; Fri, 14 Dec 2018 03:47:30 +0000 (UTC) Received: from localhost ([::1]:59209 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXeRl-0005aB-KU for patchwork-qemu-devel@patchwork.kernel.org; Thu, 13 Dec 2018 22:47:29 -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-Google-Smtp-Source: AFSGD/WqhIxGyPnK3Mdf/eo4ElZ20c3hy5hseBrsNQScHRePMDgsjM3IjFW2VSkDaeUvWnR96Rslkg== 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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);