From patchwork Mon Aug 19 21:37:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 171720 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3567672ily; Mon, 19 Aug 2019 15:26:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxfjXmpsGs2MSkUqp4aqNFLy67NMXW/soYoLVpjZRzpRNc047ma2iR8h2cpqdDBr7H7pRNu X-Received: by 2002:a0c:b281:: with SMTP id r1mr12478620qve.53.1566253561205; Mon, 19 Aug 2019 15:26:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566253561; cv=none; d=google.com; s=arc-20160816; b=dNBjNpOku+3/hSiXFLplyG9LvAcgZfoZr6hbmOebEG/Hju1g6zoOrR3/2vwmOUZzIl XvgF493gf+C5FXHl8vKBttw9S7Xi6+QjlrrIktU/Ag0RRVbjXkvGNOBsLnJ0+Ebq9oyG VnkvcbzzSYjwHxTODeScdxvcHLS+CWwhepYaIJic269R3bLk9A6/lARw63GSfFZPB0av LU+vmo6VTOwqF+VAszN8i1HODqNuyKWSyVd+N6z/1s8gbHlpxDJodeW6jKB10Mc+7IOu H260N8Q2rKH0DgoyXvoyhlZDefFVdk/jevw8d/1Vs6ZpJzYqPYvTLGP0cldXAOcLivoL 9g+A== 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=M247+waxxQ2hFTPZWsca/mTPO3c20Nu5WDueYuMimjE=; b=D5JeZ+xrIftOhipqpSRtCfd2cCNvZa5H4iWSTAT/PW4QuGwwpah+FsWYoR6UOdq/K2 HSen5BauuPPxWiz4d2UxRuWTmOH5kckX3g1fhscDnbI+wr8h1ohUpTp+wzrAgYD8KI9u NmBUaT0yq4ht6VmuYYmnrpcwOtnL7tjIdeLQzB4pueqshkS89eGEHRtCXuJSRchpqXuQ kj2L/fXc3jxLIykYn1ifZ1lRW4rUp19Xo9t6ghMmnaYvZTRfFr4oGXGHISRl9bT9h7mM niYOgqfcH3I6pqGUG0Lj68UTGW35yA/pIjx/nvmpofeKxGnIsmBHB3Bcy6K1Chxz8Ui0 Z6IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=AandmyT7; 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 o8si10009832qvh.112.2019.08.19.15.26.01 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Aug 2019 15:26:01 -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=AandmyT7; 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]:59974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzq6C-0008KY-Nr for patch@linaro.org; Mon, 19 Aug 2019 18:26:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60068) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzpMx-0002wu-6M for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzpMw-0006vN-0h for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:14 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:44549) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hzpMv-0006uz-Rl for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:13 -0400 Received: by mail-pf1-x444.google.com with SMTP id c81so1937653pfc.11 for ; Mon, 19 Aug 2019 14:39:13 -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=M247+waxxQ2hFTPZWsca/mTPO3c20Nu5WDueYuMimjE=; b=AandmyT7HPMjVSMaMH89CbOA7ivydNTRJGV69ZnPB33Knv3spsaObO9fJHxCyJ7/l1 nV/hSRmFRr+WSoSW387d3RH0+qzzajBgZe+/CddOlZDTi6T2UZSynWAyz+abBVI95SiY +ODJY9wy0XQzWLpabMjRwckvUoRM+5neoq++vttpBJxaq8yM2kPDED2xhcpTEwnccX+M ag3VIICw0fgSpHe4W3RqlBdJqhaO6lZ9SsgJOg3GT/77PDKm8zkQWyzN7Q2iwt22sin8 3Mt6Q6K9uvytPrWa3dr5ld6jz8VaFzFMBtshg1dW6h7iUnQlO+K6PCZOIVIOQlJd0hWV SSBg== 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=M247+waxxQ2hFTPZWsca/mTPO3c20Nu5WDueYuMimjE=; b=DmeSyVASk0C30MHhAf+pe1V+w36iz6EtTCdIcF0bq44iAbiYxGlcbuLQBJbwoHHrEj MmaZlIurR9Qd0pL7H0ki8c5zraUP9qzPGKzv0mewR/8UBOsN9HRB5kVi8DbMlYTl3ZMp LBWRkjoMgcGRveZzrn1Y32CYCORdh4pGkV5sA3ZeaI2JBhfwhdKQ1WGLtsI1yQbkKnZq eVYbRT1oz7llbJrvO0pIYhZFbweERRPlF6jgZOpDbn0/hXiPxBhO4f9l+h5oPf0N8C40 eLkjYd2/eV0hfaYh6qzdsx7ejxEM+irr/3MJ4QPlDl/Npx23t4DokTN7P11NQrfJpJpn /e8Q== X-Gm-Message-State: APjAAAW0KUWT1CQiGAg4VqJ4m169ncpSNXzeKySo3fNUOdDevW38s+ZG zlGQl/8RtYMsh5HM2TCwkIou2KWkNAY= X-Received: by 2002:a63:3203:: with SMTP id y3mr22153883pgy.191.1566250752576; Mon, 19 Aug 2019 14:39:12 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 14:39:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 19 Aug 2019 14:37:48 -0700 Message-Id: <20190819213755.26175-62-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 61/68] target/arm: Convert T16, Conditional branches, Supervisor call 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 | 26 +++----------------------- target/arm/t16.decode | 12 ++++++++++++ 2 files changed, 15 insertions(+), 23 deletions(-) -- 2.17.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate.c b/target/arm/translate.c index 5f876290ba..941266df14 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -10599,7 +10599,7 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) static void disas_thumb_insn(DisasContext *s, uint32_t insn) { - uint32_t val, op, rm, rd, shift, cond; + uint32_t val, op, rm, rd, shift; int32_t offset; TCGv_i32 tmp; TCGv_i32 tmp2; @@ -10738,28 +10738,8 @@ static void disas_thumb_insn(DisasContext *s, uint32_t insn) } break; - case 13: - /* conditional branch or swi */ - cond = (insn >> 8) & 0xf; - if (cond == 0xe) - goto undef; - - if (cond == 0xf) { - /* swi */ - gen_set_pc_im(s, s->base.pc_next); - s->svc_imm = extract32(insn, 0, 8); - s->base.is_jmp = DISAS_SWI; - break; - } - /* generate a conditional jump to next instruction */ - arm_skip_unless(s, cond); - - /* jump to the offset */ - val = read_pc(s); - offset = ((int32_t)insn << 24) >> 24; - val += offset << 1; - gen_jmp(s, val); - break; + case 13: /* conditional branch or swi, in decodetree */ + goto illegal_op; case 14: if (insn & (1 << 11)) { diff --git a/target/arm/t16.decode b/target/arm/t16.decode index d731402036..98d60952a1 100644 --- a/target/arm/t16.decode +++ b/target/arm/t16.decode @@ -28,11 +28,13 @@ &rr !extern rd rm &ri !extern rd imm &r !extern rm +&i !extern imm &ldst_rr !extern p w u rn rt rm shimm shtype &ldst_ri !extern p w u rn rt imm &ldst_block !extern rn i b u w list &setend !extern E &cps !extern mode imod M A I F +&ci !extern cond imm # Set S if the instruction is outside of an IT block. %s !function=t16_setflags @@ -231,3 +233,13 @@ STM 1011 010 ......... \ &ldst_block i=0 b=1 u=0 w=1 rn=13 list=%push_list LDM_t16 1011 110 ......... \ &ldst_block i=1 b=0 u=0 w=1 rn=13 list=%pop_list + +# Conditional branches, Supervisor call + +%imm8_0x2 0:s8 !function=times_2 + +{ + UDF 1101 1110 ---- ---- + SVC 1101 1111 imm:8 &i + B_cond_thumb 1101 cond:4 ........ &ci imm=%imm8_0x2 +}