From patchwork Mon Aug 19 21:37:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 171718 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3566646ily; Mon, 19 Aug 2019 15:24:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLy409OGy6r8L06ggburUUuRNFG7ElL/J3D9t9dJfuVa9Yd7JtMbgYSyrx1a8VAcqSdR8d X-Received: by 2002:a37:9802:: with SMTP id a2mr23077814qke.346.1566253478263; Mon, 19 Aug 2019 15:24:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566253478; cv=none; d=google.com; s=arc-20160816; b=CWkrKne6CuyHJ/MF6Ely6BHwma/zJhqlnJO0ySL/Vxn65eaOdfZ3B7/F33I4d+IKFz YbTN1neyUvB4aeWin3DiHAaMbR+N2gWYyLOxYgPQ5obUeLsBLsgQLFf4zCCjvJl+7n8Z rdboZL92qcU9x/tImZCMPvEpO3hX9bTD2GEA40IWT/0/Yqc1ikNIbgNPUZkg+ZnkK+Fy SFqJrbjW0mHJpq4EvqoFtnwle8MK23oTjt/WK8ZIa3484ELkuZDjYcrF4lmk5KA4GoDZ DL+WlUlXHTI5MD8pwVGffvBFWgRkS+Bfyp4luVv95XBKKwqVa6o0UPjqO3bLC6poDX2U QZhw== 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=t3Sk/E++ZxrnmWMmhTr25Xzz1GIdoAzJpID10oiImmY=; b=FlFCOJa5dwo2k4i0h6sJsONHDQvsQLhNW/4joIZdKAYr185qpqT0KcGWbb/3t8ylgZ H+PkOtoq9XouoSWRqH6QxaHL+za15QgRP7S3rzKMeTuwtCKpUa86sgYx+ihuEVeyLoay VWfY6HUgbE33QrUZxrmsv0LjgxSfPNP1TKyl1wrIvlZnhktwfT4s10xfV6JPabIa7kVf 34Ku++VJB3geklnme0v/kQUAOyjm9RCoDsuM5gmuztO4g4gYAmrN8mDGD74kMxinvAxf rlCPxQL34WOEj9m1K3FPvj4XIpv8Weg3thqoh244RaOjt0KyGEi45P7bYGZYLKodzliR 3OBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ok3UFEdR; 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 l19si8875182qve.49.2019.08.19.15.24.38 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Aug 2019 15:24:38 -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=ok3UFEdR; 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]:59958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzq4r-0006GW-PB for patch@linaro.org; Mon, 19 Aug 2019 18:24:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59780) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzpMk-0002YI-DE for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzpMj-0006jE-53 for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:02 -0400 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:43336) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hzpMi-0006iJ-Ux for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:01 -0400 Received: by mail-pf1-x442.google.com with SMTP id v12so1937607pfn.10 for ; Mon, 19 Aug 2019 14:39:00 -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=t3Sk/E++ZxrnmWMmhTr25Xzz1GIdoAzJpID10oiImmY=; b=ok3UFEdRGD0YJd50WuI90ajBk8TNZGyW8QH/1774NdQnLoVOk0cW+80VXhPKHOm0Bj Pr3bjHt/4LTtedHVGCkro5MdQQzYzyRMRFiwdbKaGmc1TDEwCYKToWdFxLpf5jX0IgMd qwoCY2aEVfCAo2e4KotWxk+LohIDwv0yRTm9qF+kPjtHsZtZ6IPTbQWmOgLYueK0RnZP nLtOoVdiaxe7ialYgoI+h4Kc2W3ICzdaac47K/GGJqm/dPyC3sK3T0y2Hao5TUUid7W5 4Izauc/CShQ9Vqlr/8rvpsoxgGMIEZB8lWXcx2/+vLI4i3BJlNhYE+Vwpw1ZfCTe6mjQ QKzQ== 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=t3Sk/E++ZxrnmWMmhTr25Xzz1GIdoAzJpID10oiImmY=; b=RfwFH1rJteXbFi41A8SYNdyBCYbuVKC6UH67ia8nfvYWqBjhgo+rejBJdACy1i68zG B5xIaniCNSKYf4ub2+ulWwLO75eDG/rAJOPx40eXF65fzrLxiHR1VQyK8OvF90znIW2X mBOFEGjx+jza9FHsHC++7FpwJl+W4xS8eO/tijXJiGohduGh2LqHKHH8/Y8Dxn+9NO+A t7Medxki7BR8TGjgq+gVhX0JOnoxH2ZonP9cMOKBcsIr1kMDOBLpLJdHN35xeBVCbc0T l08wvt6FcIWAtRTDV3iFCYln6z92x+BEbp4u1pD/qtAB8Yzp94Kpbn8u1b1LxIC3I0g7 jj4g== X-Gm-Message-State: APjAAAXGIN7gnnxROrDjgs7WaBG/iKzhk+WkLHmL4L+7EkrkrraybKsA BDGp8f8xaSV813CdvaNvIeGnzGyZbN4= X-Received: by 2002:a17:90a:4485:: with SMTP id t5mr22658907pjg.65.1566250739222; Mon, 19 Aug 2019 14:38:59 -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.38.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 14:38:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 19 Aug 2019 14:37:38 -0700 Message-Id: <20190819213755.26175-52-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::442 Subject: [Qemu-devel] [PATCH v2 51/68] target/arm: Convert T16 one low register and 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 | 44 ++---------------------------------------- target/arm/t16.decode | 11 +++++++++++ 2 files changed, 13 insertions(+), 42 deletions(-) -- 2.17.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate.c b/target/arm/translate.c index 6f30415371..3a3b113822 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -10586,48 +10586,8 @@ static void disas_thumb_insn(DisasContext *s, uint32_t insn) store_reg(s, rd, tmp); } break; - case 2: case 3: - /* - * 0b001x_xxxx_xxxx_xxxx - * - Add, subtract, compare, move (one low register and immediate) - */ - op = (insn >> 11) & 3; - rd = (insn >> 8) & 0x7; - if (op == 0) { /* mov */ - tmp = tcg_temp_new_i32(); - tcg_gen_movi_i32(tmp, insn & 0xff); - if (!s->condexec_mask) - gen_logic_CC(tmp); - store_reg(s, rd, tmp); - } else { - tmp = load_reg(s, rd); - tmp2 = tcg_temp_new_i32(); - tcg_gen_movi_i32(tmp2, insn & 0xff); - switch (op) { - case 1: /* cmp */ - gen_sub_CC(tmp, tmp, tmp2); - tcg_temp_free_i32(tmp); - tcg_temp_free_i32(tmp2); - break; - case 2: /* add */ - if (s->condexec_mask) - tcg_gen_add_i32(tmp, tmp, tmp2); - else - gen_add_CC(tmp, tmp, tmp2); - tcg_temp_free_i32(tmp2); - store_reg(s, rd, tmp); - break; - case 3: /* sub */ - if (s->condexec_mask) - tcg_gen_sub_i32(tmp, tmp, tmp2); - else - gen_sub_CC(tmp, tmp, tmp2); - tcg_temp_free_i32(tmp2); - store_reg(s, rd, tmp); - break; - } - } - break; + case 2: case 3: /* add, sub, cmp, mov (reg, imm), in decodetree */ + goto illegal_op; case 4: if (insn & (1 << 11)) { rd = (insn >> 8) & 7; diff --git a/target/arm/t16.decode b/target/arm/t16.decode index 2b5f368d31..0654275e68 100644 --- a/target/arm/t16.decode +++ b/target/arm/t16.decode @@ -133,3 +133,14 @@ SUB_rrri 0001101 ... ... ... @addsub_3 ADD_rri 0001 110 ... ... ... @addsub_2i SUB_rri 0001 111 ... ... ... @addsub_2i + +# Add, subtract, compare, move (one low register and immediate) + +%reg_8 8:3 +@arith_1i ..... rd:3 imm:8 \ + &s_rri_rot rot=0 rn=%reg_8 + +MOV_rxi 00100 ... ........ @arith_1i %s +CMP_xri 00101 ... ........ @arith_1i s=1 +ADD_rri 00110 ... ........ @arith_1i %s +SUB_rri 00111 ... ........ @arith_1i %s