From patchwork Wed Sep 4 19:30:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 173027 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp413818ilq; Wed, 4 Sep 2019 13:38:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtCHw03VI0Pf9T6UQL+Wg/eX0flAG+Dz5zBOic25CzB1zec9la0s8zDVVo7rBP90PQb0Kw X-Received: by 2002:a37:ac11:: with SMTP id e17mr16998386qkm.486.1567629500262; Wed, 04 Sep 2019 13:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567629500; cv=none; d=google.com; s=arc-20160816; b=K92rfD75zp1+MZb0FiQheFt9AFpIlGTRT0LnJBAK9yG1RQTFAx5s+LT5pCkNdX6guQ iTy/fktuAklLUaszQ5WzyyQ24YI5vF0t7OoSCUZK02GnQ8FtpsiwQurlqT1sA7DLW6zS xvEZJGd+gMtoH/9VZcY7o5THhrdQ+fRAdAqbiTsf/nIa4eFDmrwdRT1DaoUlUS9rwIy9 0oh05C2UDKqg+rxvksA1W7IqAo3esOvJ/N4NqKI8+Qx6Fd2/5sd8EgOkFQC5whcUqC2V N0Hs1Ep4cfn7uDpJOYilhUlFir0vhK/6YlkLC/Cc0QVRMbJzrXWITVwJ1L7tj0xO46GZ mB+Q== 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=mvEFFgpnrevoU+lFhaPzzFj5g1KNJYV0Nc7dBdlUE/w=; b=xoQg8x+u3os8znrTyc01r0z9w+ceqIoGXA6101ylZ5Bk9FQ8BVl3j94px2SOMzgyBF NopwdWG6K0B7eJYVXSgGIc+DTslEyPOPayPXj37jA7uBHSRuY9iuBrxB5mTnFNGTWPnt GQvs7P3q6PZSFi86eSbak7GYlbvvhIlpNmjW/7rn0zQ03dIHwonB2XscQ963nVuoCED8 gdZri8z45/0Xter+qRRlhlVU2yPe5DFZ3ieiuRcxEdsX+qvzSbPPOspJsjOsj6kszzGG Bt9jiTVGKkyVXBBW7HhceU9zyXCu41msBtTYybt3HKfM1b8peNZ49ejX/9pff8dKnBJK bzww== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ptVHTZ5p; 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 s1si16896741qti.86.2019.09.04.13.38.20 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Sep 2019 13:38:20 -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=ptVHTZ5p; 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]:39076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5c2l-0006hY-Hn for patch@linaro.org; Wed, 04 Sep 2019 16:38:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41026) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5b0n-0005NE-9v for qemu-devel@nongnu.org; Wed, 04 Sep 2019 15:32:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i5b0l-000332-8e for qemu-devel@nongnu.org; Wed, 04 Sep 2019 15:32:13 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]:41494) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i5b0j-0002xn-9u for qemu-devel@nongnu.org; Wed, 04 Sep 2019 15:32:11 -0400 Received: by mail-pl1-x62d.google.com with SMTP id m9so10055597pls.8 for ; Wed, 04 Sep 2019 12:32:04 -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=mvEFFgpnrevoU+lFhaPzzFj5g1KNJYV0Nc7dBdlUE/w=; b=ptVHTZ5pCK4x2SKJbJUky/7nYPfFcEFhzxz/9NLAUKkyY2bo+dJml+ycY3W/9hDVLp BC1ElBZzE8A+2o3b/o3rR1O+kWNKeStrpPDyB4XPv5x7RV6LcmHz3AjEuwABU4K0rP1F sxvBFp0ELizYO4TdIOr7crjzXymYMb7EiJiC/wB5pUEMuU0lOvU4MtJeQ4vnqPr+tlTI luJs4DDy/umrZVPa/3o5P4B2OOvmwPXECTq0x/Gc4bXvOChniIfV6brkTeAXm3R2MHcb Pn9JcddA1bdJUkBbEjWXjNGmOUfZtFr4HcxgIBUcPAcsoHhW++T/q8ybaNloLUrnj//r tmnA== 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=mvEFFgpnrevoU+lFhaPzzFj5g1KNJYV0Nc7dBdlUE/w=; b=bNPUGS2ulw2Qq2sPAm5e+Y8Dt1J5XOw8alqjawSwTnuNms2gOxE4peOyZ3gGiXMOZG vj8djZzjkUPtfrnBo+yymJA8Jvz38JGCuVxrNd3TOQY+Kvz2/7wqy498X5Iw2FHCTtT/ 3E4cPKVLArvbEKCxkyngV+198ls9k0qaT27H7yp7gXMwqjDS5+WcYmZ8ZSjgJVEAqxoE Tq4Ynj2mTrtayToMNCqmp4T/8VkQ/DG0ya6aDLRbVD+8dL6WiHIpjbxfFkkeBKlBc7V5 +kiVKPiOfeVZng+0gxxQxR5HlfHSTqAl67xfwVMbEpiIqLSbfrzr25//ebUoJBdbMn1k isnA== X-Gm-Message-State: APjAAAVAM9UsJMJsxybhLi2CpLg7A0UiFd3DKPjuYbK852PrBYItE+fw vfamIr9kfovxZQKkWjspTuID411akew= X-Received: by 2002:a17:902:36a:: with SMTP id 97mr4447000pld.75.1567625523206; Wed, 04 Sep 2019 12:32:03 -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.32.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2019 12:32:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 4 Sep 2019 12:30:39 -0700 Message-Id: <20190904193059.26202-50-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::62d Subject: [Qemu-devel] [PATCH v4 49/69] 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" Reviewed-by: Peter Maydell 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 diff --git a/target/arm/translate.c b/target/arm/translate.c index 4ae73d1c92..d8a4c7bf99 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -10868,19 +10868,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