From nobody Wed Oct 29 20:38:22 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1526085657918648.8681868853279; Fri, 11 May 2018 17:40:57 -0700 (PDT) Received: from localhost ([::1]:58710 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fHIan-0003o8-1y for importer@patchew.org; Fri, 11 May 2018 20:40:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fHISh-0006h4-M0 for qemu-devel@nongnu.org; Fri, 11 May 2018 20:32:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fHISg-0008Cy-FW for qemu-devel@nongnu.org; Fri, 11 May 2018 20:32:35 -0400 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:34116) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fHISg-0008Cd-9o for qemu-devel@nongnu.org; Fri, 11 May 2018 20:32:34 -0400 Received: by mail-pf0-x243.google.com with SMTP id a14-v6so3431430pfi.1 for ; Fri, 11 May 2018 17:32:34 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-2-170.tukw.qwest.net. [97.113.2.170]) by smtp.gmail.com with ESMTPSA id v186-v6sm7599735pfb.45.2018.05.11.17.32.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 May 2018 17:32:32 -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 :mime-version:content-transfer-encoding; bh=QvCuyjUfaw1h1bigRtHN6ndPqdFn4Ity7SY0/WHmjgA=; b=U9UJjOsNIYUZPEOIYzURnzaOGBmK9PEwucNp4uaXA/NPhl8JlX2k1/ywC+0FCruWt0 V6pir/54XH4gxeNG+QLLsp2TehJUHSjmXLbSkuMeoLrAtJfaC1GFH/d26p1R8QaoNddY 4cqf8C7XOD1RY1p3XWelKOZaYCmEUS3+wGfCQ= 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:mime-version:content-transfer-encoding; bh=QvCuyjUfaw1h1bigRtHN6ndPqdFn4Ity7SY0/WHmjgA=; b=cSybSGUG1ygWWwkg3pzOj9uWkCFTy4/C6CQ65kZ6PyTrfzBmg9RledfmFI4zGRWyRL M/Yd9dxm+Eb/0j9R09etbMM5FjqM1JFmu4Ke0dWyIYlV9WMiHJzS4JO8mJfZK+A1IDYO IUGOBg6yphWJCYwGazsOp6Y6qmJFY2p9FdrQ/UWbqhVudiAEHeElhdqbUptsqOZhxzUq 1ba69K1eYrF1JP9TSWZVP2gh6GZztnIqtnstusMC7eHbnrUYTaa27j4pYfA6ldD09LIB zta4NtmSkMFTE3A/uFxENs4713M9u/tCW2V2Le7p3cqu6wtrNwUXFRAAfr+kCYfcdB9a AQDg== X-Gm-Message-State: ALKqPwct7s1xKOZKUt0c/HOoMZZNdd/55+GwP4dFPeIiyVnFYgymNMtN szmvz0HpCadVf8GIo4brmBxF162JOrA= X-Google-Smtp-Source: AB8JxZrT00dV0EJXClRLu4R7S1BLWUI1L4dFi54PxB8qdLcQivc54+U7Mn588qhwDWuxsdjpdnYp3Q== X-Received: by 2002:a65:4acc:: with SMTP id c12-v6mr950441pgu.329.1526085152967; Fri, 11 May 2018 17:32:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 11 May 2018 17:32:15 -0700 Message-Id: <20180512003217.9105-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180512003217.9105-1-richard.henderson@linaro.org> References: <20180512003217.9105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::243 Subject: [Qemu-devel] [PATCH v4 09/11] target/arm: Implement FCSEL for fp16 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, alex.bennee@linaro.org, qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Alex Benn=C3=A9e These were missed out from the rest of the half-precision work. Cc: qemu-stable@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Alex Benn=C3=A9e [rth: Fix erroneous check vs type] Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index c078a54fa5..9dacb583ae 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -4903,15 +4903,34 @@ static void disas_fp_csel(DisasContext *s, uint32_t= insn) unsigned int mos, type, rm, cond, rn, rd; TCGv_i64 t_true, t_false, t_zero; DisasCompare64 c; + TCGMemOp sz; =20 mos =3D extract32(insn, 29, 3); - type =3D extract32(insn, 22, 2); /* 0 =3D single, 1 =3D double */ + type =3D extract32(insn, 22, 2); rm =3D extract32(insn, 16, 5); cond =3D extract32(insn, 12, 4); rn =3D extract32(insn, 5, 5); rd =3D extract32(insn, 0, 5); =20 - if (mos || type > 1) { + if (mos) { + unallocated_encoding(s); + return; + } + + switch (type) { + case 0: + sz =3D MO_32; + break; + case 1: + sz =3D MO_64; + break; + case 3: + sz =3D MO_16; + if (arm_dc_feature(s, ARM_FEATURE_V8_FP16)) { + break; + } + /* fallthru */ + default: unallocated_encoding(s); return; } @@ -4920,11 +4939,11 @@ static void disas_fp_csel(DisasContext *s, uint32_t= insn) return; } =20 - /* Zero extend sreg inputs to 64 bits now. */ + /* Zero extend sreg & hreg inputs to 64 bits now. */ t_true =3D tcg_temp_new_i64(); t_false =3D tcg_temp_new_i64(); - read_vec_element(s, t_true, rn, 0, type ? MO_64 : MO_32); - read_vec_element(s, t_false, rm, 0, type ? MO_64 : MO_32); + read_vec_element(s, t_true, rn, 0, sz); + read_vec_element(s, t_false, rm, 0, sz); =20 a64_test_cc(&c, cond); t_zero =3D tcg_const_i64(0); @@ -4933,7 +4952,7 @@ static void disas_fp_csel(DisasContext *s, uint32_t i= nsn) tcg_temp_free_i64(t_false); a64_free_cc(&c); =20 - /* Note that sregs write back zeros to the high bits, + /* Note that sregs & hregs write back zeros to the high bits, and we've already done the zero-extension. */ write_fp_dreg(s, rd, t_true); tcg_temp_free_i64(t_true); --=20 2.17.0