/*
- * Project: libFIRM
- * File name: ir/tv/tv.c
- * Purpose: Representation of and static computations on target machine
- * values.
- * Author: Mathias Heil
- * Modified by:
- * Created:
- * CVS-ID: $Id$
- * Copyright: (c) 2003-2007 Universität Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
+ * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
+ *
+ * This file is part of libFirm.
+ *
+ * This file may be distributed and/or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.GPL included in the
+ * packaging of this file.
+ *
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
+ *
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
*/
-/*
- * Values are stored in a format depending upon chosen arithmetic
- * module. Default uses strcalc and fltcalc.
+/**
+ * @file
+ * @brief Representation of and static computations on target machine
+ * values.
+ * @date 2003
+ * @author Mathias Heil
+ * @version $Id$
+ * @summary
*
+ * Values are stored in a format depending upon chosen arithmetic
+ * module. Default uses strcalc and fltcalc.
+ * This implementation assumes:
+ * - target has IEEE-754 floating-point arithmetic.
*/
-
-/* This implementation assumes:
- * - target has IEEE-754 floating-point arithmetic. */
-
-
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-
#include <assert.h> /* assertions */
#include <stdlib.h> /* atoi() */
#ifdef HAVE_STRING_H
case irms_character:
buffer = alloca(sc_get_buffer_length());
memcpy(buffer, src->value, sc_get_buffer_length());
- sign_extend(buffer, src->mode);
+ sign_extend(buffer, m);
return get_tarval_overflow(buffer, src->length, m);
case irms_internal_boolean:
break;
case irms_reference:
+ switch(get_mode_sort(m)) {
+ case irms_int_number:
+ buffer = alloca(sc_get_buffer_length());
+ memcpy(buffer, src->value, sc_get_buffer_length());
+ sign_extend(buffer, src->mode);
+ return get_tarval_overflow(buffer, src->length, m);
+ default:
+ break;
+ }
+
break;
}