From patchwork Wed Sep 4 19:30:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 173023 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp409384ilq; Wed, 4 Sep 2019 13:33:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxX9V8FOhzmblhCHdaWzheX1mehCO8b9pm4yJ7o3NDWFN1xLLmzbIfGdYPlA42XdYqe2ufz X-Received: by 2002:a37:a755:: with SMTP id q82mr42033447qke.113.1567629221984; Wed, 04 Sep 2019 13:33:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567629221; cv=none; d=google.com; s=arc-20160816; b=e7iFgob78+HvFNwc4rB6K37CiWvNgixC3jtdKgjbZA3MfLCYN3kmpvyqoWK3gA3jsO eaTWWHgovNB132eRRVThGVMSqz4MqnsdjvBbM51FIUhPp4EaFFdxXtKYaCQAizJHxM7q 5wePlyRY9SRZ+YBAXNZtBpt0DSOAbbtG3zDNsXqqvAG9c0khf5UVBEDd+lZzcAxZFIOa mj1a7PWoFkBBmtJZtJyrnXlSPN/ZUf5IzzVnXOhKC/ZE3pQ76etI6WzFF5TeZoif5k0U AsLU173s2aVXmfAfwrC9JsvXQxkwDJlJkItj5frBVYUYIeUP06NMLNLBVY7QJz7rdhrY ksOQ== 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=ii0cMPAGKfEnN3ypyinsSm3eOg33D1bxwpstQorBMS0=; b=cl5Xbx1BGmNoX0y6uw5c6Na8K4aHEab/cwo/0trQ9IjAbfITUtdAqR278qq0WVnzun wNrxKijoTvDRy77Wq38lpmCf8eSertU4nmU0I+YjdOIyo2oqkCCUwKC3oDIpPJ+hcuRw JNIkmSx5KgGzJly6jkUcWpQ84GYDs2gckUTt3Q35hzfcNmvB0db8Ra5Emh2+u97QmB5M 21rGV27x9N1Mv1BDZ/5USxgXDTjL/hFGlATl4VCY3vuyUXU+bW6mc14jGLGlvETfFdSt 5soZXiTxbErfPHZWhs9DdSn+Gj5HwiQrXbF16MT+Ilg4Clme8vL177i7htcg4ONzDBhb fAeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rByK5jGY; 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 g31si3722262qtk.2.2019.09.04.13.33.41 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Sep 2019 13:33:41 -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=rByK5jGY; 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]:38952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5byG-0000Ss-Pb for patch@linaro.org; Wed, 04 Sep 2019 16:33:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40991) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5b0j-0005Ly-C2 for qemu-devel@nongnu.org; Wed, 04 Sep 2019 15:32:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i5b0h-00030H-My for qemu-devel@nongnu.org; Wed, 04 Sep 2019 15:32:09 -0400 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:34218) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i5b0d-0002vw-N0 for qemu-devel@nongnu.org; Wed, 04 Sep 2019 15:32:05 -0400 Received: by mail-pl1-x643.google.com with SMTP id d3so16330plr.1 for ; Wed, 04 Sep 2019 12:32:02 -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=ii0cMPAGKfEnN3ypyinsSm3eOg33D1bxwpstQorBMS0=; b=rByK5jGYc/ZJLB+fjtlkHdpM4BB6ICctEcRr5PEmHeplJWMUo8/UWvzv+cxuxaa8qb Ska/jeRC8gUSce3U+RS7DEA06Avndg80DMjQyFu8jLlhWksFZShIG3xdgoql+U1o4uXR kRKXWvoQxjAyfkKW1QuxnajjoO6gCTfBfJhSUcZ97Rzo6ICPbcwV5o3UY1jDGCBZzC5j wPLGf+c0Kvd0EgQu0w10E8P1mTpf2/5N8mkGqH2IyluiqOmdyVaEXoD7iMQdr2SY9t3d 0cJnV6QWlzpAVvqrY9wKewukBcCluDedcYhGBKd9nSSx09+qzK80Ut0bIa8F876PPQ9F x3fw== 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=ii0cMPAGKfEnN3ypyinsSm3eOg33D1bxwpstQorBMS0=; b=XjGUaPv912mo5fxPlzEhSE0PDu16RinOeB7xhaLywcwIgAx5mIea7cnvT8bGFZezsm ZooqDxc0g0NqtMdT6Gxjq/EGNsooIfveOPE2BV97PemWSDyWmcdQqFMwDyOirrlOu0nN wLNn0Hk6eqtB+fu/yW/AiU0GXgpKQW3qOZHX1z+PDR6NKvKZCt9EQZHdxORXpUgXI3ca pISUFbFsBmMABuyXdooQVtdOoyWv6f73+ySEJTJo99AGOzTtr3XEw5qbEKsST/Y6MctC UE1sQAbFamJLmpc2Fqo1oegyzQ+Zt+l4bmOmkxKJSWeaUxAjSAriIAbIJXUeTijix9Ra 9p/g== X-Gm-Message-State: APjAAAW56WGgKY8eu8y1+opo3TvJ5/36joEVZOHO8GYp9l4mf1Ovixej h2XWCp34I5/d+gLZzTXjY4pw7fHRmzM= X-Received: by 2002:a17:902:4581:: with SMTP id n1mr43266552pld.310.1567625520776; Wed, 04 Sep 2019 12:32:00 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id f6sm18999174pga.50.2019.09.04.12.31.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2019 12:31:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 4 Sep 2019 12:30:37 -0700 Message-Id: <20190904193059.26202-48-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190904193059.26202-1-richard.henderson@linaro.org> References: <20190904193059.26202-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::643 Subject: [Qemu-devel] [PATCH v4 47/69] 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" Reviewed-by: Peter Maydell 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 diff --git a/target/arm/translate.c b/target/arm/translate.c index b77922f808..789abe9b87 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -10864,55 +10864,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