From patchwork Sun Feb 16 18:21:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 24718 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8BCAD202B2 for ; Sun, 16 Feb 2014 18:21:23 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id rd3sf34804966pab.11 for ; Sun, 16 Feb 2014 10:21:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=XD20DnamVrWnMSoP9C81Tsgq2dwQzpRadO90O4xSiv4=; b=mvpAayMDNp5i09qf1xyXmLbwSSTF+yfiNdix3+ojUoU4njh7PtWP3lwEacTwIX9Ofk H3dyjplgimMhVZkmd0VeU1Yc7gGMy8WZ8nUyRUsBE5AWsbS9gxpXtruCC8CZh89c/dqz 5bHELL+eb5H5C3KtljZRgIm2cCLloHuvyIh0cBovjKuGHTyOxpjwzlyDxrPSiOq34wvR o3r/79PODkoS8zwXRSiUYJhj7iMQXPV/hZfGWAwnluDX2uB9mC0CehkvSsVxTBWlbGV/ yAgRF1jGBa87HGZcsdsqtliknJH+1nX6uHU1aoM5vzSNbneklyGWPSGK+H5FA/0Rqizd gdVg== X-Gm-Message-State: ALoCoQnwd7A7Nxt6tjeRcW8YoQfVSeHLFA++TZZH6JuIrhHW/xHrnLBuGCdMMsACr0Wf/Jhjphtt X-Received: by 10.67.1.129 with SMTP id bg1mr8255175pad.8.1392574882796; Sun, 16 Feb 2014 10:21:22 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.89.136 with SMTP id v8ls712338qgd.17.gmail; Sun, 16 Feb 2014 10:21:22 -0800 (PST) X-Received: by 10.52.171.39 with SMTP id ar7mr11646579vdc.5.1392574882678; Sun, 16 Feb 2014 10:21:22 -0800 (PST) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id gq1si3933920vec.23.2014.02.16.10.21.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 16 Feb 2014 10:21:22 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id pa12so11297312veb.16 for ; Sun, 16 Feb 2014 10:21:22 -0800 (PST) X-Received: by 10.221.2.138 with SMTP id nu10mr130913vcb.52.1392574882550; Sun, 16 Feb 2014 10:21:22 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp85729vcz; Sun, 16 Feb 2014 10:21:22 -0800 (PST) X-Received: by 10.204.103.131 with SMTP id k3mr79530bko.57.1392574878389; Sun, 16 Feb 2014 10:21:18 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id qn1si5273864bkb.260.2014.02.16.10.21.15 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 16 Feb 2014 10:21:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WF6L2-0007Ty-5v; Sun, 16 Feb 2014 18:21:12 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Alexander Graf , Michael Matz , Claudio Fontana , Dirk Mueller , Laurent Desnogues , kvmarm@lists.cs.columbia.edu, Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Christoffer Dall , Will Newton , Peter Crosthwaite Subject: [PATCH 3/6] target-arm: A64: Implement the wide 3-reg-different operations Date: Sun, 16 Feb 2014 18:21:08 +0000 Message-Id: <1392574872-28725-4-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1392574872-28725-1-git-send-email-peter.maydell@linaro.org> References: <1392574872-28725-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Implement the wide three-reg-different operations: SADDW, UADDW, SSUBW and USUBW. Signed-off-by: Peter Maydell --- target-arm/translate-a64.c | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c index 809fbdb..511f15e 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -7117,6 +7117,41 @@ static void handle_3rd_widening(DisasContext *s, int is_q, int is_u, int size, tcg_temp_free_i64(tcg_res[1]); } +static void handle_3rd_wide(DisasContext *s, int is_q, int is_u, int size, + int opcode, int rd, int rn, int rm) +{ + TCGv_i64 tcg_res[2]; + int part = is_q ? 2 : 0; + int pass; + + for (pass = 0; pass < 2; pass++) { + TCGv_i64 tcg_op1 = tcg_temp_new_i64(); + TCGv_i32 tcg_op2 = tcg_temp_new_i32(); + TCGv_i64 tcg_op2_wide = tcg_temp_new_i64(); + static NeonGenWidenFn * const widenfns[3][2] = { + { gen_helper_neon_widen_s8, gen_helper_neon_widen_u8 }, + { gen_helper_neon_widen_s16, gen_helper_neon_widen_u16 }, + { tcg_gen_ext_i32_i64, tcg_gen_extu_i32_i64 }, + }; + NeonGenWidenFn *widenfn = widenfns[size][is_u]; + + read_vec_element(s, tcg_op1, rn, pass, MO_64); + read_vec_element_i32(s, tcg_op2, rm, part + pass, MO_32); + widenfn(tcg_op2_wide, tcg_op2); + tcg_temp_free_i32(tcg_op2); + tcg_res[pass] = tcg_temp_new_i64(); + gen_neon_addl(size, (opcode == 3), + tcg_res[pass], tcg_op1, tcg_op2_wide); + tcg_temp_free_i64(tcg_op1); + tcg_temp_free_i64(tcg_op2_wide); + } + + for (pass = 0; pass < 2; pass++) { + write_vec_element(s, tcg_res[pass], rd, pass, MO_64); + tcg_temp_free_i64(tcg_res[pass]); + } +} + /* C3.6.15 AdvSIMD three different * 31 30 29 28 24 23 22 21 20 16 15 12 11 10 9 5 4 0 * +---+---+---+-----------+------+---+------+--------+-----+------+------+ @@ -7147,7 +7182,11 @@ static void disas_simd_three_reg_diff(DisasContext *s, uint32_t insn) case 1: /* SADDW, SADDW2, UADDW, UADDW2 */ case 3: /* SSUBW, SSUBW2, USUBW, USUBW2 */ /* 64 x 128 -> 128 */ - unsupported_encoding(s, insn); + if (size == 3) { + unallocated_encoding(s); + return; + } + handle_3rd_wide(s, is_q, is_u, size, opcode, rd, rn, rm); break; case 4: /* ADDHN, ADDHN2, RADDHN, RADDHN2 */ case 6: /* SUBHN, SUBHN2, RSUBHN, RSUBHN2 */