From patchwork Mon Aug 19 21:37:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 171700 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3555081ily; Mon, 19 Aug 2019 15:10:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGuQEp9sMqMbyxxztYaebEgV2BsTZYp2+19ZeEvdwQdJ2/1fBQBKKsv69u2rsb7zTrM1wR X-Received: by 2002:ac8:460b:: with SMTP id p11mr17803467qtn.93.1566252618690; Mon, 19 Aug 2019 15:10:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566252618; cv=none; d=google.com; s=arc-20160816; b=apvIGVfl4iM3ws9YRfmRoL8Niaad4fxOs2cDb07Z81HyeNAssdkiM5nRRMh/xVmYzz ma3ie6lzLLhIoV+oFktDL9dkh3XxrVrhXXdMG51T2upKpTEtOl5s+4ycQFEWbP1iIMf+ M2hUI9RipuzczWBOaln3P0lFXucg263Bk3/WM83h27I8Q0BHUuHEMgIqoOGwpW59rpBU d3c2NTilkP1b1m9E4QbdWvGsAM3eXyxTairEEL2j4h/apLpZKLdv6RcVB3qDAyHvfsf+ mu97bgYK+bjXH3nZ3WOf+s2Pd2VeLcGHChdDnDgjTEA5jm1YYaKvP6vz4zp4HaBzIyET Ij2w== 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=UChj47Tk8bdejdFnV6vdPORz5eDZg2iYcmHyUtBCb38=; b=VDSIJeltqAyroRkRsFz/AXWGKVV8hW29GlBMPWipJb5+BPDefDYKnKb4plCofX6oqu 8jt774D+h+RKExBVZ7keN/1cros2Qxm6l/BW82qkKZ5qzarP//j4ex56J13L6/JVcRY6 ra8mO8b9cOdPE3/OC8xwsq18crRU2B5+ZZMwaF63UxPS58ll52L/8XIoNYK7L8GQObb1 SGf1vp5r0M7xz4vqUHNhnYIVjvQ6VdB592DfwGJ1R9QqH+hJX/d6fXF19Vpzi958HzFj 1/dh3RnQRy5OLkaLByA80TZQwIfPzwj9NuXIE00A31Nm4z/TBr/tfnXxTCmpIAKAeKtI mWUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RsDh0VI+; 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 x32si9783225qvf.215.2019.08.19.15.10.18 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Aug 2019 15:10:18 -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=RsDh0VI+; 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]:59578 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzpqz-0001Og-Su for patch@linaro.org; Mon, 19 Aug 2019 18:10:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59694) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzpMi-0002Uq-FJ 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 1hzpMf-0006fX-An for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:00 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:43337) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hzpMd-0006c2-7z for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:38:57 -0400 Received: by mail-pf1-x444.google.com with SMTP id v12so1937428pfn.10 for ; Mon, 19 Aug 2019 14:38:54 -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=UChj47Tk8bdejdFnV6vdPORz5eDZg2iYcmHyUtBCb38=; b=RsDh0VI+3TDvB/NdPYoknfGk7dHH7mMgWZnrlQx6TlORcBl3SNwSFk9BBsiMp3M2GY Om2LJwKbLJt6cGvBZqChMgSAkn4kgKJHXGCerSPLw+Ml9quHO85AQtNyN0+s8TMaO0q/ OHYq6FCGbgU/VsejmXBUQn9gzzTEdQp8A1rlbVNV1W9k1VwKI8X7CImNe3L4KKgh8Gnb 2W4hRZMli+w2g/u0Fh9hn9JqFdaQ+/J2LZeYVDish/5S8POpFBotfRnp60YxnTfjSuSH SBH1Jr615WL2ZnfToOhjoiGoDURu71TsHPT/M4NPcV78fXXxb7n8JJOnDaUCjtKuAdhJ 80dg== 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=UChj47Tk8bdejdFnV6vdPORz5eDZg2iYcmHyUtBCb38=; b=mqaWX0Y+jhDODGMFnJGj3mMekzWThSEQQtostw4+QPNBUgSCjzVXXZfIFc0V0mYllF TSDmY+V/tn79IElMV2A4t5IPXyYnKNsD4HFCLJ4DWthiFHTG2MpREOXYFLxJLaqTCDgp cAwiVvbAY03uM26eGNhyFhH63OoXC2wQIFvMt1OAfiOVoKSVMvWDQpZ19afhrcx+gIEj 3riLa5CEkhlSAwkOVg8LQcwhtdRV5kF/2mViy4QrNn6X8fmynEqlvebwEQz6XfNghMNI BSzFk0AXv37QTuMvDbDRJwszYIUKFz5S1G0AfwWCdJ3thxYVf2Azt5qNQ88JCWzkHkVC CVtA== X-Gm-Message-State: APjAAAWMh4XAHqMBUOq46HruWw74iTld/8H86QV+oylS6DCWj1QVpSNb 7Y1oTCqVJNefJGYwU+Rdd4hWcS6rbNo= X-Received: by 2002:a62:5250:: with SMTP id g77mr26780026pfb.158.1566250733306; Mon, 19 Aug 2019 14:38:53 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 14:38:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 19 Aug 2019 14:37:33 -0700 Message-Id: <20190819213755.26175-47-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 46/68] target/arm: Convert T16 load/store (register offset) 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 | 51 ++---------------------------------------- target/arm/t16.decode | 15 +++++++++++++ 2 files changed, 17 insertions(+), 49 deletions(-) -- 2.17.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate.c b/target/arm/translate.c index 7c5769bd42..e19961fb6c 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -10745,55 +10745,8 @@ static void disas_thumb_insn(DisasContext *s, uint32_t insn) goto illegal_op; case 5: - /* load/store register offset. */ - rd = insn & 7; - rn = (insn >> 3) & 7; - rm = (insn >> 6) & 7; - op = (insn >> 9) & 7; - addr = load_reg(s, rn); - tmp = load_reg(s, rm); - tcg_gen_add_i32(addr, addr, tmp); - tcg_temp_free_i32(tmp); - - if (op < 3) { /* store */ - tmp = load_reg(s, rd); - } else { - tmp = tcg_temp_new_i32(); - } - - switch (op) { - case 0: /* str */ - gen_aa32_st32_iss(s, tmp, addr, get_mem_index(s), rd | ISSIs16Bit); - break; - case 1: /* strh */ - gen_aa32_st16_iss(s, tmp, addr, get_mem_index(s), rd | ISSIs16Bit); - break; - case 2: /* strb */ - gen_aa32_st8_iss(s, tmp, addr, get_mem_index(s), rd | ISSIs16Bit); - break; - case 3: /* ldrsb */ - gen_aa32_ld8s_iss(s, tmp, addr, get_mem_index(s), rd | ISSIs16Bit); - break; - case 4: /* ldr */ - gen_aa32_ld32u_iss(s, tmp, addr, get_mem_index(s), rd | ISSIs16Bit); - break; - case 5: /* ldrh */ - gen_aa32_ld16u_iss(s, tmp, addr, get_mem_index(s), rd | ISSIs16Bit); - break; - case 6: /* ldrb */ - gen_aa32_ld8u_iss(s, tmp, addr, get_mem_index(s), rd | ISSIs16Bit); - break; - case 7: /* ldrsh */ - gen_aa32_ld16s_iss(s, tmp, addr, get_mem_index(s), rd | ISSIs16Bit); - break; - } - if (op >= 3) { /* load */ - store_reg(s, rd, tmp); - } else { - tcg_temp_free_i32(tmp); - } - tcg_temp_free_i32(addr); - break; + /* load/store register offset, in decodetree */ + goto illegal_op; case 6: /* load/store word immediate offset */ diff --git a/target/arm/t16.decode b/target/arm/t16.decode index 44e7250c55..83fe4363c7 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 +&ldst_rr !extern p w u rn rt rm shimm shtype # Set S if the instruction is outside of an IT block. %s !function=t16_setflags @@ -54,3 +55,17 @@ ORR_rrri 010000 1100 ... ... @lll_noshr MUL 010000 1101 rn:3 rd:3 &s_rrrr %s rm=%reg_0 ra=0 BIC_rrri 010000 1110 ... ... @lll_noshr MVN_rxri 010000 1111 ... ... @lll_noshr + +# Load/store (register offset) + +@ldst_rr ....... rm:3 rn:3 rt:3 \ + &ldst_rr p=1 w=0 u=1 shimm=0 shtype=0 + +STR_rr 0101 000 ... ... ... @ldst_rr +STRH_rr 0101 001 ... ... ... @ldst_rr +STRB_rr 0101 010 ... ... ... @ldst_rr +LDRSB_rr 0101 011 ... ... ... @ldst_rr +LDR_rr 0101 100 ... ... ... @ldst_rr +LDRH_rr 0101 101 ... ... ... @ldst_rr +LDRB_rr 0101 110 ... ... ... @ldst_rr +LDRSH_rr 0101 111 ... ... ... @ldst_rr