From patchwork Fri May 11 02:44:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135477 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp331826lji; Thu, 10 May 2018 19:55:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZprYedTOu6W64E2jkXn6SFcGPgKFWFyazxPv2yGuGw4+5sf9AdEbRGzuI6vQGSJaUtZr6Jw X-Received: by 2002:a37:b6c6:: with SMTP id g189-v6mr3647589qkf.334.1526007353965; Thu, 10 May 2018 19:55:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526007353; cv=none; d=google.com; s=arc-20160816; b=QKhg4rCfElTJEZS4NPFwVS8sev7nwGrIgmHHEUEwq+Zqt31U9llgSUmEHvyhDbaixa q7aiYgdgF7EQrnM601DrL0/HH06V6uqesc+rOy23S97l/RX6kjgDsj928NRSgLhHJTUk sZqTzK0oKik8BDW7O/ZcEg1ffN7t7jiEsS4SuaODiwPAFuEM4doZSQMcHZiPBfD4EPij yb/A4GGE0rNoJ3LqV5YhXXcU4XtwU9awEcbLYWC7xlP7xiT12rSacJCHZdHcof+hhuJG LLjySZZXGk78eD8SMPRbCz/3UxYwB519/DvCXn9rts+LVz1suTM6Hm1dsOJBX2wjVYlq 5ZPQ== 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=RBjkwsmo6PqvvVb5ytRMTfzsA4/w11RdkNk+t8rA5Kg=; b=oMZq/A/yBBg0AWKtnqpW2c0E1JlZ2jaBglB++stXi67NBeb7jrYWFLzgEpkxPOoj0L BehU8tQ0aNKrsXfziVYcjyOwirBuZl6m6o1ZXicswRy2BG7m7S17ozNpQGQEUYOapuqq Jxa0O3er6TQBnDRhN6rT2/mfqKP2SRg2lKHRfPAA9pacr26gAeP/1rM2g5HpYiGPx7yA F1Bo7RzlIDTm32jISOFm+QIBKwARjZBQHYiDbTVBUuD0gonooricRXkLaZLyKBINUJNQ 1t5X1fzbwxh1pvPZEJqPoUUIUAjm8rNPCsgPnJeFhwo2VADspR1CRzLiklUtzu9HNyr5 V+aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=R+/oBYIJ; 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 i10-v6si2171784qvh.177.2018.05.10.19.55.53 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 10 May 2018 19:55:53 -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=R+/oBYIJ; 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]:36498 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGyDp-0005XW-HK for patch@linaro.org; Thu, 10 May 2018 22:55:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGy3f-0002V5-1N for qemu-devel@nongnu.org; Thu, 10 May 2018 22:45:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGy3e-00067R-1O for qemu-devel@nongnu.org; Thu, 10 May 2018 22:45:22 -0400 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:33639) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fGy3d-00066z-S9 for qemu-devel@nongnu.org; Thu, 10 May 2018 22:45:21 -0400 Received: by mail-pg0-x243.google.com with SMTP id i194-v6so1798707pgd.0 for ; Thu, 10 May 2018 19:45:21 -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=RBjkwsmo6PqvvVb5ytRMTfzsA4/w11RdkNk+t8rA5Kg=; b=R+/oBYIJRPgIRMkkj230Hw5ZcmDMR3IOyn3aVxf0iDPh4Q8HXmidXZoytdVyIuijEG LTz0gTS5TJeWPmvoecICnSeoyNtI5DWC50DPZIHDaT8MU1hSUQEIF9LJgjgwL7c/yn+U ZCCaejyh5x+ULw1n59WCuUMXbrw/oRLgZKH3Y= 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=RBjkwsmo6PqvvVb5ytRMTfzsA4/w11RdkNk+t8rA5Kg=; b=LMYVSTa1qLGAaOO9I8DdvGGtmTRmlsnQWqtm8mcrjwTHl5kpl7X+KyWEaRFaL8qOGN WQVceZtcDDfiyYnfINnrrpC5swLAke6YPyzU/42Y6hj7QIxcS4muOetVesLRl1hCTWg3 j70qNu1ShD1oYraP3kSacqrc2o/32/qu2n0jbUuC5TWV2E9CJA6RmZ0gSzg2Fk+VDa14 4EKKL/WUTGOYJ9uMbnJfQdjESXtUAR4s2v5XsJRXWAIlFIlpEFoOTZ7e1Tely7OoD1JQ EGr/V1fYxdIXZwYaIXKz0elvO5MQ5svbG7yZDYk8He+y3TxakC4cWqtyRlNmprNWgy0i 5VKQ== X-Gm-Message-State: ALKqPwc3PoOsNGoEd/nfMBMxb90W3ANkk16a67HyRSs2H8AvUwA8Zcgt fIWs8Sb1I6cm4o5BvD+Ge7mYSiZTh00= X-Received: by 2002:a63:9302:: with SMTP id b2-v6mr3027957pge.263.1526006720539; 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.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 May 2018 19:45:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 10 May 2018 19:44:53 -0700 Message-Id: <20180511024454.31679-11-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:c05::243 Subject: [Qemu-devel] [PATCH v3 10/11] target/arm: Implement FMOV (immediate) 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 All the hard work is already done by vfp_expand_imm, we just need to make sure we pick up the correct size. Cc: qemu-stable@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Alex Bennée [rth: Merge unallocated_encoding check with TCGMemOp conversion.] Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) -- 2.17.0 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 85a46f7abd..d77eda7cbc 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -5674,11 +5674,25 @@ static void disas_fp_imm(DisasContext *s, uint32_t insn) { int rd = extract32(insn, 0, 5); int imm8 = extract32(insn, 13, 8); - int is_double = extract32(insn, 22, 2); + int type = extract32(insn, 22, 2); uint64_t imm; TCGv_i64 tcg_res; + TCGMemOp sz; - if (is_double > 1) { + 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; } @@ -5701,7 +5715,7 @@ static void disas_fp_imm(DisasContext *s, uint32_t insn) return; } - imm = vfp_expand_imm(MO_32 + is_double, imm8); + imm = vfp_expand_imm(sz, imm8); tcg_res = tcg_const_i64(imm); write_fp_dreg(s, rd, tcg_res);