From patchwork Wed May 2 22:15:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 134871 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1207156lji; Wed, 2 May 2018 15:25:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo2J4cYFmHJFWEuZWmIq/O4nKN8LWx+OjnOvRk9RAu/gN+aPnWf2lQ+FwaakUr58tvXjex7 X-Received: by 10.55.188.193 with SMTP id m184mr15507970qkf.92.1525299918835; Wed, 02 May 2018 15:25:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525299918; cv=none; d=google.com; s=arc-20160816; b=dViO5QCB6yLstNm5ekQwmV3V7AlnzgXVfezPI5dcp33I8HHhr7fk9UgC1s+GZWod23 sYabgTJhROmeK945nLtJj3doCO7anjuC3x3rv+s5mJbJrJSewuhw88oZCBWeP13ypdFt JgrsVOmKOmEQgKFsxTTcZT5k0A4y/CHbErMaqAdPg9bM6W+ThMtOKC11zWuCRwjCp74Y T+OaDEEBFVI+ebVsnbCaiUOAFn+4IpOTR1nJ46G8KhFctsklB4ELhdWsAcxPeeb8e6xU 1ya+YkJ/kufwNNww4DFCRUdmwNBGj9GMapbWG0z7zXex5DSXTKgq2qDPokUKuLcAbqdD Cg9w== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=Qjy5KDciNnwaKwZSWdv3Ve9BMVD2CqGha4QSuIzajro=; b=rgiQTNlO1Y+SDAu5J+P85qZZTyu6ucURJ42znYc+RU4Dzdogy0wreU9CeYHbeBu88q hDMNB9r90uW8HucPaSjRLFVOpEAK+UwOEDi+BqeiPfmOXOhEQdAt+6T06gWjV1UMu91u 2aOhbeJ1D3XkvRMnfMDDTju/++JJabczDKRLxLBBiscB5ppiwq9GqRrbZn9lMvDr1Eu4 pZ9UUIYdQMLTfyurcMekwYIDfiIlS82JOOK/BlgyM853O06iQsUlRYyhUmvNXH2LBlrX xXD7XJLqSZoQ6Ok8Oqa7HfaOmuf8Ia0B00DE6eiiKOylJxqgvZRquwCFtBLS0j6cUH3r i64g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Foz0SZTs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g9-v6si312881qtm.400.2018.05.02.15.25.18 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 02 May 2018 15:25:18 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Foz0SZTs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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]:52845 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fE0Ba-00084M-By for patch@linaro.org; Wed, 02 May 2018 18:25:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fE02n-0000ov-8X for qemu-devel@nongnu.org; Wed, 02 May 2018 18:16:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fE02l-00082D-T8 for qemu-devel@nongnu.org; Wed, 02 May 2018 18:16:13 -0400 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]:40974) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fE02l-000812-M7 for qemu-devel@nongnu.org; Wed, 02 May 2018 18:16:11 -0400 Received: by mail-pg0-x244.google.com with SMTP id m21-v6so11628372pgv.8 for ; Wed, 02 May 2018 15:16:11 -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=Qjy5KDciNnwaKwZSWdv3Ve9BMVD2CqGha4QSuIzajro=; b=Foz0SZTsRtXezzTitqGfd9EvbKbbstdiZ/GqNJAnnM3NTm/IYL0dETN5Hm0AAb+0Wt HgUooCugVqokRG0/YveMbEQhmiPANlSUXPeP7YbI+0LHKuZTvb9rUTTzq7kkagnFIi7l dNDe9Seqm2p9UPwJ7n6jaTOXcmxAvMYbCsCBM= 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=Qjy5KDciNnwaKwZSWdv3Ve9BMVD2CqGha4QSuIzajro=; b=BuylXYnxEHWcvovNiES41uHnoq5y514gLi219LCq3NDOXwTkiW7zFKnryer5yGjn+d oYlvljf9el8gACwJ/fV+kZI009egXswRBvg2rsIDlZ1YjxXYX/LdBVqoxOWG7cx0pmnk fFbARAtfczH9n89lWnjrYGlsPil3+jPT+DPg+Ks+ePCDM+2V0qQvJYva6ep6pXPcrxah 5iaE6jRIGbMTIZ3bEG9odnwQynsMSY21dp6qWYjdp89bXEWHccvfI2UiohEs9pPkH9Ci G1i7d9IRM5wdWnFo+w6Igc5hOrUxiivYyDN7t+rbfdYJR501JlM5TcEsnSbYawPPlDoC UOlA== X-Gm-Message-State: ALQs6tC94Ms0Y33m8UrMly8kQ4/bSM308Ar5/z5RP/jnSzRou9m19jT6 eL79o5owUPVzKG+xN8ndPrcKLH1Q2Ok= X-Received: by 2002:a65:4e03:: with SMTP id r3-v6mr17674540pgt.121.1525299370415; Wed, 02 May 2018 15:16:10 -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 65sm26170145pft.74.2018.05.02.15.16.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 May 2018 15:16:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 2 May 2018 15:15:50 -0700 Message-Id: <20180502221552.3873-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180502221552.3873-1-richard.henderson@linaro.org> References: <20180502221552.3873-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::244 Subject: [Qemu-devel] [PATCH v2 12/14] 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, qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée These were missed out from the rest of the half-precision work. Cc: qemu-stable@nongnu.org Signed-off-by: Alex Bennée [rth: Fix erroneous check vs type] Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) -- 2.14.3 Reviewed-by: Peter Maydell diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index f0aca20771..1ea5185f14 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -4666,15 +4666,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; mos = extract32(insn, 29, 3); - type = extract32(insn, 22, 2); /* 0 = single, 1 = double */ + type = extract32(insn, 22, 2); rm = extract32(insn, 16, 5); cond = extract32(insn, 12, 4); rn = extract32(insn, 5, 5); rd = extract32(insn, 0, 5); - if (mos || type > 1) { + if (mos) { + unallocated_encoding(s); + return; + } + + switch(type) { + case 0: + sz = MO_32; + break; + case 1: + sz = MO_64; + break; + case 3: + sz = MO_16; + if (arm_dc_feature(s, ARM_FEATURE_V8_FP16)) { + break; + } + /* fallthru */ + default: unallocated_encoding(s); return; } @@ -4683,11 +4702,11 @@ static void disas_fp_csel(DisasContext *s, uint32_t insn) return; } - /* Zero extend sreg inputs to 64 bits now. */ + /* Zero extend sreg & hreg inputs to 64 bits now. */ t_true = tcg_temp_new_i64(); t_false = 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); a64_test_cc(&c, cond); t_zero = tcg_const_i64(0); @@ -4696,7 +4715,7 @@ static void disas_fp_csel(DisasContext *s, uint32_t insn) tcg_temp_free_i64(t_false); a64_free_cc(&c); - /* 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);