From nobody Tue Feb 10 01:50:07 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1567628854; cv=none; d=zoho.com; s=zohoarc; b=Dikg2SR5Lr+Nq5vzeOCPbOICIgXvMP5jDg92f9oSFsMG+q5BuNERwsMIld6HBjSJRahGMXTJUVYwaZv6XsJwB19T8Uq2tT2huATIuf3FNPOd3ozbtqezfH2IzPGutI+ZBM+5/djU+nijRYIJmBlxoH1kV72mHq6DhrIGJLIxXAU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567628854; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=yenO3oE4SSaYXrdcFyWSo2Ub5XpLvK6VEnhxFO59r04=; b=X+RuFa/GpnTFqMPp5zKNmW2Wa3hqDudlfrmUQdkzDeUPhyjykjlexu3B9HUq2RMudWVyMwAezoK0z+3ze1dfndht0j4vFcunt3MpvpeM50ZwgnlWkDcVpgCX+SjlPZvCk9xzbFOHmAnSvCxxJX4PpTfFHGmz2Z/GVogsYQ4Gd6w= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1567628854555574.209422268336; Wed, 4 Sep 2019 13:27:34 -0700 (PDT) Received: from localhost ([::1]:38750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5bsK-0004Sa-RQ for importer@patchew.org; Wed, 04 Sep 2019 16:27:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41414) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5b11-0005b8-76 for qemu-devel@nongnu.org; Wed, 04 Sep 2019 15:32:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i5b0y-0003I3-QU for qemu-devel@nongnu.org; Wed, 04 Sep 2019 15:32:26 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:45745) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i5b0x-0003Fv-9E for qemu-devel@nongnu.org; Wed, 04 Sep 2019 15:32:23 -0400 Received: by mail-pf1-x444.google.com with SMTP id y72so6330451pfb.12 for ; Wed, 04 Sep 2019 12:32:23 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2019 12:32:21 -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 :mime-version:content-transfer-encoding; bh=yenO3oE4SSaYXrdcFyWSo2Ub5XpLvK6VEnhxFO59r04=; b=sOneeAFEQVgGvPkBjDxeEb9He06PDg8B6Brizk84ZzVO6ZbgHla3sOdmDQogtjU+RS WW4o3b8dxgQJgPDz2njww3KR4wu6QIggogNmy9l2HKzhlB7YuuGnPQMfmU80B6j22bac 583kRFfrjlFxUFdP93Yg4jhtZykMsklJaMzuAwiQvNcxHvxFJMoACjx7zeymYzhRhDpF 3uLAOjqZdX6EVQk07cLkyPU0E1HoAAQgkfWp9GK1aeb9Z4zlY5KPjz+9Ig0poAa2Ezja KGuLx7pR19bawgYULliWQ4tzF88EcC5mbApH5wyMl/GtYVsmDFE7vsSWD4f/Xrql+uQn REzQ== 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:mime-version:content-transfer-encoding; bh=yenO3oE4SSaYXrdcFyWSo2Ub5XpLvK6VEnhxFO59r04=; b=aZOi/PeAUqgSvxIPpZvpdAhabIraELcSvQ8QsUhMpKs/MCtMqgT++Ebc+2iW+UW1FC RdTyuuJOKMszK3Sf+zON0R4MABjPGeL+mNQx1UuwV5E0adi7Faqwit/3U1JWM3w3eCYu m9o+7sCy7WoCf+AUk+izqUji8x0nL1GHPUH5XoGAep9vB7JIdZfcyT3wejEljo26EHtq HJGzo5VejIqM7NFqtvl3+SFxcSe+6VIl6NjucnaUeQS8IMHTbsACaV9l/hFOd/7Kwfe0 75UmcqxKA6EzTBs21N2fh0y5YjoD3QGby+YXy2jvW01SdEteeIivePNmoqy5ApsanNfe JCfA== X-Gm-Message-State: APjAAAWnezHPN5zRRJSanqYqrt/uSsoDUML49UfCYwY6VvUEeC1WNA/6 GN+gLGYCq4yyD9tfGGqTvVCi0RuNLJ4= X-Google-Smtp-Source: APXvYqy/lnsRo6rRGCMuBxGCFb2hO+CMHjGL75nIEtNPXflVjlmCajwrtMVeqc7qabc+chSE1+wo3w== X-Received: by 2002:aa7:9117:: with SMTP id 23mr24820154pfh.94.1567625541967; Wed, 04 Sep 2019 12:32:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 4 Sep 2019 12:30:54 -0700 Message-Id: <20190904193059.26202-65-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> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 v4 64/69] target/arm: Convert T16, shift 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate.c | 26 ++------------------------ target/arm/t16.decode | 8 ++++++++ 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index 48ed6f6b5d..d409afd55f 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -10754,7 +10754,7 @@ static void disas_thumb2_insn(DisasContext *s, uint= 32_t insn) =20 static void disas_thumb_insn(DisasContext *s, uint32_t insn) { - uint32_t val, op, rm, rd, shift; + uint32_t val, rd; int32_t offset; TCGv_i32 tmp; TCGv_i32 tmp2; @@ -10766,29 +10766,7 @@ static void disas_thumb_insn(DisasContext *s, uint= 32_t insn) /* fall back to legacy decoder */ =20 switch (insn >> 12) { - case 0: case 1: - - rd =3D insn & 7; - op =3D (insn >> 11) & 3; - if (op =3D=3D 3) { - /* - * 0b0001_1xxx_xxxx_xxxx - * - Add, subtract (three low registers) - * - Add, subtract (two low registers and immediate) - * In decodetree. - */ - goto illegal_op; - } else { - /* shift immediate */ - rm =3D (insn >> 3) & 7; - shift =3D (insn >> 6) & 0x1f; - tmp =3D load_reg(s, rm); - gen_arm_shift_im(tmp, op, shift, s->condexec_mask =3D=3D 0); - if (!s->condexec_mask) - gen_logic_CC(tmp); - store_reg(s, rd, tmp); - } - break; + 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: diff --git a/target/arm/t16.decode b/target/arm/t16.decode index f128110dee..79a1d66d6c 100644 --- a/target/arm/t16.decode +++ b/target/arm/t16.decode @@ -126,6 +126,14 @@ ADD_rri 10101 rd:3 ........ \ STM 11000 ... ........ @ldstm LDM_t16 11001 ... ........ @ldstm =20 +# Shift (immediate) + +@shift_i ..... shim:5 rm:3 rd:3 &s_rrr_shi %s rn=3D%reg_0 + +MOV_rxri 000 00 ..... ... ... @shift_i shty=3D0 # LSL +MOV_rxri 000 01 ..... ... ... @shift_i shty=3D1 # LSR +MOV_rxri 000 10 ..... ... ... @shift_i shty=3D2 # ASR + # Add/subtract (three low registers) =20 @addsub_3 ....... rm:3 rn:3 rd:3 \ --=20 2.17.1