From nobody Wed Oct 29 22:55:34 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 1526007168110213.13331451581223; Thu, 10 May 2018 19:52:48 -0700 (PDT) Received: from localhost ([::1]:36474 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGyAm-0001Xg-LG for importer@patchew.org; Thu, 10 May 2018 22:52:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGy3d-0002Qa-P7 for qemu-devel@nongnu.org; Thu, 10 May 2018 22:45:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGy3c-00066X-OR for qemu-devel@nongnu.org; Thu, 10 May 2018 22:45:21 -0400 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]:32846) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fGy3c-000663-Im for qemu-devel@nongnu.org; Thu, 10 May 2018 22:45:20 -0400 Received: by mail-pl0-x243.google.com with SMTP id n10-v6so2422076plp.0 for ; Thu, 10 May 2018 19:45:20 -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 n18-v6sm5420915pfg.36.2018.05.10.19.45.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 May 2018 19:45:18 -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=A0ubSGeyMVpiFS+RbvRXRf1tVN9tojSDRuZYAy+j7Xs=; b=fI52u2N3titvj4ezvhyrCILFUubmT9p1ZlLjsYzYlVsj+pcFnFGR/gbCrGJNSJ6zp0 DpcqjnTvMjwVvCXA+COHvTtHhR0oS8B1eLquv3HeaUTqBB3l91Dcw0cBmfa85SIaa5Fs MvqISTiBpN3sx79IRbVMku1fJEysKSi/NTjiU= 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=A0ubSGeyMVpiFS+RbvRXRf1tVN9tojSDRuZYAy+j7Xs=; b=bt2KXKyDrJmdiLQeoG3q3fXKZmr41Mjd2jQ5CgxzYn5iq6UikXFnqOql+aAsXrJyCj jrG8BUMqxCPjOgNRqup9EpKRl2rBgWNcymkWYR6gwZJJ3+NVhC3OsJ+dFBbnhQhPEj8N 2nhlU+7gTir5sduFybh65lu7xfe3JpH31quCOJSVzgS/UGaHE/lgt3HbIwkaHK81nk4D zWXk51FdH808QZMMso6m7TcFnHvlZivmu+lw2/C/OLZA2wYJLDS0725PypqGozVolJ2n 2Tbn4tNyrnizleX3mA+hlqdlYinQ8C9UKynYw3caI8sLe1Hkz/7HBJcNTOocqByf3AS+ eSGg== X-Gm-Message-State: ALKqPwfYOY69DbyeeixEjwdaSxmxSo/677C78E8Em8VWaLjdOl1ha74c lPunfyqUNxW8JdoNa7I4YDjZslnFcEk= X-Google-Smtp-Source: AB8JxZqgsKC9ja+gKNfMWm74X19xLjleXzF8UBqEgJuW5vhnlGmim2OYnHS7JcsXTs5opjuAmg7M1Q== X-Received: by 2002:a17:902:6549:: with SMTP id d9-v6mr3725112pln.196.1526006719194; Thu, 10 May 2018 19:45:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 10 May 2018 19:44:52 -0700 Message-Id: <20180511024454.31679-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180511024454.31679-1-richard.henderson@linaro.org> References: <20180511024454.31679-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:c01::243 Subject: [Qemu-devel] [PATCH v3 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 0ac586345e..85a46f7abd 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