From patchwork Sat May 12 00:32:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135583 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1561648lji; Fri, 11 May 2018 17:41:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqQ2/w5HW6Wkp/kiwTCALWOcAxZ0QPP55A11Hnpmf/n+ffzyA0SO6/Tt8IXLrvvaH/uNP67 X-Received: by 2002:aed:2ce7:: with SMTP id g94-v6mr249240qtd.298.1526085697844; Fri, 11 May 2018 17:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526085697; cv=none; d=google.com; s=arc-20160816; b=A28ydtX/qEwuCZrVPjQR1cv5OHtu62dJoeN9eMc/QnT7qYADmGduiAn4MZrGkskqaz 2DdBavaD/nyDtZNummUi0UON6qELKwr99qQzD7mz9aXicTViHlaSH9j+OWO1Lr1VVXn5 tirj67XSdjmGIqdPSE5pEN+aqTFoWGutxgITiOJCfcIodQ9fBIHQtHwoROZqHc9pLXuy dN8Rp8Rz0yDsjDsPPKuoDB/zShn9qYF0oFK8DhkhTkOZAzVzofyfNguG+3EA7G9JlG61 208bXr5YINgG0vPgo+VyHzjYUzvpYDvG1MLWKF0SyA3ci9MIHvOskYtsiHVMEAcqZKjg D91A== 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=QvCuyjUfaw1h1bigRtHN6ndPqdFn4Ity7SY0/WHmjgA=; b=qW9MTbBntFqpwye9Et0Fpy+iorzs/8RrNpuodxb2FI6FNJSBVqIMD3AJ1WonQ839wt o66ExyhiyOO2ZkjuCAJRQEBIgo7i/lR0tL2KZn95PwvRj+bGcJl0lH9UWFFeTwc4V4FP nKWlz+URW0vf0Jvp/YCHJwNLbSrFJJlhW8ab45ffYLIpgJyRp00LC6/VbM6wgwHx3PFD JYJOBNXNqtGJZfEmJPybi9VUxu3uQUyjlMhMLsxu0N6bSwFDaBqUKdp5lHND91m5boe+ Yp6YJ5YsdWDuRIY4HRZeVnbQ4zuSoqfBfcoOJdFi62tQoRZftt6oKkA0H8OYVGiZNby+ KQKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=U9UJjOsN; 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 m10-v6si1638862qth.121.2018.05.11.17.41.37 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 11 May 2018 17:41:37 -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=U9UJjOsN; 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]:58710 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fHIbR-0003o8-9v for patch@linaro.org; Fri, 11 May 2018 20:41:37 -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) 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-Received: by 2002:a65:4acc:: with SMTP id c12-v6mr950441pgu.329.1526085152967; Fri, 11 May 2018 17:32:32 -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) 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 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+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 Reviewed-by: Peter Maydell 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.17.0 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; 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; } @@ -4920,11 +4939,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); @@ -4933,7 +4952,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);