From patchwork Mon Feb 11 01:08:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 157952 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2062773jaa; Sun, 10 Feb 2019 17:21:06 -0800 (PST) X-Google-Smtp-Source: AHgI3IbDAk1MXjwhJjKQyuwBgQfr8JC90N/T+kLpm1Gp27u96t+m7jRay0idk/VE5mMQAGB0MB1q X-Received: by 2002:a1c:f901:: with SMTP id x1mr7133380wmh.84.1549848066327; Sun, 10 Feb 2019 17:21:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549848066; cv=none; d=google.com; s=arc-20160816; b=vfKij4zSqsrcr+sHKfQareFAueFYwbPkW1aSEYmshMdch0sVAKxnMlKjZir+YOJ6J6 7h9L+3CskRytVJPxZBnklv6Kslh4jdti611ptpdxSZ7Yiq2LyQhcI7bL4C6ruUdkP70+ fj4Z8cIZzvLSJevRFQYxEXJnQt+WZ/uoChoiKp5t81EMlSUmTilSDoZ34OlyXSxvzjcV BX7MD2kn3Onn/vORV4MNh/aLdeqBnp5hH5GWgZswXJDLwsJHjY2NRYJxFiI7Y+PqxNKM vLLLO7T2sqkWMvXa7UAU27oLVLSdE1MeHyTWkCyKmbz9UlKTz51yYAmYmKrPnB/XWzd6 2jkg== 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:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=PJAqbiDKYxYxOSUmg7S9N0tHoZ0pCVJBOmi1qgJP2Co=; b=lnbAfdYVE68dqrEyDAqKaGDWGbAIzII6xuzA+6aF0b3Fpjxtr+szfFIsa1T+uislTh aL0eUIgYVW+sYPiGBwJnwoO5Ie+IHCncNe0+jlU4R5+5f3OHg8L2tO07gHxNWnk1oMTn E+eKb8+9RaEiG0bTaFPiKxWQlTGQ1iV7/ijB9ZUmq/lTVZS+s+bOKPoOQ6zoa6nSRjtK 7yNsQ6olkqBGVCzMNuKPBewxpq64Z+xy2rOD4c9E0vElckt5wrnLraAMarny9wroMFzF zmzF40VjfTT0sSca8dzowAcN8e7lqHV2h5pOIPUOqC8H8X2nKF512g5DcrKEkJD84imS DE/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=lofp4ue2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id q189si8541462wme.40.2019.02.10.17.21.06 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 10 Feb 2019 17:21:06 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=lofp4ue2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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 ([127.0.0.1]:42225 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gt0HR-0005dL-79 for patch@linaro.org; Sun, 10 Feb 2019 20:21:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gt05l-0005ie-5M for qemu-devel@nongnu.org; Sun, 10 Feb 2019 20:09:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gt05i-0008Np-G5 for qemu-devel@nongnu.org; Sun, 10 Feb 2019 20:08:59 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:44318) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gt05i-0008Em-2E for qemu-devel@nongnu.org; Sun, 10 Feb 2019 20:08:58 -0500 Received: by mail-pl1-x62a.google.com with SMTP id p4so4492102plq.11 for ; Sun, 10 Feb 2019 17:08:50 -0800 (PST) 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; bh=PJAqbiDKYxYxOSUmg7S9N0tHoZ0pCVJBOmi1qgJP2Co=; b=lofp4ue2VWOtrXmgafqy5UhMs5IUAsUzs24ekVb5xrimAeSAz9V9es4dtwpzeT1Uzx 7fdeM3iyhnGr2qsdAuv53nYdLUGWmnINHHGAoP9OxjWxpfr3FUeTP91Ub+Fk04apyJ/9 W75e3qoULTbuGRaUxpkAZGAt/yVCIB2AeWvN6fEizbCECYbJSlxLEEuCseAic8O44Hca d4UHMIJKm5I4QQTnB4IrjPEMkBeHsieAwouhhdy8HyDU5W4HxtBJdsB5XP7ZGvJFHLRF 1spVW7dIwKxEw0e/8knN0jGhwtK5Yv1UrktFekgLnmH0eWbPfC1xPYgHSlf3xdEGplum y/DQ== 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; bh=PJAqbiDKYxYxOSUmg7S9N0tHoZ0pCVJBOmi1qgJP2Co=; b=bxEQpa/i7FPPc8qOBkMXeoZ2c/9n4scUCODP+taDSxWMS6KlS2dzPOKFb8RoPFScyA PU1S1eN2qrpAfWDMLhLHs77JAGqykCiY76HwqtnbcXsKA+raideDULpWQYODvm8EKKt1 3qNZS15opy5oz/abSOjPuL9fqjDpsW6Z5wJf18ZeD2dz49rn4GeK3+GbSUB4DjQBGVKk jO2xtc5tj/IsFyV4jr9WEFa289pKhoLsF1Gc9MmgXs8yCv20cf1llVLV/UD/t7xJnk8M JF+LktD+xKhi9NgVRogYE7QxdBj5uf/HkcoI/y7CMxnlkQYj8S+iyAItL0LDiEWWmwG+ GZdg== X-Gm-Message-State: AHQUAubdb6srcAC6AA6oUM0+E9j7IjTXwJLJ/rTQJc+SDB5dzOo9iAsE AKHTpcbshJed7aauCXW2DiiSFrhHRJ0= X-Received: by 2002:a17:902:aa07:: with SMTP id be7mr34837830plb.63.1549847329012; Sun, 10 Feb 2019 17:08:49 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id g14sm17177630pfg.27.2019.02.10.17.08.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 Feb 2019 17:08:48 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 10 Feb 2019 17:08:16 -0800 Message-Id: <20190211010829.29869-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190211010829.29869-1-richard.henderson@linaro.org> References: <20190211010829.29869-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::62a Subject: [Qemu-devel] [PATCH v2 13/26] target/arm: Implement the SUBP instruction 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- v2: Fix extraction length. --- target/arm/translate-a64.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) -- 2.17.2 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 2e0d797294..3e46ee6f69 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -5132,19 +5132,39 @@ static void handle_crc32(DisasContext *s, */ static void disas_data_proc_2src(DisasContext *s, uint32_t insn) { - unsigned int sf, rm, opcode, rn, rd; + unsigned int sf, rm, opcode, rn, rd, setflag; sf = extract32(insn, 31, 1); + setflag = extract32(insn, 29, 1); rm = extract32(insn, 16, 5); opcode = extract32(insn, 10, 6); rn = extract32(insn, 5, 5); rd = extract32(insn, 0, 5); - if (extract32(insn, 29, 1)) { + if (setflag && opcode != 0) { unallocated_encoding(s); return; } switch (opcode) { + case 0: /* SUBP(S) */ + if (sf == 0 || !dc_isar_feature(aa64_mte_insn_reg, s)) { + goto do_unallocated; + } else { + TCGv_i64 tcg_n, tcg_m, tcg_d; + + tcg_n = read_cpu_reg_sp(s, rn, true); + tcg_m = read_cpu_reg_sp(s, rm, true); + tcg_gen_sextract_i64(tcg_n, tcg_n, 0, 56); + tcg_gen_sextract_i64(tcg_m, tcg_m, 0, 56); + tcg_d = cpu_reg(s, rd); + + if (setflag) { + gen_sub_CC(true, tcg_d, tcg_n, tcg_m); + } else { + tcg_gen_sub_i64(tcg_d, tcg_n, tcg_m); + } + } + break; case 2: /* UDIV */ handle_div(s, false, sf, rm, rn, rd); break;