From 353cf03a157348e3e80b3edca6a766f8729ac05f Mon Sep 17 00:00:00 2001 From: brolley Date: Thu, 11 May 2006 14:33:40 +0000 Subject: [PATCH] 2006-05-11 Dave Brolley * cgen-ops.h (SUBWORDDIHI, SUBWORDDIQI, SUBWORDDFDI): New functions. * compCGEN.cxx (cgen_bi_endian_cpu): Initialize branch_was_return. --- sid/component/cgen-cpu/ChangeLog | 5 +++++ sid/component/cgen-cpu/cgen-ops.h | 24 +++++++++++++++++++++++- sid/component/cgen-cpu/compCGEN.cxx | 3 ++- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/sid/component/cgen-cpu/ChangeLog b/sid/component/cgen-cpu/ChangeLog index b416367d52..3006570837 100644 --- a/sid/component/cgen-cpu/ChangeLog +++ b/sid/component/cgen-cpu/ChangeLog @@ -1,3 +1,8 @@ +2006-05-11 Dave Brolley + + * cgen-ops.h (SUBWORDDIHI, SUBWORDDIQI, SUBWORDDFDI): New functions. + * compCGEN.cxx (cgen_bi_endian_cpu): Initialize branch_was_return. + 2006-05-10 Dave Brolley * fp.cxx (fp::integer (long long&, round_mode_t)): New method. diff --git a/sid/component/cgen-cpu/cgen-ops.h b/sid/component/cgen-cpu/cgen-ops.h index b7831fdd7c..7dcf524f83 100644 --- a/sid/component/cgen-cpu/cgen-ops.h +++ b/sid/component/cgen-cpu/cgen-ops.h @@ -1,6 +1,6 @@ // cgen-ops.h - CGEN semantic ops. -*- C++ -*- -// Copyright (C) 1999, 2000, 2002 Red Hat. +// 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. @@ -560,6 +560,28 @@ SUBWORDDIDF (DI in) 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) { diff --git a/sid/component/cgen-cpu/compCGEN.cxx b/sid/component/cgen-cpu/compCGEN.cxx index 7e9cf5807a..3b388caccc 100644 --- a/sid/component/cgen-cpu/compCGEN.cxx +++ b/sid/component/cgen-cpu/compCGEN.cxx @@ -1,6 +1,6 @@ // compCGEN.cxx - CPU components. -*- C++ -*- -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Red Hat. +// 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. @@ -42,6 +42,7 @@ using namespace cgen; // ---------------------------------------------------------------------------- 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; -- 2.11.0