From patchwork Wed Sep 4 19:30: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: 173002 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp385841ilq; Wed, 4 Sep 2019 13:09:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRqKDFrtef9cY9h1dtsbw/vgk4rvmsF0J5W2uJ7ddkAmY6dHLe2fRLWdy2CKb2OW6/YYc0 X-Received: by 2002:ae9:ef4c:: with SMTP id d73mr3266256qkg.57.1567627773108; Wed, 04 Sep 2019 13:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567627773; cv=none; d=google.com; s=arc-20160816; b=njzj0/iv2mNpCPKGuakMD7/bxzYttq79PswEUwfTOn4tz+KtgDAUgMExHh6+Chu/Fa vw7zHCtvr8LXdGu8eQ8w7xYpUUkLyJoW5FdCN5lWGKLotV2u/iQ0+xF99FR07oNDdnbs VDA4MLtK/KLaZxyw4f1vfjiSj49rpXYsmXCDVXmUfGty0ombvWf9j7FsyEY5vAEIuFtx LlxNp6wpFXFeEq+WjhyGtY+f/IQbIwLCl0wvScM6p1b48rD3dqWvIzify5qzNd8oGuiM nsgytA1MpupmN/DkcTi7YlbSAx7zPWKjEISAnF5Xz0v7+//T27leJy4KQfTsG+kgR3FC XvLA== 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=hGHY6IsJM30Hyd1TOf3r4ZHdVokWmEQOpc5BWJnbF8A=; b=VNdAXupDljOcndzX7WvpmWRisJIvkGg4rWTblsUNlFMSZiL6prwRu5vAkV5qefqwDq FxR4i2L7nY15c/2KWARYCmivlsyfqICx5KUkuTWsn1NRwcgRLQEaTTeT/9XzIsXf4hri FBAYr5dyvCi4F6TkuwikELNn6NvmJNSo99dDMZgNTU8NEfRTCpDE9DPLUWdRmdoz8jqB gqQh4bFZ8aia9LrWdxrb1qwJ21LAB+VNDo3zZVPGLVvmLaN40How9AEc5fU4nnSWiozf vnB37lTthgCcA/3D7/b27SEyVIDxUEMaCS1sMqCQt0pkT8maKq42ZQI3vNnv/s5Yo3Nm 5Buw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=onMzxY+o; 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 d22si9420209qtg.205.2019.09.04.13.09.33 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Sep 2019 13:09:33 -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=onMzxY+o; 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]:38462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5bau-0003eB-3o for patch@linaro.org; Wed, 04 Sep 2019 16:09:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41173) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5b0t-0005V7-Lo for qemu-devel@nongnu.org; Wed, 04 Sep 2019 15:32:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i5b0r-000391-NG for qemu-devel@nongnu.org; Wed, 04 Sep 2019 15:32:19 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]:45024) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i5b0r-00036P-8U for qemu-devel@nongnu.org; Wed, 04 Sep 2019 15:32:17 -0400 Received: by mail-pl1-x62d.google.com with SMTP id k1so2686615pls.11 for ; Wed, 04 Sep 2019 12:32:15 -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=hGHY6IsJM30Hyd1TOf3r4ZHdVokWmEQOpc5BWJnbF8A=; b=onMzxY+oCQs5KCsSNrpCHR3g/bkRgznJcy/vV5Ikpusi3H8nSvyIOEuaPgZB+H9FJt 3fJf0F0AZ5LaGak8Zz8vSr8Dk13gdbfmxHieg6uniOhd0lv+BEYOlY3q6iMuvIk55bQL x1/NiYKuLpjKGecOupyBQRszNmBSwQ7xzlgKX+mnl7QWS2RZULZvNv+PufMWmINKcpDi wBup9iuMD71jfgVtP/kgaE6I6Vg7E23LAxbtq5I72JTrVCDDD6mdD/AkWLU4tLkAfvPY NnmgYc50p06ILrQis06aAcXdofo1IbqHyx5Pw6FOqIXswEYZnzw+u9q3QATm8eqlhcQ5 8oUA== 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=hGHY6IsJM30Hyd1TOf3r4ZHdVokWmEQOpc5BWJnbF8A=; b=Ca4NovejqF8kJ6J7pPzCNwlnhvCpw9UkYqGsP0thVhjpFRkaTipnMHQHjHK0j/agMI A0hHfMxRwvsWUlZNjckd+iwFwayNPY/1/SCK/bR5BXLl0xYkV30J4JEpRk3/LR+mkU/u KmNcfewkQJpSnteDMj+PsoSrRBEjkfIrWsA6HGcBs0u8My3l/a/o2VWgCJx3BGU6C04V cHzOHTmZLhfVNN4YNHKvQ3uZ8Zl0Z35MSBaFiWJ80F5rukVo8MXD6Ulx7DTyqSqQ/y2d 2b72PAG/Zzh2bWMxwGJ5WIEKoMJcvwi7zaetTjDYOyfxhcjm/yvqMIejQ43O0Ut7Jt0P Z9ow== X-Gm-Message-State: APjAAAUhteSYiQSTTj0NA7bAygiAaerwru8qITCe8nHnb8wO1VXNOE7d tAxyItNjliZ7xL8G/F2TbScEnbE9jbs= X-Received: by 2002:a17:902:33a5:: with SMTP id b34mr41846656plc.286.1567625534794; Wed, 04 Sep 2019 12:32:14 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2019 12:32:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 4 Sep 2019 12:30:48 -0700 Message-Id: <20190904193059.26202-59-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 58/69] target/arm: Convert T16, Reverse bytes 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 | 18 +++--------------- target/arm/t16.decode | 9 +++++++++ 2 files changed, 12 insertions(+), 15 deletions(-) -- 2.17.1 diff --git a/target/arm/translate.c b/target/arm/translate.c index ce394ddb00..b70491d39e 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -10730,7 +10730,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, rn, rd, shift, cond; + uint32_t val, op, rm, rd, shift, cond; int32_t offset; int i; TCGv_i32 tmp; @@ -10927,20 +10927,8 @@ static void disas_thumb_insn(DisasContext *s, uint32_t insn) break; } - /* Otherwise this is rev */ - ARCH(6); - rn = (insn >> 3) & 0x7; - rd = insn & 0x7; - tmp = load_reg(s, rn); - switch (op1) { - case 0: tcg_gen_bswap32_i32(tmp, tmp); break; - case 1: gen_rev16(tmp, tmp); break; - case 3: gen_revsh(tmp, tmp); break; - default: - g_assert_not_reached(); - } - store_reg(s, rd, tmp); - break; + /* Otherwise this is rev, in decodetree */ + goto illegal_op; } case 6: /* setend, cps; in decodetree */ diff --git a/target/arm/t16.decode b/target/arm/t16.decode index 032902a1f4..19a442b894 100644 --- a/target/arm/t16.decode +++ b/target/arm/t16.decode @@ -24,6 +24,7 @@ &s_rri_rot !extern s rn rd imm rot &s_rrrr !extern s rd rn rm ra &rrr_rot !extern rd rn rm rot +&rr !extern rd rm &ri !extern rd imm &r !extern rm &ldst_rr !extern p w u rn rt rm shimm shtype @@ -195,3 +196,11 @@ SETEND 1011 0110 010 1 E:1 000 &setend CPS 1011 0110 011 . 0 A:1 I:1 F:1 &cps mode=0 M=0 %imod CPS_v7m 1011 0110 011 im:1 00 I:1 F:1 } + +# Reverse bytes + +@rdm .... .... .. rm:3 rd:3 &rr + +REV 1011 1010 00 ... ... @rdm +REV16 1011 1010 01 ... ... @rdm +REVSH 1011 1010 11 ... ... @rdm