From patchwork Wed Aug 28 19:03:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 172411 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp1170142ily; Wed, 28 Aug 2019 12:06:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqwikvacc5r1vOPkGiEBefeKlbt4f1S7VUOmVyXDRoooF9Cp3OeNC/6ERC6aGPWgECj5BTbL X-Received: by 2002:aed:34a6:: with SMTP id x35mr5842053qtd.187.1567019208208; Wed, 28 Aug 2019 12:06:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567019208; cv=none; d=google.com; s=arc-20160816; b=roVm4tLAHvtVEanjd5y3z6qT1SyXZ0ISE/IdxxDFAT/2YNC+UKQwhWTUoHMXjiEQPv GHZBEMWDHqQ/d5u5l43zsG/EaLhWJzquvVQ+2Ti+415d6TC64S+NvEtCduaziYrl76dE rxxFsJRU9fGBspemc54QML419pGX+p9lG7vIryzmGpDMKi8Um0jd6IiadDG85Uv6bPVe gebm5EMu2fYvbKmSqdYWhocXokdz3sGrLXnjnqyUsNcxzUDvdfgrJSXV217NGdst4AdO Dj7AAtWN0DTETxtBMZADsAbEmTU4LkH24RKgE06IWMPsj22HmaXkvhN9hqG2Q/5Yl3pQ tIIA== 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=Y5yPfgEriWWma7y9hU2/xgK2vFUjf1uQUjpsxHdDPIY=; b=anY72zrWoK2yoP3O3NC9XCQ1NGNft16xz0tXqPQeUeP+kWkt8fSckKtMoBbAlhm8bv R5T3i3+coNLC7SGUNHwHu/q+BVOfPUOSvX316hPl1+FOoPQvlg9nsgMTl7NLtQBAg44p NB2Mgs9goAYMDKiQyISajcf+CaBKxLVl8SnkULK5OW9qibUedc7heFsseMU42mRN8PDq KnYFsOGRiieLi7NETxEYwhCr7uyBQcsFu1mkxaICqrRRvmWdjKr/OulHeDEn4kTVD6Kk F5i3wNew+3B6MWNM5I4Hui6nx/sxFqlEhUarvCq5ECmSXAY11p0dVlXbRHLBFoxzEG2I hqfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="yMq3/iJI"; 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=fail (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 q2si145963qve.47.2019.08.28.12.06.47 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Aug 2019 12:06:48 -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=fail header.i=@linaro.org header.s=google header.b="yMq3/iJI"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:40214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i33HK-0003LP-VI for patch@linaro.org; Wed, 28 Aug 2019 15:06:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37470) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i33Fm-00033n-Sv for qemu-devel@nongnu.org; Wed, 28 Aug 2019 15:05:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i33Fl-0008Bn-BF for qemu-devel@nongnu.org; Wed, 28 Aug 2019 15:05:10 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:44121) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i33Fl-0008A1-2H for qemu-devel@nongnu.org; Wed, 28 Aug 2019 15:05:09 -0400 Received: by mail-pf1-x443.google.com with SMTP id c81so371837pfc.11 for ; Wed, 28 Aug 2019 12:05:08 -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; bh=Y5yPfgEriWWma7y9hU2/xgK2vFUjf1uQUjpsxHdDPIY=; b=yMq3/iJIs+X2hHMLBXGUONjwOV07estLLoofNW7mzhCS/ghswkzmTIi3WUGIcYUTY1 y1eUDawNAjO1pMYfz3OVEneK59MGv/0jvXXD23idfG478JSMENqsjmhKk/+0hO9jmpMs TzuhF7InGuX9Q71WkNMmRUTH238lmfyJEQpZpbqoXNDcxjjrDaMoa3gZ74bw/HnRPDy5 eToc6DPH3Th2Zq6+YdrbImTra3GGD7tD/YZFOrZBzbw9xWyGni9xg6VKwM64CSf6UfaO ksBohpHL+SvbOGp2OGv2tV7lvw4PdhqHKNRe3h200BpT6HC6RS7L5wAl+L/y0ok0Fhow 7XBg== 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=Y5yPfgEriWWma7y9hU2/xgK2vFUjf1uQUjpsxHdDPIY=; b=FagH1sApOul13wQXfVGlaQ0snqnJ/EFGLyxxpv15Kz9zjp7JryVv/Mf89KnVAyQ6mC 6uTihRwZuJ8v9sfjD2cUHTew59YdD6v3D8tXgG1MgMYYBCW4E5O8nSjD/clGNNYKwwxa ZA7Ub0jK6t9Bu14gxVzy1rbIng9+Y8uTYqdbUfxK9lKBbPFp/jD2jujh2Nm/k6OEH/oB Y9pd2tQPtf1LBPTuthkJuFqSinYOF2e9E0fVuwFZ70vuTrPOgQ3ETugZ3MIl+7gs73X/ GWD4Xa+8TG5ejKLPjXXqic8aYmsz/I7Hnq9+Z8/4HVp5QDXWW2HHqCmPWAk9gvgEYy2t caqA== X-Gm-Message-State: APjAAAXXDqS2luBLq3hYNMdgrd/JYw0zTjLSanPG3+IiFmjC4XAF4/0N I3Qd1qWlVJgU+8j4GTQ705TnJVpxC0A= X-Received: by 2002:a63:de4c:: with SMTP id y12mr4869451pgi.264.1567019107645; Wed, 28 Aug 2019 12:05:07 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id f27sm2967944pgm.60.2019.08.28.12.05.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Aug 2019 12:05:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 28 Aug 2019 12:03:54 -0700 Message-Id: <20190828190456.30315-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190828190456.30315-1-richard.henderson@linaro.org> References: <20190828190456.30315-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::443 Subject: [Qemu-devel] [PATCH v3 07/69] target/arm: Simplify UMAAL 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@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Since all of the inputs and outputs are i32, dispense with the intermediate promotion to i64 and use tcg_gen_mulu2_i32 and tcg_gen_add2_i32. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) -- 2.17.1 diff --git a/target/arm/translate.c b/target/arm/translate.c index b7845d825b..17659627b1 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -7320,21 +7320,6 @@ static void gen_storeq_reg(DisasContext *s, int rlow, int rhigh, TCGv_i64 val) store_reg(s, rhigh, tmp); } -/* load a 32-bit value from a register and perform a 64-bit accumulate. */ -static void gen_addq_lo(DisasContext *s, TCGv_i64 val, int rlow) -{ - TCGv_i64 tmp; - TCGv_i32 tmp2; - - /* Load value and extend to 64 bits. */ - tmp = tcg_temp_new_i64(); - tmp2 = load_reg(s, rlow); - tcg_gen_extu_i32_i64(tmp, tmp2); - tcg_temp_free_i32(tmp2); - tcg_gen_add_i64(val, val, tmp); - tcg_temp_free_i64(tmp); -} - /* load and add a 64-bit value from a register pair. */ static void gen_addq(DisasContext *s, TCGv_i64 val, int rlow, int rhigh) { @@ -8093,8 +8078,7 @@ static bool trans_SMLAL(DisasContext *s, arg_SMLAL *a) static bool trans_UMAAL(DisasContext *s, arg_UMAAL *a) { - TCGv_i32 t0, t1; - TCGv_i64 t64; + TCGv_i32 t0, t1, t2, zero; if (s->thumb ? !arm_dc_feature(s, ARM_FEATURE_THUMB_DSP) @@ -8104,11 +8088,17 @@ static bool trans_UMAAL(DisasContext *s, arg_UMAAL *a) t0 = load_reg(s, a->rm); t1 = load_reg(s, a->rn); - t64 = gen_mulu_i64_i32(t0, t1); - gen_addq_lo(s, t64, a->ra); - gen_addq_lo(s, t64, a->rd); - gen_storeq_reg(s, a->ra, a->rd, t64); - tcg_temp_free_i64(t64); + tcg_gen_mulu2_i32(t0, t1, t0, t1); + zero = tcg_const_i32(0); + t2 = load_reg(s, a->ra); + tcg_gen_add2_i32(t0, t1, t0, t1, t2, zero); + tcg_temp_free_i32(t2); + t2 = load_reg(s, a->rd); + tcg_gen_add2_i32(t0, t1, t0, t1, t2, zero); + tcg_temp_free_i32(t2); + tcg_temp_free_i32(zero); + store_reg(s, a->ra, t0); + store_reg(s, a->rd, t1); return true; }