Loads do not remove any nodes from the exec after sets. Also fix a 'node leak'.
[libfirm] / ir / tv / tv.h
index 3d45b26..80525f2 100644 (file)
@@ -1,69 +1,57 @@
 /*
- * Project:     libFIRM
- * File name:   ir/tv/tv.h
- * Purpose:     Representation of and static computations on target machine
- *              values.
- * Author:      Mathias Heil
- * Modified by:
- * Created:
- * CVS-ID:      $Id$
- * Copyright:   (c) 2003 Universität Karlsruhe
- * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
- */
-
-/**
- * @file tv.h
+ * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
  *
- * Declarations for Target Values.
- */
-#ifndef _TV_H_
-#define _TV_H_
-
-#include "irmode.h"
-#include "irnode.h"
-
-/****h* libfirm/tv
+ * This file is part of libFirm.
  *
- * NAME
- *    tv -- TargetValue, short tarval.
- *   Internal representation for machine values.
+ * 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.
  *
- * AUTHORS
- *    Matthias Heil
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
  *
- * DESCRIPTION
- *    Tarvals represent target machine values.  They are typed by modes.
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ */
+
+/**
+ * @file
+ * @brief    Representation of and static computations on target machine
+ *           values.
+ * @date     2003
+ * @author   Mathias Heil
+ * @version  $Id$
+ * @summary
+ *   Tarvals represent target machine values.  They are typed by modes.
  *   Tarvals only represent values of mode_sort:
- *     int_number,
- *     float_number,
- *     boolean,
- *     reference,
- *     character
+ *    - int_number,
+ *    - float_number,
+ *    - boolean,
+ *    - reference,
+ *    - character
  *
  *   In case of references the module accepts an entity to represent the
  *   value.
- *    Furthermore, computations and conversions of these values can
+ *   Furthermore, computations and conversions of these values can
  *   be performed.
  *
- * USES
- *    This module is closely related to the irmode module, as the modes
- *   defined there are thoroughly used throughout the whole module.
- *    Also, the comparison functions rely on the definition of comparison
- *   values in the irnode module.
- *
  * HISTORY
  *    The original tv module originated in the fiasco compiler written ...
  *    This is the new version, described in the tech report 1999-14 by ...
  *
- * SEE ALSO
+ * @sa
  *    Techreport 1999-14
  *    irmode.h for the modes definitions
  *    irnode.h for the pn_Cmp table
- *
- *    tarval_init1 and tarval_init2 for initialization of the
- *   module
- *
- ******/
+ */
+#ifndef FIRM_TV_TV_H
+#define FIRM_TV_TV_H
+
+#include "firm_types.h"
+#include "irnode.h"
 
 #ifndef _TARVAL_TYPEDEF_
 #define _TARVAL_TYPEDEF_
@@ -288,11 +276,6 @@ extern tarval *tarval_b_true;
 /** Returns the mode_b tarval 'true'. */
 tarval *get_tarval_b_true(void);
 
-/** The 'void' pointer tarval. */
-extern tarval *tarval_P_void;
-/** Returns the 'void' pointer tarval. */
-tarval *get_tarval_P_void(void);
-
 /* These functions calculate and return a tarval representing the requested
  * value.
  * The functions get_mode_{Max,Min,...} return tarvals retrieved from these
@@ -305,7 +288,8 @@ tarval *get_tarval_max(ir_mode *mode);
 /** Returns the minimum value of a given mode. */
 tarval *get_tarval_min(ir_mode *mode);
 
-/** Returns the 0 value (additive neutral) of a given mode. */
+/** Returns the 0 value (additive neutral) of a given mode.
+    For reference modes, the NULL value is returned (old tarval_P_void) */
 tarval *get_tarval_null(ir_mode *mode);
 
 /** Returns the 1 value (multiplicative neutral) of a given mode. */
@@ -582,15 +566,23 @@ typedef enum _tarval_classification_t {
 
 /**
  * Identifying tarvals values for algebraic simplifications.
- * @param tv
+ *
+ * @param tv        the tarval
+ *
  * @return
- *   - TV_CLASSIFY_NULL    for additive neutral,
+ *   - TV_CLASSIFY_NULL    for additive neutral or the NULL tarval for reference modes,
  *   - TV_CLASSIFY_ONE     for multiplicative neutral,
  *   - TV_CLASSIFY_ALL_ONE for bitwise-and neutral
  *   - TV_CLASSIFY_OTHER   else
  */
 tarval_classification_t classify_tarval(tarval *tv);
 
+/**
+ * Returns non-zero if a given (integer) tarval has only one single bit
+ * set.
+ */
+int is_single_bit_tarval(tarval *tv);
+
 /**
  * Output of tarvals to a buffer.
  */
@@ -601,4 +593,4 @@ int tarval_snprintf(char *buf, size_t buflen, tarval *tv);
  */
 int tarval_printf(tarval *tv);
 
-#endif  /* _TV_H_ */
+#endif  /* FIRM_TV_TV_H */