From patchwork Mon Aug 19 21:37:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 171721 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3568498ily; Mon, 19 Aug 2019 15:27:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzD68gog3ukS20tF2G2u4VPSGbSkpFL8p/joZOmZ0Zg1DdIXFn7UHbdjpYN6GKQQ00fS1QM X-Received: by 2002:a17:906:3715:: with SMTP id d21mr13570968ejc.104.1566253631117; Mon, 19 Aug 2019 15:27:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566253631; cv=none; d=google.com; s=arc-20160816; b=oBRFt+MEvELTiIVaMGHf09Xp+lFUZlLO4c1ulXCc2J1uupyKfG5sKCMcA3VqBcb+gZ qy4e379GL+lmbW/RUdll+a/hUyyQf1UW9LvpEq3wXtge/N4cuKBKE3G+jthMUGMq9IFv koZAnk6tJVzyZxHKXLt6e6GHBlGVoTQ3iyuY19F0dbwd1wUVjTWG5KdQmBA8jOQ5CR6T KHV2ZrOfsVDMz2974MRUXRwDjrz1OoxCbOs5tQXfBKkRIpanGFbzMvcJoCkAGmqC+WJN 8kFNuQY3eWbeYcptMfwOdSjvMdPVR9sXxpg5+Hy0isub/Kpc9wOPSoVYtaaEUqmdb4d6 eKxA== 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=A/kxiGsWb33X0BCIForTFk+4xWAxXqSlHmM910wf6kg=; b=ouFd3pDhUzaDzXp4Qm+hnFcSfS55RpW1ByrXMd6i+EFOhgywCXThQeq/tW4axBN1Ff 0CHd8hRS/9YeGZpgNXP9w2lWPEyVmOQCCaKiL99ThX/WYin85uxl1k0nJEPGR2pYxqa5 TquNZ5PzkRcO9bTkEnc8ffSGjdiwGsEIKMcKgVPB5wHfsKEuGyQSJ9dPzHkEH1b5k2dS 9JhoPjEndy7xXC4bvWs/dfeYjWjlZQH0JU4ioQxVCj4WVbNFQWt8CUYnzR0XIyQf/RoN FJPQ5oBfGUwj07Ke8S+OxEMqa1SAwtBTpcVAfZnvG7Dn+ch9x5Gk2C/STLPJbjwZG14Y dN6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=x9ssxPL8; 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 u24si7647204ejb.5.2019.08.19.15.27.10 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Aug 2019 15:27:11 -0700 (PDT) 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=x9ssxPL8; 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 ([::1]:60010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzq7K-000230-2G for patch@linaro.org; Mon, 19 Aug 2019 18:27:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59830) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzpMm-0002cw-Tb for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzpMl-0006lh-OP for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:04 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:41888) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hzpMl-0006kk-HS for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:03 -0400 Received: by mail-pf1-x444.google.com with SMTP id 196so1941437pfz.8 for ; Mon, 19 Aug 2019 14:39:03 -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; bh=A/kxiGsWb33X0BCIForTFk+4xWAxXqSlHmM910wf6kg=; b=x9ssxPL87BlkTXhaz2s9f10VQLKxuH3fZVfv+qFjGSWUwCho1+Vd6gZw85my0aUcM4 QeV4aX2/ZvXJL7x8lKoStAOfyA0diBQ2NOo2dPULSAGByv5Z3SaGpuJNRCkV/njnLjk/ 3m6mRcocMnvo89bOs/D/l7Gwrbo8FbiFP5grumenlGslPdfqC2/1PaJxKr/ySdFughgb O/xkaXwGyICV0FEfRySl/y0HE1ABu8WzXQ91WPrZZIFojMZf4u8iaKIxxrJG4o3y3dnQ t+BYMHriU7cvVZmKWxXhumoVx1p4wRE5mPRDk1z1JSUQG7wNfKbi+FMDOWpr1w7B51Fh E0zQ== 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=A/kxiGsWb33X0BCIForTFk+4xWAxXqSlHmM910wf6kg=; b=orQ8FDm7GseuuwJhumnGJk91hQSjNJkrTGSWHHxVEQUjhuzxZvcP+5jusm8gL68fB0 +aehpIR+b3bLtsWsIU44t0gTsR/ObDU4htH7u4q3wyHy1ddV37D/O/wlTqwcivbrqTUa MvnGvKlHIov+MqWNDuvUvsbsUwVZ8eOpfaxCI9MKdYeE9lCmeH5DOZV0p6cuyjancjAU wOsAWUbeAh78sj8iLHjngCHMOxxyDiOd0T21UJT+kpmluFTn0Y340QmrFpTWvUuB7wxa UI00RtrMNg0yw+pitPr7TPeftXvsCQ8jb3RSAThvPxrKxX6GTr++Ba4GLgKCqqm1M9e3 yXpA== X-Gm-Message-State: APjAAAX2vgbreWUlYQ/dFzDyZp+kohCKWncOEdxx/BTnFkJQVrSxIDKL DYnEi8QuSzneOGcEuU9krYNtLEBMvpI= X-Received: by 2002:a17:90a:fa82:: with SMTP id cu2mr23548752pjb.85.1566250742275; Mon, 19 Aug 2019 14:39:02 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id d2sm13446951pjs.21.2019.08.19.14.39.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 14:39:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 19 Aug 2019 14:37:40 -0700 Message-Id: <20190819213755.26175-54-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190819213755.26175-1-richard.henderson@linaro.org> References: <20190819213755.26175-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::444 Subject: [Qemu-devel] [PATCH v2 53/68] target/arm: Convert T16 add, compare, move (two high registers) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" Signed-off-by: Richard Henderson --- target/arm/translate.c | 49 ++---------------------------------------- target/arm/t16.decode | 10 +++++++++ 2 files changed, 12 insertions(+), 47 deletions(-) -- 2.17.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate.c b/target/arm/translate.c index 60bfc943a3..e639059a5a 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -10620,55 +10620,10 @@ static void disas_thumb_insn(DisasContext *s, uint32_t insn) store_reg(s, rd, tmp); break; } - if (insn & (1 << 10)) { - /* 0b0100_01xx_xxxx_xxxx - * - data processing extended, branch and exchange - */ - rd = (insn & 7) | ((insn >> 4) & 8); - rm = (insn >> 3) & 0xf; - op = (insn >> 8) & 3; - switch (op) { - case 0: /* add */ - tmp = load_reg(s, rd); - tmp2 = load_reg(s, rm); - tcg_gen_add_i32(tmp, tmp, tmp2); - tcg_temp_free_i32(tmp2); - if (rd == 13) { - /* ADD SP, SP, reg */ - store_sp_checked(s, tmp); - } else { - store_reg(s, rd, tmp); - } - break; - case 1: /* cmp */ - tmp = load_reg(s, rd); - tmp2 = load_reg(s, rm); - gen_sub_CC(tmp, tmp, tmp2); - tcg_temp_free_i32(tmp2); - tcg_temp_free_i32(tmp); - break; - case 2: /* mov/cpy */ - tmp = load_reg(s, rm); - if (rd == 13) { - /* MOV SP, reg */ - store_sp_checked(s, tmp); - } else { - store_reg(s, rd, tmp); - } - break; - case 3: - /* 0b0100_0111_xxxx_xxxx - * - branch [and link] exchange thumb register - * In decodetree - */ - goto illegal_op; - } - break; - } /* - * 0b0100_00xx_xxxx_xxxx - * - Data-processing (two low registers), in decodetree + * - Data-processing (two low registers), in decodetree + * - data processing extended, branch and exchange, in decodetree */ goto illegal_op; diff --git a/target/arm/t16.decode b/target/arm/t16.decode index edddbfb9b8..5a570484e3 100644 --- a/target/arm/t16.decode +++ b/target/arm/t16.decode @@ -146,6 +146,16 @@ CMP_xri 00101 ... ........ @arith_1i s=1 ADD_rri 00110 ... ........ @arith_1i %s SUB_rri 00111 ... ........ @arith_1i %s +# Add, compare, move (two high registers) + +%reg_0_7 7:1 0:3 +@addsub_2h .... .... . rm:4 ... \ + &s_rrr_shi rd=%reg_0_7 rn=%reg_0_7 shim=0 shty=0 + +ADD_rrri 0100 0100 . .... ... @addsub_2h s=0 +CMP_xrri 0100 0101 . .... ... @addsub_2h s=1 +MOV_rxri 0100 0110 . .... ... @addsub_2h s=0 + # Branch and exchange @branchr .... .... . rm:4 ... &r