From patchwork Mon Aug 19 21:37:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 171704 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3557935ily; Mon, 19 Aug 2019 15:13:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzFFi8Jy+dRF+jx7+n8SmhWaYe4+mP2uYMz9H+I6NOf7+Ig0Q9/Y+NWjoTq/fK2++PvbaqW X-Received: by 2002:a17:906:4f1a:: with SMTP id t26mr23120990eju.174.1566252812176; Mon, 19 Aug 2019 15:13:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566252812; cv=none; d=google.com; s=arc-20160816; b=kiSIKsSQXzqbL1ehi0SmVpNBQAc+FFVNP0dqpYyWQS+cVehg2Amxx5lp/Iba4ZT/5D KSw7WR0oR+3Gt77rW9yxufXM5IlTb2W5/hUNH8ZGciRGnL60nGhcfgZLEjx9V1kdjTda FPOpJQKSnuBMXb103onrA4FyCFoTUvD0a0FoR9eOdKcN3kpCiS7AeLMVJw+9HnIi9eF4 fk5EbBfNlhwznLnJU7Rpp6lJV5+VBu3EyOKzq8wMsJKtCYqJQGF8ba6dENa3cY7XKhZd Kh/L0ue/yEUsKoOrgecM05riEWnwKfSmlZmE2cpWJfUEwv44AuluJCCaUBbGizhswyUh J0Lg== 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=IoEU+NRa2JWhajyfKqrmJYRYOBCu04dzJDGI4c2fGqA=; b=xXHkaqfRIOziGMZX2w8ZepfPhNTMkH7wvd3lIqESE3PeLVNjP5WzqkwD6RyT1Qhb9m 79yMXgQm8NjFnKMgV/TaxIOIlpsZ2EQPssVW1KDJ9VF6T3QiZ966Q7BAWtlV1ulaMg8h qwvOPtNaAsaoMQ4VZhI0slYjxX78nCtLPbm3YPSwnsgTOatCXaDp8RNvmGCRrM/IAJ+M +1co1MB1+xNGuv6mQBCTkvIVi5cRZ1ks/bNxVHj00S0Xowre+V9BIebfObhLFFQtrrgw h1I8aXNMqLakP8+KpwlwhadmuOKk8tD+IONEkfbUxTEdkDc2Ve74LlW+EojBaBxNrBuj lZBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fVWboJtD; 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 b50si1809758edd.123.2019.08.19.15.13.32 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Aug 2019 15:13:32 -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=fVWboJtD; 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]:59662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzpu6-0005mu-Mj for patch@linaro.org; Mon, 19 Aug 2019 18:13:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59881) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzpMp-0002ie-FY for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzpMo-0006oa-5V for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:07 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:46335) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hzpMn-0006nf-WA for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:39:06 -0400 Received: by mail-pf1-x444.google.com with SMTP id q139so1934188pfc.13 for ; Mon, 19 Aug 2019 14:39:05 -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=IoEU+NRa2JWhajyfKqrmJYRYOBCu04dzJDGI4c2fGqA=; b=fVWboJtDgcblSVQ9v2jozNz5T7a1y+Km5gqHeD/FUzAxk/yHqNmBGlH/rew6l8AQkP QepSMzHhSmyQAUrW6clwCom0I4ZH7a4AbKrpKv3rQN9Fu392Y15uTTreWqENMsUUwzwr W+YsaCvFpLRS6ZSBB+jv4jA4f3kC0R8N5qRm5M3XH5LHJP/n4VV0vvNTziAWElLdv1gj oBdayyKMQXSYA7OOA9MLEj6CIF+DYCYJ/M7Ws2ByNvT/yMGgqlmPdS0Ciiobqe980ckv yGWtjiiezJW3l746Kj4Yi1uHQepYKgdb2GXyXCZ/8DAYrifELFAwCYPuqcyCJ5BI4dSV 23yA== 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=IoEU+NRa2JWhajyfKqrmJYRYOBCu04dzJDGI4c2fGqA=; b=HGc0HouJIJ5Von44Plm15isphvh6RtAkuV5z1dmDT7zk/OwDYbkJkGFgIB0bXlCJ5k RV6dEUpS3k0wDOd510QohbW9hpTmlMjDXpzSc8Dc++ef8/kCdg9gXINlPQM8PcCYImQ3 2NUvukefWPh4XsbYiTdXpAxxfXI/n7eDoCOSiMV/Q+NAi4hXGs0uGXFfYGyssh+A9ydc vUJj+q1Oqa3eq6mgrYIbrrmlTjz88F6Zgs/7zCZS0A8YnGADaMDP9HxbXgqerKgPmkVm nC7NjwDcIpfFA5EpdtAFirOZkkE4tDPkM+c22Vkv5jtfoqlZ+Cr/+UhsiAv3wXHJS6MY 4Wow== X-Gm-Message-State: APjAAAX+6u+dFMFaHbOAysjls1HvqylqYibh/6qD6UlqCFgJryLWU7zV XyI2/VZRj+prgiQCsO8gqAZPGXCR9hE= X-Received: by 2002:aa7:925a:: with SMTP id 26mr26491760pfp.198.1566250744805; Mon, 19 Aug 2019 14:39:04 -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.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 14:39:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 19 Aug 2019 14:37:42 -0700 Message-Id: <20190819213755.26175-56-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 55/68] target/arm: Convert T16, extract 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 | 14 +------------- target/arm/t16.decode | 10 ++++++++++ 2 files changed, 11 insertions(+), 13 deletions(-) -- 2.17.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate.c b/target/arm/translate.c index cac3893386..414c562fb3 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -10641,21 +10641,9 @@ static void disas_thumb_insn(DisasContext *s, uint32_t insn) op = (insn >> 8) & 0xf; switch (op) { case 0: /* add/sub (sp, immediate), in decodetree */ + case 2: /* sign/zero extend, in decodetree */ goto illegal_op; - case 2: /* sign/zero extend. */ - ARCH(6); - rd = insn & 7; - rm = (insn >> 3) & 7; - tmp = load_reg(s, rm); - switch ((insn >> 6) & 3) { - case 0: gen_sxth(tmp); break; - case 1: gen_sxtb(tmp); break; - case 2: gen_uxth(tmp); break; - case 3: gen_uxtb(tmp); break; - } - store_reg(s, rd, tmp); - break; case 4: case 5: case 0xc: case 0xd: /* * 0b1011_x10x_xxxx_xxxx diff --git a/target/arm/t16.decode b/target/arm/t16.decode index b425b86795..b5b5086e8a 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 +&rrr_rot !extern rd rn rm rot &ri !extern rd imm &r !extern rm &ldst_rr !extern p w u rn rt rm shimm shtype @@ -173,3 +174,12 @@ BX 0100 0111 0 .... 000 @branchr BLX_r 0100 0111 1 .... 000 @branchr BXNS 0100 0111 0 .... 100 @branchr BLXNS 0100 0111 1 .... 100 @branchr + +# Extend + +@extend .... .... .. rm:3 rd:3 &rrr_rot rn=15 rot=0 + +SXTAH 1011 0010 00 ... ... @extend +SXTAB 1011 0010 01 ... ... @extend +UXTAH 1011 0010 10 ... ... @extend +UXTAB 1011 0010 11 ... ... @extend