From patchwork Thu May 17 05:37:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peter A. G. Crosthwaite" X-Patchwork-Id: 159812 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BEB4BB6FC5 for ; Thu, 17 May 2012 15:28:36 +1000 (EST) Received: from localhost ([::1]:59559 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUtGM-0008DH-G1 for incoming@patchwork.ozlabs.org; Thu, 17 May 2012 01:28:34 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55395) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUtG9-00086F-5V for qemu-devel@nongnu.org; Thu, 17 May 2012 01:28:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SUtG6-0007rX-Lt for qemu-devel@nongnu.org; Thu, 17 May 2012 01:28:20 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:46746) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUtG6-0007r2-G6 for qemu-devel@nongnu.org; Thu, 17 May 2012 01:28:18 -0400 Received: by pbbro12 with SMTP id ro12so2627576pbb.4 for ; Wed, 16 May 2012 22:28:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references:x-gm-message-state; bh=WbGKiqlUYizReU6bntyeGAoeIySXJPW1LGspoH5WJ34=; b=iumnV9LQLxT/crmjk39C0IqcV3v75Wl9QBL/HzSP7t1w84REQUwChtArUUyRSTHQYd sxb5LKGRKrYpALX4hZWIJhURvxgMH0o+/t01VT609b9ZyLXOhF29nX6pGfSz4WDfBO4b +Fu56LiRSLXxkuMQMKyEEN4mF+PR2CV6DgerJ5wfSs3FLkmbwo+KoUgyMqrsfBUx6OFs zG0QX9dcxOl65RzePwSRCKseoVryV4dyYJa1X6fG9PGymCyv5jxTnaNJ30fCftg9LIxk m58T/+try0Ho67FaLVNylRg/V3vdcZO2Qqa9mFz4U6cd7+ieJcVr5I4bBsyc9TPjVMLU w+Kw== Received: by 10.68.234.35 with SMTP id ub3mr23932570pbc.8.1337232496257; Wed, 16 May 2012 22:28:16 -0700 (PDT) Received: from localhost ([124.148.20.9]) by mx.google.com with ESMTPS id rs3sm7902207pbc.47.2012.05.16.22.28.12 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 May 2012 22:28:15 -0700 (PDT) From: "Peter A. G. Crosthwaite" To: qemu-devel@nongnu.org, edgar.iglesias@gmail.com Date: Thu, 17 May 2012 15:37:49 +1000 Message-Id: X-Mailer: git-send-email 1.7.3.2 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQkiS0WdQLkIluiOnoFSrru7AQWbJl8eVYonCpcDlejFkkSToEzJBqChcP+gNI8aqdZ2zQAP X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.45 Cc: peter.crosthwaite@petalogix.com, david.holsgrove@petalogix.com, john.williams@petalogix.com Subject: [Qemu-devel] [RFC PATCH V1 1/2] target-microblaze: impelemented swapx instructions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Implemented the swapb and swaph byte/halfword reversal instructions added to microblaze v8.30 Signed-off-by: Peter A. G. Crosthwaite --- target-microblaze/translate.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c index 742b395..a362938 100644 --- a/target-microblaze/translate.c +++ b/target-microblaze/translate.c @@ -743,7 +743,7 @@ static void dec_bit(DisasContext *dc) unsigned int op; int mem_index = cpu_mmu_index(dc->env); - op = dc->ir & ((1 << 8) - 1); + op = dc->ir & ((1 << 9) - 1); switch (op) { case 0x21: /* src. */ @@ -825,6 +825,16 @@ static void dec_bit(DisasContext *dc) gen_helper_clz(cpu_R[dc->rd], cpu_R[dc->ra]); } break; + case 0x1e0: + /* swapb */ + LOG_DIS("swapb r%d r%d\n", dc->rd, dc->ra); + tcg_gen_bswap32_i32(cpu_R[dc->rd], cpu_R[dc->ra]); + break; + case 0x1e1: + /*swaph */ + LOG_DIS("swaph r%d r%d\n", dc->rd, dc->ra); + tcg_gen_rotri_i32(cpu_R[dc->rd], cpu_R[dc->ra], 16); + break; default: cpu_abort(dc->env, "unknown bit oc=%x op=%x rd=%d ra=%d rb=%d\n", dc->pc, op, dc->rd, dc->ra, dc->rb);