remove #ifdef HAVE_CONFIG_Hs
[libfirm] / ir / be / ia32 / ia32_intrinsics.c
index fa07a9f..026cd38 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -24,9 +24,7 @@
  * @author      Michael Beck
  * @version     $Id$
  */
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include "irgmod.h"
 #include "irop.h"
@@ -44,8 +42,8 @@
 /** The array of all intrinsics that must be mapped. */
 static i_record *intrinsics;
 
-/** An array to cache all entities */
-static ir_entity *i_ents[iro_MaxOpcode];
+/** An array to cache all entities. */
+static ir_entity *i_ents[iro_Last + 1];
 
 /*
  * Maps all intrinsic calls that the backend support
@@ -237,13 +235,13 @@ static int map_Shl(ir_node *call, void *ctx) {
        in[0] = l1;
        in[1] = l2;
        l_res = new_r_Phi(irg, block, 2, in, l_mode);
-       set_irn_link(block, l_res);
+       set_Block_phis(block, l_res);
 
        in[0] = h1;
        in[1] = h2;
        h_res = new_r_Phi(irg, block, 2, in, h_mode);
-       set_irn_link(l_res, h_res);
-       set_irn_link(h_res, NULL);
+       set_Phi_next(l_res, h_res);
+       set_Phi_next(h_res, NULL);
 
        /* move it down */
        set_nodes_block(call, block);
@@ -315,7 +313,7 @@ static int map_Shr(ir_node *call, void *ctx) {
        /* the block for cnt >= 32 */
        n_block = new_rd_Block(dbg, irg, 1, &in[1]);
        l2      = new_rd_Conv(dbg, irg, n_block, h1, l_mode);
-       h2      = new_r_Const(irg, n_block, l_mode, get_mode_null(h_mode));
+       h2      = new_r_Const(irg, n_block, h_mode, get_mode_null(h_mode));
        in[1]   = new_r_Jmp(irg, n_block);
 
        set_irn_in(block, 2, in);
@@ -323,13 +321,13 @@ static int map_Shr(ir_node *call, void *ctx) {
        in[0] = l1;
        in[1] = l2;
        l_res = new_r_Phi(irg, block, 2, in, l_mode);
-       set_irn_link(block, l_res);
+       set_Block_phis(block, l_res);
 
        in[0] = h1;
        in[1] = h2;
        h_res = new_r_Phi(irg, block, 2, in, h_mode);
-       set_irn_link(l_res, h_res);
-       set_irn_link(h_res, NULL);
+       set_Phi_next(l_res, h_res);
+       set_Phi_next(h_res, NULL);
 
        /* move it down */
        set_nodes_block(call, block);
@@ -411,13 +409,13 @@ static int map_Shrs(ir_node *call, void *ctx) {
        in[0] = l1;
        in[1] = l2;
        l_res = new_r_Phi(irg, block, 2, in, l_mode);
-       set_irn_link(block, l_res);
+       set_Block_phis(block, l_res);
 
        in[0] = h1;
        in[1] = h2;
        h_res = new_r_Phi(irg, block, 2, in, h_mode);
-       set_irn_link(l_res, h_res);
-       set_irn_link(h_res, NULL);
+       set_Phi_next(l_res, h_res);
+       set_Phi_next(h_res, NULL);
 
        /* move it down */
        set_nodes_block(call, block);
@@ -668,18 +666,14 @@ static int map_Mod(ir_node *call, void *ctx) {
  * Maps a Conv.
  */
 static int map_Conv(ir_node *call, void *ctx) {
-       ia32_intrinsic_env_t *env = ctx;
-       ir_graph  *irg        = current_ir_graph;
-       dbg_info  *dbg        = get_irn_dbg_info(call);
-       ir_node   *block      = get_nodes_block(call);
-       ir_node   **params    = get_Call_param_arr(call);
-       ir_type   *method     = get_Call_type(call);
-       int       n           = get_Call_n_params(call);
-       int       gp_bytes    = get_mode_size_bytes(ia32_reg_classes[CLASS_ia32_gp].mode);
-       ir_entity *ent;
-       ir_node   *l_res, *h_res, *frame, *fres;
-       ir_node   *store_l, *store_h;
-       ir_node   *op_mem[2], *mem;
+       ir_graph  *irg     = current_ir_graph;
+       dbg_info  *dbg     = get_irn_dbg_info(call);
+       ir_node   *block   = get_nodes_block(call);
+       ir_node   **params = get_Call_param_arr(call);
+       ir_type   *method  = get_Call_type(call);
+       int       n        = get_Call_n_params(call);
+       ir_node   *l_res, *h_res;
+       (void) ctx;
 
        if (n == 1) {
                ir_node *float_to_ll;