public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
* [patch][commit] Additional cgen ops
@ 2006-05-11 14:38 Dave Brolley
  0 siblings, 0 replies; only message in thread
From: Dave Brolley @ 2006-05-11 14:38 UTC (permalink / raw)
  To: sid

[-- Attachment #1: Type: text/plain, Size: 224 bytes --]

Hi,

I've committed the attached patch which implements the cgen ops 
SUBWORDDIHI, SUBWORDDIQI and SUBWORDDFDI. The patch also initializes the 
existing member cgen_bi_endian_cpu::branch_was_return in the constructor.

Dave

[-- Attachment #2: sid-ops.ChangeLog --]
[-- Type: text/plain, Size: 187 bytes --]

2006-05-11  Dave Brolley  <brolley@redhat.com>

	* cgen-ops.h (SUBWORDDIHI, SUBWORDDIQI, SUBWORDDFDI): New functions.
	* compCGEN.cxx (cgen_bi_endian_cpu): Initialize branch_was_return.


[-- Attachment #3: sid-ops.patch.txt --]
[-- Type: text/plain, Size: 2670 bytes --]

Index: sid/component/cgen-cpu/cgen-ops.h
===================================================================
RCS file: /cvs/src/src/sid/component/cgen-cpu/cgen-ops.h,v
retrieving revision 1.12
diff -c -p -r1.12 cgen-ops.h
*** sid/component/cgen-cpu/cgen-ops.h	16 Feb 2005 21:19:34 -0000	1.12
--- sid/component/cgen-cpu/cgen-ops.h	11 May 2006 14:31:27 -0000
***************
*** 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.
  
--- 1,6 ----
  // cgen-ops.h - CGEN semantic ops.  -*- C++ -*-
  
! // Copyright (C) 1999, 2000, 2002, 2006 Red Hat.
  // This file is part of SID and is licensed under the GPL.
  // See the file COPYING.SID for conditions for redistribution.
  
*************** SUBWORDDIDF (DI in)
*** 560,565 ****
--- 560,587 ----
    return *out;
  }
  
+ inline HI
+ SUBWORDDIHI (DI in, int word)
+ {
+   assert (word >= 0 && word <= 3);
+   return (UHI) (in >> (16 * (3 - word))) & 0xFFFF;
+ }
+ 
+ inline QI
+ SUBWORDDIQI (DI in, int byte)
+ {
+   assert (byte >= 0 && byte <= 7);
+   return (UQI) (in >> (8 * (7 - byte))) & 0xFF;
+ }
+ 
+ inline DI
+ SUBWORDDFDI (DF in)
+ {
+   union { DF in; DI out; } x;
+   x.in = in;
+   return x.out;
+ }
+ 
  inline SI
  SUBWORDDFSI (DF in, int word)
  {
Index: sid/component/cgen-cpu/compCGEN.cxx
===================================================================
RCS file: /cvs/src/src/sid/component/cgen-cpu/compCGEN.cxx,v
retrieving revision 1.17
diff -c -p -r1.17 compCGEN.cxx
*** sid/component/cgen-cpu/compCGEN.cxx	1 Mar 2006 21:07:00 -0000	1.17
--- sid/component/cgen-cpu/compCGEN.cxx	11 May 2006 14:31:27 -0000
***************
*** 1,6 ****
  // compCGEN.cxx - CPU components.  -*- C++ -*-
  
! // Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 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 ----
  // compCGEN.cxx - CPU components.  -*- C++ -*-
  
! // Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2006 Red Hat.
  // This file is part of SID and is licensed under the GPL.
  // See the file COPYING.SID for conditions for redistribution.
  
*************** using namespace cgen;
*** 42,47 ****
--- 42,48 ----
  // ----------------------------------------------------------------------------
  cgen_bi_endian_cpu::cgen_bi_endian_cpu ()
  {
+   branch_was_return = false;
    warnings_enabled = false;
    add_attribute ("enable-warnings?", & warnings_enabled, "setting");
    this->engine_type = ENGINE_UNKNOWN;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-05-11 14:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-11 14:38 [patch][commit] Additional cgen ops Dave Brolley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).