From patchwork Mon Aug 19 21:37:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 171713 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3563929ily; Mon, 19 Aug 2019 15:20:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGJPvH9nIgDB7H72hvkfhqCRSayjj8kwgNNXener9ddJc4gg3a1fLQRymwSHZ/P9yHhHax X-Received: by 2002:a0c:ee86:: with SMTP id u6mr12640546qvr.38.1566253246541; Mon, 19 Aug 2019 15:20:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566253246; cv=none; d=google.com; s=arc-20160816; b=CWMIGsOCdPfAeyTpGbna8ia7/U10UEAPuRDYacG5Rnjd6A1zCMpaZLPDydWRCRUDg8 nMfYgFE4xDP7ObTEb+TBvEPEgODwsdHJpQeM0W+g4d17uKYgrvX5f6jwAGU0/yTAtISn knYGW+khf1c0xTqTHN8BnIdm9Tvn0VrVQ6w/rUTIDk71V71PqtLzO/8jHO99BPTtww65 rIz0AjmglEn7HgSQh67XCZ0ErL6I8BdJmca6NgLPC1f64EIdGFygWdQceK3QWxURZtev tr+aEFEShx4fEtPy25d0UZpAkook5udzgKvG2OtusG/v+tIhokn4m9ntEwsQynreyV1m HQIA== 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=fWWvdDru9knlRm6IuiK5xbgxCPFGSOj1TibiqgY2wt8=; b=HawofE76i1iwZQ4aBhjEfK8EKBY79yZDJimDRqPRYwF3FU31+EGx0t+xXA+yGWmbmJ EhfBG4a+aUsoI4xgnVP7Kyt8AwG8ourKlCnY4nGiVEnHo5Rs+CNnmQr2AMvl9FF/oJxX nCKJYxpezSDHcz3VhzNf4TGBmsAYYv3/GC5/S8KfiJlWAGw/LES31SY1RQ3wdXuoWilg jl0jGgwYZr+RndEuEfU+38vHAtfdNarfEwcjHyJ4tNfQ00u7AXR1xgec5m037R1uOv6g RSdQF+7uIr///gbz1jZR5ARb5qiBXIgCSZwj+VrFSqKkg/iLRpNGjGYTQ8WynrGNpazC ERmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=grW2OU+w; 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 w8si9330518qkj.219.2019.08.19.15.20.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Aug 2019 15:20:46 -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=grW2OU+w; 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]:59830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzq17-0000DF-4W for patch@linaro.org; Mon, 19 Aug 2019 18:20:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59708) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzpMi-0002VV-S8 for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzpMh-0006h7-Ch for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:00 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:36931) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hzpMf-0006em-9r for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:38:59 -0400 Received: by mail-pf1-x42f.google.com with SMTP id 129so1947313pfa.4 for ; Mon, 19 Aug 2019 14:38:56 -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=fWWvdDru9knlRm6IuiK5xbgxCPFGSOj1TibiqgY2wt8=; b=grW2OU+wjg/5blRzRrGgbm6QX4+AxMXafojAUOXf/h/bJW41xxALJFqKvkV9qG5ix8 +IVCedUWBAVE+xyVpar6Xcw/VcYj3Jf+sSFlvgr654a/rGMqjAM4eY17yJat4Jw8lUve QNQZLPHKWSgT4asBLpPLIwiezLISqCO5o2n2mHQKmU83ivFwZcVw7UAkTgXA2YBHHklg NNURNx8hYC9IlelKGc/iknMcOjBPiOBqHhf3jrKlHgeXDe1ByyNmElFnhJGCNsubmCe0 fKaIVulbcK0mvnet4b4+gzg5Jcg1/kEP5fwZTV3k1ckIGv8jGTgn9N25QcGOhctWD8na lu6w== 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=fWWvdDru9knlRm6IuiK5xbgxCPFGSOj1TibiqgY2wt8=; b=UqMW/8anZtrrvwHNiX2Cpxx/Bm+s6tV4sDiQVMa5/neZYWPowaZMcw35D0zRLlutf1 1emUGbPzBzPNL0ibVamgBxiJIW10YMjvClOJSHeWxaIKoLTJYS1kAEvGLbBeUTNdq5qw lkc/FsWoTcjOckrlzuJUtddS9gZxjjqJHs02s91mLTvoC4/psU3PPrVBtANHA1lp0wEX FA7R4CIyYJOKZPIA7TRtSu7t9iXgqdA6o5e3w3M7sYGmFIvBAuJLt2kN/Ka14gxK9O8a MKgtfgeDoKPMMX7MASiNp6Haani37K/LPjjHOyms5qbcOkWxN4SWLkJR5OAF7x8561Ma t2vg== X-Gm-Message-State: APjAAAUJT0kwobb+pCKvIpcSmKSfgGrmaZZyAI8e8wUoQ8VCS9MeeY6D NVGF8MVFGINzntKRTHSy7Y9qMCSnijc= X-Received: by 2002:aa7:8c57:: with SMTP id e23mr15883178pfd.48.1566250735751; Mon, 19 Aug 2019 14:38:55 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 14:38:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 19 Aug 2019 14:37:35 -0700 Message-Id: <20190819213755.26175-49-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::42f Subject: [Qemu-devel] [PATCH v2 48/68] target/arm: Convert T16 add pc/sp (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 | 12 +----------- target/arm/t16.decode | 7 +++++++ 2 files changed, 8 insertions(+), 11 deletions(-) -- 2.17.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate.c b/target/arm/translate.c index 24537fc107..2640f50fcf 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -10749,19 +10749,9 @@ static void disas_thumb_insn(DisasContext *s, uint32_t insn) case 7: /* load/store byte immediate offset, in decodetree */ case 8: /* load/store halfword immediate offset, in decodetree */ case 9: /* load/store from stack, in decodetree */ + case 10: /* add PC/SP (immediate), in decodetree */ goto illegal_op; - case 10: - /* - * 0b1010_xxxx_xxxx_xxxx - * - Add PC/SP (immediate) - */ - rd = (insn >> 8) & 7; - val = (insn & 0xff) * 4; - tmp = add_reg_for_lit(s, insn & (1 << 11) ? 13 : 15, val); - store_reg(s, rd, tmp); - break; - case 11: /* misc */ op = (insn >> 8) & 0xf; diff --git a/target/arm/t16.decode b/target/arm/t16.decode index 1cf79789ac..71b3e8f02e 100644 --- a/target/arm/t16.decode +++ b/target/arm/t16.decode @@ -23,6 +23,7 @@ &s_rrr_shr !extern s rn rd rm rs shty &s_rri_rot !extern s rn rd imm rot &s_rrrr !extern s rd rn rm ra +&ri !extern rd imm &ldst_rr !extern p w u rn rt rm shimm shtype &ldst_ri !extern p w u rn rt imm @@ -102,3 +103,9 @@ LDRH_ri 10001 ..... ... ... @ldst_ri_2 STR_ri 10010 ... ........ @ldst_spec_i rn=13 LDR_ri 10011 ... ........ @ldst_spec_i rn=13 + +# Add PC/SP (immediate) + +ADR 10100 rd:3 ........ imm=%imm8_0x4 +ADD_rri 10101 rd:3 ........ \ + &s_rri_rot rn=13 s=0 rot=0 imm=%imm8_0x4 # SP