From patchwork Tue Apr 24 18:03:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 8095 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A78D523E13 for ; Tue, 24 Apr 2012 18:03:12 +0000 (UTC) Received: from mail-gy0-f180.google.com (mail-gy0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 5E7C1A1807F for ; Tue, 24 Apr 2012 18:03:12 +0000 (UTC) Received: by ghbz12 with SMTP id z12so743273ghb.11 for ; Tue, 24 Apr 2012 11:03:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=y5XUq3GWTmq6oN7yu1hFdSkQIrx+EuZcBYCR6O9qZ9M=; b=oQmqHDr2v5/9ZDmc57zOXRbpNkdksSh3jr+fN8JCKQOdcUeAOeT8gX15UlM6UlTpYD TuI+7riWAJJRJM/HIDlo8gNWbWdP6UGUbli9za9rDTbP8o3SkT3PqsDLP7vsQx+8x+S8 oXlnIoQUS9PLAHeq2BpMI6ESEFqv4oux55IO0YzSH/+FSao5WUhtJWmOMJUJjlXHdh7m 8PSJ1fS/4wEjjT/GXDQAXiWks2tbdKYeYri/hblLCJvhVXnUa17LLrWnODYdmgrcva3n MkUrLzJvkH7jvKR8U3xDfw9nennFVVElE8CLZ7RPEL6o1JteBJEUZFQa+6KtXoUiW0V8 dbYA== Received: by 10.50.154.167 with SMTP id vp7mr11369660igb.55.1335290591678; Tue, 24 Apr 2012 11:03:11 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.137.198 with SMTP id x6csp200264ibt; Tue, 24 Apr 2012 11:03:11 -0700 (PDT) Received: by 10.216.135.223 with SMTP id u73mr12861413wei.117.1335290590458; Tue, 24 Apr 2012 11:03:10 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id e5si6915968wef.92.2012.04.24.11.03.09 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Apr 2012 11:03:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1SMk4q-0004h2-Hw; Tue, 24 Apr 2012 19:03:00 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: Paul Brook , patches@linaro.org, Rajat Goyal Subject: [PATCH] target-arm: Make SETEND respect bswap_code (BE8) setting Date: Tue, 24 Apr 2012 19:03:00 +0100 Message-Id: <1335290580-18015-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-Gm-Message-State: ALoCoQmW5MmwJRX3bCYZiHBNMft24F7BquiHYePgn0nwgZ0+H7q0C2nnHKtPa1ZHUc4jqipvBwH5 Make the SETEND instruction respect the setting of bswap_code, so that in BE8 mode we UNDEF for attempts to switch into little-endian mode and nop for attempts to stay in big-endian mode. (This is the inverse of the existing handling of SETEND in the more common little-endian setup, which we use since we don't implement the architecturally-mandated dynamic endianness switching.) Signed-off-by: Peter Maydell --- This tidies up a minor corner case following the introduction of BE8 support recently. target-arm/translate.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target-arm/translate.c b/target-arm/translate.c index 7a3c7d6..437d9db 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -6767,8 +6767,8 @@ static void disas_arm_insn(CPUARMState * env, DisasContext *s) if ((insn & 0x0ffffdff) == 0x01010000) { ARCH(6); /* setend */ - if (insn & (1 << 9)) { - /* BE8 mode not implemented. */ + if (((insn >> 9) & 1) != s->bswap_code) { + /* Dynamic endianness switching not implemented. */ goto illegal_op; } return; @@ -9710,8 +9710,8 @@ static void disas_thumb_insn(CPUARMState *env, DisasContext *s) case 2: /* setend */ ARCH(6); - if (insn & (1 << 3)) { - /* BE8 mode not implemented. */ + if (((insn >> 3) & 1) != s->bswap_code) { + /* Dynamic endianness switching not implemented. */ goto illegal_op; } break;