From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5295 invoked by alias); 31 Jan 2002 12:28:29 -0000 Mailing-List: contact sid-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: sid-owner@sources.redhat.com Received: (qmail 5225 invoked from network); 31 Jan 2002 12:28:26 -0000 Received: from unknown (HELO hypatia.brisbane.redhat.com) (202.83.74.3) by sources.redhat.com with SMTP; 31 Jan 2002 12:28:26 -0000 Received: from scooby.brisbane.redhat.com (scooby.brisbane.redhat.com [172.16.5.228]) by hypatia.brisbane.redhat.com (8.11.6/8.11.6) with ESMTP id g0VCSOY21584; Thu, 31 Jan 2002 22:28:24 +1000 Received: by scooby.brisbane.redhat.com (Postfix, from userid 500) id D862810892; Thu, 31 Jan 2002 23:28:23 +1100 (EST) From: Ben Elliston MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15449.14439.853756.277945@scooby.brisbane.redhat.com> Date: Thu, 31 Jan 2002 04:28:00 -0000 To: sid@sources.redhat.com Cc: cgen@sources.redhat.com Subject: [RFA] New SUBWORD* functions for SID CPUs X-Mailer: VM 6.75 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-SW-Source: 2002-q1/txt/msg00016.txt.bz2 The following patch adds a number of new mode conversion functions for SID CPU components. Some, such as SUBWORDSISF, simply perform coercion between modes. Okay to commit? Ben 2002-01-31 Ben Elliston * cgen-ops.h (SUBWORDSIQI): New. (SUBWORDSIHI): Ditto. (SUBWORDSFSI): Ditto. (SUBWORDSISF): Ditto. (SUBWORDDIDF): Ditto. (SUBWORDDFSI): Ditto. (SUBWORDSIUQI): Ditto. Index: cgen-ops.h =================================================================== RCS file: /cvs/cvsfiles/devo/sid/component/cgen-cpu/cgen-ops.h,v retrieving revision 1.21 diff -u -c -r1.21 cgen-ops.h *** cgen-ops.h 2001/12/18 23:07:59 1.21 --- cgen-ops.h 2002/01/31 12:22:10 *************** *** 1,6 **** // cgen-ops.h - CGEN semantic ops. -*- C++ -*- ! // Copyright (C) 1999, 2000 Red Hat. // This file is part of SID and is licensed under the GPL. // See the file COPYING.SID for conditions for redistribution. --- 1,6 ---- // cgen-ops.h - CGEN semantic ops. -*- C++ -*- ! // Copyright (C) 1999, 2000, 2002 Red Hat. // This file is part of SID and is licensed under the GPL. // See the file COPYING.SID for conditions for redistribution. *************** *** 503,508 **** --- 503,559 ---- return res; } + inline QI + SUBWORDSIQI (SI in, int byte) + { + assert (byte >= 0 && byte <= 3); + return static_cast ((in >> (8 * (3 - byte))) & 0xFF); + } + + + inline HI + SUBWORDSIHI (SI in, int word) + { + if (word == 0) + return static_cast (in >> 16); + else + return in; + } + + inline SI + SUBWORDSFSI (SF in) + { + SI out = in; + return out; + } + + inline SF + SUBWORDSISF (SI in) + { + SF out = in; + return out; + } + + inline DF + SUBWORDDIDF (DI in) + { + DF out = in; + return out; + } + + inline SI + SUBWORDDFSI (DF in, int word) + { + DI di = in; + return SUBWORDDISI(di, word); + } + + inline UQI + SUBWORDSIUQI (SI in, int byte) + { + assert (byte >= 0 && byte <= 7); + return static_cast ((in >> (8 * (3 - byte))) & 0xFF); + } } // namespace cgen