From patchwork Mon Aug 19 21:37:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 171712 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3562924ily; Mon, 19 Aug 2019 15:19:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTAeMehF7b8Be8mJdEiYrxNQblwZcxBV1P+Z6tYtTnG/ShckJYVkNT1uSzFTNnxGn1oXW2 X-Received: by 2002:a37:a9d1:: with SMTP id s200mr22007730qke.301.1566253168869; Mon, 19 Aug 2019 15:19:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566253168; cv=none; d=google.com; s=arc-20160816; b=lZ67F9B46FHKdtvU000unDqsiKCbd6FVpBII6egSr8yT5Eb5ZL33zICxXY8TQYztrn IywpCb8l9UPJk+XIRfIBDknXnL9eAozZB/+cq7mzpGEWHkpw+R4JlNE3AOBZezOYs/h2 DXESQc1ucuVhyl8TfymIiXJXPVHct1rUE2k9R3Rdw6wRM9NygU90VyYBJj7G3ocBsfgu WIHmJhWOUI8xHLMAgjWCxaK4SE6dO8SLalWDzs412P/spWtDONFuwfeB3GIyS8244kyJ LEYFqkaSXRwQ0HE2ckd29XvVFvImav+j0JAfCFVJ24vyITBk7boS5wx4H1wQd9FWbiz7 eWlw== 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=GQyk/IPAzG6M9shM4zauPndvY+PKuQRptTNum9FjIF4=; b=jZ7Z3mA3GAeJxsqLdq64eFqmqbeqTL4OVz+KzVihNSjISSWoMW4590osBHljcd5EAz huFWOBkuEXDHS1Vx++2rOZLPdb3il6vfiVftygEO9F2XQHwfvuyYH2qzMGeb/XGz/8T3 D8LGRdEcT5ZebPFpljE4ntqYAEMJVOAltN1NUcrtC3BApk9EcwcDQtTGB7xXRN5dy7tH L/iJtI8Fz0zWH2Q1pK9DEOmpPLBWwnM29F7syT83/8hQNnmN2IBv2ngY6EbgicqIY29j dm9S8k2A+zKsIoDuQ3Ad2mcBBCrGdGhW5Qi0DIWngfXQ8RqEJCwlKoRxajLPvb1A9ay5 t2Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=U1Wa2Jjk; 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 n60si1842076qte.94.2019.08.19.15.19.28 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Aug 2019 15:19:28 -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=U1Wa2Jjk; 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]:59782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzpzr-0005ON-OG for patch@linaro.org; Mon, 19 Aug 2019 18:19:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60144) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzpN1-00033x-3x for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzpMz-0006xk-NE for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:18 -0400 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:35398) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hzpMz-0006xK-Hs for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:17 -0400 Received: by mail-pg1-x541.google.com with SMTP id n4so1937259pgv.2 for ; Mon, 19 Aug 2019 14:39:17 -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=GQyk/IPAzG6M9shM4zauPndvY+PKuQRptTNum9FjIF4=; b=U1Wa2JjkTtEr8I1MOovLSN8jz9r2NAb/+fR4a83qgEvzMQuaFsju0+ydUzL0JrnKM6 v+JknZURt457WLs4EfvWFAZKCBTTgtK0mGa8bP7Rp54ZKB7iQaqW3SHvJkSUZlxwF/r9 FmsrQGeiPUgb/MFOwXYN/Sr/Gwb3XhNmiJVPiccAApx6KIP2mYhzZtEX5Y2TMZCAllP9 f8IqslOlr/xJxRwzhQTe8GTxCjJiQseyMDE8fiDR7n8z5IIB4BudpxxgFHGkedYnpb4e Aki75HoVSeR9vmPZtpS0yb8kD4Yb4eoO6viR47pqnO+P/6fjeceudHgkWobJUlNDNT2H e9+w== 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=GQyk/IPAzG6M9shM4zauPndvY+PKuQRptTNum9FjIF4=; b=ONtY4pXv2h6RXOB1dlqCclxxwPU1vTNhNUGjubbjZcX1joSTpfZgGzrK7jt+u0b/zT bbDYP5NXz9QVWz9T2TaKLwn4hxzI1uXxElqMF/mx1n61Zo8R3jijJOVdcrMy6g10Of8s 4oBQNLkvU0cI7i+1Z5j/JFcjbGM8V/KRvSk0clZpBXsHTD8hQmIT9Zw89SVqAuDscIcX guC5XptOquJYcxewFk+vAbZYeP+zmumBLxLBezVgNgn8M7UsJakBJb6AkNJCczc1jxC8 C+nVVj7PYwxgZdeVRFN0XPM3/83lkeCFx2bwnnrzipOiOhgjb2IugJ18pE83g3ck9oRr VKhg== X-Gm-Message-State: APjAAAVKj+duo1qAXfcuI2qm3BIsynJa6FOG2SynerbNOZ63kQKneWsa TILdIz+s+MQ5masm/OJamT60MPwJZfE= X-Received: by 2002:a63:30c6:: with SMTP id w189mr21114425pgw.398.1566250756266; Mon, 19 Aug 2019 14:39:16 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 14:39:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 19 Aug 2019 14:37:51 -0700 Message-Id: <20190819213755.26175-65-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::541 Subject: [Qemu-devel] [PATCH v2 64/68] target/arm: Convert T16, load (literal) 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 | 42 ++---------------------------------------- target/arm/t16.decode | 4 ++++ 2 files changed, 6 insertions(+), 40 deletions(-) -- 2.17.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate.c b/target/arm/translate.c index dc3c9049cd..1882057402 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -963,14 +963,6 @@ static inline void gen_aa32_ld##SUFF(DisasContext *s, TCGv_i32 val, \ TCGv_i32 a32, int index) \ { \ gen_aa32_ld_i32(s, val, a32, index, OPC | s->be_data); \ -} \ -static inline void gen_aa32_ld##SUFF##_iss(DisasContext *s, \ - TCGv_i32 val, \ - TCGv_i32 a32, int index, \ - ISSInfo issinfo) \ -{ \ - gen_aa32_ld##SUFF(s, val, a32, index); \ - disas_set_da_iss(s, OPC, issinfo); \ } #define DO_GEN_ST(SUFF, OPC) \ @@ -978,14 +970,6 @@ static inline void gen_aa32_st##SUFF(DisasContext *s, TCGv_i32 val, \ TCGv_i32 a32, int index) \ { \ gen_aa32_st_i32(s, val, a32, index, OPC | s->be_data); \ -} \ -static inline void gen_aa32_st##SUFF##_iss(DisasContext *s, \ - TCGv_i32 val, \ - TCGv_i32 a32, int index, \ - ISSInfo issinfo) \ -{ \ - gen_aa32_st##SUFF(s, val, a32, index); \ - disas_set_da_iss(s, OPC, issinfo | ISSIsWrite); \ } static inline void gen_aa32_frob64(DisasContext *s, TCGv_i64 val) @@ -1034,9 +1018,7 @@ static inline void gen_aa32_st64(DisasContext *s, TCGv_i64 val, gen_aa32_st_i64(s, val, a32, index, MO_Q | s->be_data); } -DO_GEN_LD(8s, MO_SB) DO_GEN_LD(8u, MO_UB) -DO_GEN_LD(16s, MO_SW) DO_GEN_LD(16u, MO_UW) DO_GEN_LD(32u, MO_UL) DO_GEN_ST(8, MO_UB) @@ -10630,11 +10612,10 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) static void disas_thumb_insn(DisasContext *s, uint32_t insn) { - uint32_t val, rd; + uint32_t val; int32_t offset; TCGv_i32 tmp; TCGv_i32 tmp2; - TCGv_i32 addr; if (disas_t16(s, insn)) { return; @@ -10644,26 +10625,7 @@ static void disas_thumb_insn(DisasContext *s, uint32_t insn) switch (insn >> 12) { 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: - if (insn & (1 << 11)) { - rd = (insn >> 8) & 7; - /* load pc-relative. Bit 1 of PC is ignored. */ - addr = add_reg_for_lit(s, 15, (insn & 0xff) * 4); - tmp = tcg_temp_new_i32(); - gen_aa32_ld32u_iss(s, tmp, addr, get_mem_index(s), - rd | ISSIs16Bit); - tcg_temp_free_i32(addr); - store_reg(s, rd, tmp); - break; - } - - /* - * - Data-processing (two low registers), in decodetree - * - data processing extended, branch and exchange, in decodetree - */ - goto illegal_op; - + case 4: /* ldr lit, data proc (2reg), data proc ext, bx; in decodetree */ case 5: /* load/store register offset, in decodetree */ case 6: /* load/store word immediate offset, in decodetree */ case 7: /* load/store byte immediate offset, in decodetree */ diff --git a/target/arm/t16.decode b/target/arm/t16.decode index 1adad20804..f87e6fde50 100644 --- a/target/arm/t16.decode +++ b/target/arm/t16.decode @@ -113,6 +113,10 @@ LDRH_ri 10001 ..... ... ... @ldst_ri_2 STR_ri 10010 ... ........ @ldst_spec_i rn=13 LDR_ri 10011 ... ........ @ldst_spec_i rn=13 +# Load (PC-relative) + +LDR_ri 01001 ... ........ @ldst_spec_i rn=15 + # Add PC/SP (immediate) ADR 10100 rd:3 ........ imm=%imm8_0x4