From patchwork Mon Aug 19 21:37:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 171723 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3569251ily; Mon, 19 Aug 2019 15:28:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOpoT0XtzFvn6FyNolfwzMhgjH+3fwhKId73aFMeNk46X3+5osrQkCFtFi5Z7OOZzCI97a X-Received: by 2002:a37:64c8:: with SMTP id y191mr3945718qkb.210.1566253685211; Mon, 19 Aug 2019 15:28:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566253685; cv=none; d=google.com; s=arc-20160816; b=yZwjqHASmqegbNxdIaGWvNQlv6HsKwJABBCNT9DMiBtV2NusQoFh2pmUdYsz+M6/oU /R/hzQsrRpghXmZKpE/CzLSShgSXeoTh77FMcTBgg5MfI9YzER4PXeY/dHaJ5pgq11tC TaWmLR6mZaQOvjh1QfUi06N7a6HkeKXEDJvnee6dAdx1M25Yi9Pbg7EURvffZE86Rnoi D/Sh2VIlnSp8eXulbTMid7ox/xfgudSwHX9PReA2ZeTdT1jqFwscirQBVPOaf7e/oRKd xLWIuxuWlwBTIa7lQyE//euKX39ypakbvsGikPU/Dy4W+tZpkL9l3IvKmOryznicF1cq gQGw== 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=5Xh6zbX+N9ttY9MdN7vquKBp46pmYyv37TGDy5UrKa0=; b=h1LBsyEZhw1Kw0MbSj8jH/0piBLvCPjNnKz0PpWqCXCnJkHwi/4ilxfXWknX7vIm8M 3gvSDRWQlF/ry+flullA4oXQkbSTN32d2DdyddBWt31H79wcZa/g+J8P+cIurPnu6/PW yuiRoOQgTq4V/Bilu5EdyOw0m2p6v0oRwTcqusvCwmW6NKwqpoFY7ERZxFSsZKbJ6T20 /CocKla1+qTVT5qnwztvDLK48C/4HvRnajQPb2+smDIZUwJ4Grl99VmmC8IvOKUMG1J7 G5SNL4lyWqnLQCZ0h9Gdp4aWyxWThus2sNZKf3r+mn8j+Dxi7ZkHVO/C+XvWKuC7GkNm YtdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GEauZHcm; 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 i29si10044910qta.109.2019.08.19.15.28.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Aug 2019 15:28:05 -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=GEauZHcm; 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]:60026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzq8C-0003LA-QY for patch@linaro.org; Mon, 19 Aug 2019 18:28:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60112) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzpMz-00031U-I4 for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzpMy-0006wv-EQ for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:17 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:44549) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hzpMy-0006we-9G for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:16 -0400 Received: by mail-pf1-x443.google.com with SMTP id c81so1937724pfc.11 for ; Mon, 19 Aug 2019 14:39:16 -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=5Xh6zbX+N9ttY9MdN7vquKBp46pmYyv37TGDy5UrKa0=; b=GEauZHcmeYZyYb7r0mtCqhm7fEgMEQr7ln33eZAolSBWsVQIW2vrWi9MsyV6MO0nuy maE5eUhj8CdPEf5/8mYnq1Pd0hx0xe7PTnZgBlyxLaTRbCYIraHcv1ON8rArq/Fa5KQp VEgOys8hsO6GeLmjs2iY9e+MVqgVmSdXynB0PFf4g/YgqafiHuVPjyKI1zaD9e0akV7i 2nktUOkpludSh3/dB79fB6Mrd1k4liQVNvJf54E3zUmv+ut6v+C1Pkvh0ApTx2kQTPtv FY2VQQxLPA3RV7e1vmXcM7ZiUacUfwzOWZcobk6UaAXJVIlnRQqgQFD0Do5VklrFlHmY /gew== 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=5Xh6zbX+N9ttY9MdN7vquKBp46pmYyv37TGDy5UrKa0=; b=pk4OKtzLt0shfwE1dawNSC5o2CaGBYwZZLh4PQT2tDuGjJcQ0yddwegLwQGqIFgM8w zbMevdW4JB3jdf0Ha0mHoUL/fu2/wfZ/OwgcKCACiGd5N6REiEcRb9H20joONqQtwwnF yHrl9QUsMWT2pSMxxb91YEAAvso8PEWHnoXmEg3UECF6TUiLf0oy64Y425+r5xH3OttA 6C4Nj5m/RQ6xW9sX7fBJrdVyN8Idy4H8GVjN9guTEWiXHpg9x18PpLhqzQEICBsd0mnz g8o8Hs29ay5y3C7uE0Xo97dcbj62n1AiQa9x5qF40lD1dZMkmItML2z6018FeJjlJesu P42w== X-Gm-Message-State: APjAAAV5aRZ/oP4VoadW3vbRyur9jzyENXmN/lMr/WA4z2meoNlviTMI VPDo/7uPRmI4FfHX/2BgFI1ChFiGcUk= X-Received: by 2002:a63:1f03:: with SMTP id f3mr21525885pgf.249.1566250754989; Mon, 19 Aug 2019 14:39:14 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 14:39:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 19 Aug 2019 14:37:50 -0700 Message-Id: <20190819213755.26175-64-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::443 Subject: [Qemu-devel] [PATCH v2 63/68] target/arm: Convert T16, shift immediate 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 | 26 ++------------------------ target/arm/t16.decode | 8 ++++++++ 2 files changed, 10 insertions(+), 24 deletions(-) -- 2.17.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate.c b/target/arm/translate.c index dc670c9724..dc3c9049cd 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -10630,7 +10630,7 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) static void disas_thumb_insn(DisasContext *s, uint32_t insn) { - uint32_t val, op, rm, rd, shift; + uint32_t val, rd; int32_t offset; TCGv_i32 tmp; TCGv_i32 tmp2; @@ -10642,29 +10642,7 @@ static void disas_thumb_insn(DisasContext *s, uint32_t insn) /* fall back to legacy decoder */ switch (insn >> 12) { - case 0: case 1: - - rd = insn & 7; - op = (insn >> 11) & 3; - if (op == 3) { - /* - * 0b0001_1xxx_xxxx_xxxx - * - Add, subtract (three low registers) - * - Add, subtract (two low registers and immediate) - * In decodetree. - */ - goto illegal_op; - } else { - /* shift immediate */ - rm = (insn >> 3) & 7; - shift = (insn >> 6) & 0x1f; - tmp = load_reg(s, rm); - gen_arm_shift_im(tmp, op, shift, s->condexec_mask == 0); - if (!s->condexec_mask) - gen_logic_CC(tmp); - store_reg(s, rd, tmp); - } - break; + case 0: case 1: /* add/sub (3reg, 2reg imm), shift imm; in decodetree */ case 2: case 3: /* add, sub, cmp, mov (reg, imm), in decodetree */ goto illegal_op; case 4: diff --git a/target/arm/t16.decode b/target/arm/t16.decode index 4ecbabd364..1adad20804 100644 --- a/target/arm/t16.decode +++ b/target/arm/t16.decode @@ -126,6 +126,14 @@ ADD_rri 10101 rd:3 ........ \ STM 11000 ... ........ @ldstm LDM_t16 11001 ... ........ @ldstm +# Shift (immediate) + +@shift_i ..... shim:5 rm:3 rd:3 &s_rrr_shi %s rn=%reg_0 + +MOV_rxri 000 00 ..... ... ... @shift_i shty=0 # LSL +MOV_rxri 000 01 ..... ... ... @shift_i shty=1 # LSR +MOV_rxri 000 10 ..... ... ... @shift_i shty=2 # ASR + # Add/subtract (three low registers) @addsub_3 ....... rm:3 rn:3 rd:3 \