From patchwork Fri May 11 02:44:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135475 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp330239lji; Thu, 10 May 2018 19:53:26 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq+7gDG6XHsPwB42zQorOsEL0p9LgVo6vqaj5CVUx7L8gVwZY9+n0W5fQqcm8p+jrwdBZON X-Received: by 2002:a37:4f10:: with SMTP id d16-v6mr3357300qkb.50.1526007206128; Thu, 10 May 2018 19:53:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526007206; cv=none; d=google.com; s=arc-20160816; b=UJ8ONBKigTGvNwvvbSaUr/HhBWZMi/8aAexE70vRiqj+m/r+US3NNbrJi/qcywx/4n wFGv2qP5CRC1/ujvr27rOOqMUs8DbUVtWgsXZCIEbZg3pL44BV+DEjoBIvrmhIw9B6uV AA9ffuikdeV66A40V6yolTIGjSg29o8D2QisEQRg5K4H0br+uX0MTZpmXBbf71hkSxhV 3zCA5Sng87hUu0StDGPy6PnTAxQrOUpL2UH9BBkfs7w6CTDh3MvnTBMajq0MObkyhqc/ 8LYHbXp0grx1DJTZfLVM8568DEesbGBVIvesc4lHupXP5Ng505i7D0qoP2jhg9er8Lj4 zHyg== 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=A0ubSGeyMVpiFS+RbvRXRf1tVN9tojSDRuZYAy+j7Xs=; b=bFON1b+ZzwfNVMhvpeFPrqAmk37T0b7rLkOpHj4knuoOfkeJ3OqTiftp9Hu7RevjZ9 n56XoUlEFPSw+PgczRxtsNavc0Y+RFd2FuC+34j36ynKo81K+nDxaU9bbG11+AkWuj5/ KsPEujoJDhV5NUzDhAgXWBIKqEGoX64986P2xkESSKoBjelOcjx3C/lENmWpYAJ7Fzjl 4yFXmNtNX/svpVUDY5oRdsUcTDaG3FmgcXwHeR7cGVkhwa/Vs2hbXT9fn8nySWfvlHcO 5UQDdQ0TaozDLXvKwmSTbkXJb+Jg3tKMOXFuORhjVk0/S+mbS9VdJTMLLwdgf1hQkQXZ rS4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fI52u2N3; 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 n72-v6si2210794qke.235.2018.05.10.19.53.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 10 May 2018 19:53:26 -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=fI52u2N3; 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]:36478 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGyBR-0002OW-KH for patch@linaro.org; Thu, 10 May 2018 22:53:25 -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) 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-Received: by 2002:a17:902:6549:: with SMTP id d9-v6mr3725112pln.196.1526006719194; Thu, 10 May 2018 19:45:19 -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) 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 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+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 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; 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);