-I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/tr -I$(top_srcdir)/ir/tv \
-I$(top_srcdir)/ir/debug -I$(top_srcdir)/ir/ana -I$(top_srcdir)/ir/st \
-I$(top_srcdir)/ir/stat -I$(top_srcdir)/ir/external -I$(top_srcdir)/ir/ana2 -I$(top_srcdir)/ir/lower \
- -I$(topdir)/ir/config -I$(top_srcdir)/ir/arch -I$(top_srcdir)/ir/lower
+ -I$(topdir)/ir/config -I$(top_srcdir)/ir/arch -I$(top_srcdir)/ir/lower -I$(top_srcdir)/ir/opt
include $(top_srcdir)/MakeTargets
#include "archop.h"
#include "lower_dw.h"
#include "dbginfo.h"
+#include "ifconv.h"
#define LC_STOP_AND_RESET_TIMER(timer) do { lc_timer_stop(timer); lc_timer_reset(timer); } while(0)
/** the context parameter for the create intrinsic function */
void *create_intrinsic_ctx;
+ /** backend settings for if-conversion */
+ opt_if_conv_info_t *if_conv_info;
} backend_params;
/**
/**
* Create execution frequencies from profile data or estimate some
*/
- if(be_profile_has_data()) {
+ if (be_profile_has_data()) {
birg->execfreqs = be_create_execfreqs_from_profile(irg);
} else {
birg->execfreqs = compute_execfreq(irg, 10);
Since the code generator made a lot of new nodes and skipped
a lot of old ones, we should do dead node elimination here.
Note that this requires disabling the edges here.
- */
+ */
edges_deactivate(irg);
//dead_node_elimination(irg);
edges_activate(irg);
-I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/tr -I$(top_srcdir)/ir/tv \
-I$(top_srcdir)/ir/debug -I$(top_srcdir)/ir/ana -I$(top_srcdir)/ir/st \
-I$(top_srcdir)/ir/stat -I$(top_srcdir)/ir/external -I$(top_srcdir)/ir/ana2 \
- -I$(topdir)/ir/config -I$(top_srcdir)/ir/arch -I$(top_srcdir)/ir/lower
+ -I$(topdir)/ir/config -I$(top_srcdir)/ir/arch -I$(top_srcdir)/ir/lower -I$(top_srcdir)/ir/opt
include $(top_srcdir)/MakeTargets
-I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/tr -I$(top_srcdir)/ir/tv \
-I$(top_srcdir)/ir/debug -I$(top_srcdir)/ir/ana -I$(top_srcdir)/ir/st \
-I$(top_srcdir)/ir/stat -I$(top_srcdir)/ir/external -I$(top_srcdir)/ir/ana2 \
- -I$(topdir)/ir/config -I$(top_srcdir)/ir/arch -I$(top_srcdir)/ir/lower
+ -I$(topdir)/ir/config -I$(top_srcdir)/ir/arch -I$(top_srcdir)/ir/lower -I$(top_srcdir)/ir/opt
include $(top_srcdir)/MakeTargets
return bytes;
}
+/**
+ * Allows or disallows the creation of a Psi for the given Cond selector.
+ * @return 1 if allowed, 0 otherwise
+ */
+static int ia32_is_psi_allowed(ir_node *sel, ir_node *false_res, ir_node *true_res) {
+ ir_node *cmp, *cmp_a;
+ ir_mode *mode;
+
+ if (get_irn_mode(sel) != mode_b)
+ return 0;
+
+ cmp = get_Proj_pred(sel);
+ cmp_a = get_Cmp_left(cmp);
+ mode = get_irn_mode(cmp_a);
+
+ /* we don't want long long an floating point Psi */
+ return ! mode_is_float(mode) && get_mode_size_bits(mode) <= 32;
+}
+
static ia32_intrinsic_env_t intrinsic_env = {
NULL, /**< the irg, these entities belong to */
NULL, /**< entity for first div operand (move into FPU) */
* Returns the libFirm configuration parameter for this backend.
*/
static const backend_params *ia32_get_libfirm_params(void) {
+ static const opt_if_conv_info_t ifconv = {
+ 4, /* maxdepth, doesn't matter for Psi-conversion */
+ ia32_is_psi_allowed /* allows or disallows Psi creation for given selector */
+ };
static const arch_dep_params_t ad = {
- 1, /* also use subs */
- 4, /* maximum shifts */
+ 1, /* also use subs */
+ 4, /* maximum shifts */
31, /* maximum shift amount */
- 1, /* allow Mulhs */
- 1, /* allow Mulus */
+ 1, /* allow Mulhs */
+ 1, /* allow Mulus */
32 /* Mulh allowed up to 32 bit */
};
static backend_params p = {
1, /* need dword lowering */
ia32_create_intrinsic_fkt,
&intrinsic_env, /* context for ia32_create_intrinsic_fkt */
+ NULL, /* will be set later */
};
- p.dep_param = &ad;
+ p.dep_param = &ad;
+ p.if_conv_info = &ifconv;
return &p;
}
#ifdef WITH_LIBCORE
ir_node *irn = arg->v_ptr;
int nr = occ->width - 1;
ia32_attr_t *attr;
- char *n;
int res = 0;
if (! irn)
buf = attr->x87[nr]->name;
res += lc_appendable_chadd(app, '%');
-
- if (buf[2] == '0') {
- /* just omit 'st' (skip the 0) */
- res += lc_appendable_snadd(app, buf, strlen(buf) - 1);
- }
- else {
- res += lc_appendable_snadd(app, "st(", 3);
- res += lc_appendable_chadd(app, buf[2]);
- res += lc_appendable_chadd(app, ')');
- }
+ res += lc_appendable_snadd(app, buf, strlen(buf));
return res;
}
in = out ? (REGS_ARE_EQUAL(out, in2) ? in1 : in2) : in2;
out = out ? out : in1;
- snprintf(buf, SNPRINTF_BUF_LEN, "%s, %s", get_x87_reg_name(out, buf1), get_x87_reg_name(in, buf2));
+ snprintf(buf, SNPRINTF_BUF_LEN, "%%%s, %%%s",
+ arch_register_get_name(out), arch_register_get_name(in));
}
break;
case ia32_AddrModeS:
-I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/tr -I$(top_srcdir)/ir/tv \
-I$(top_srcdir)/ir/debug -I$(top_srcdir)/ir/ana -I$(top_srcdir)/ir/st \
-I$(top_srcdir)/ir/stat -I$(top_srcdir)/ir/external -I$(top_srcdir)/ir/ana2 -I$(top_srcdir)/ir/lower \
- -I$(topdir)/ir/config -I$(top_srcdir)/ir/arch -I$(top_srcdir)/ir/lower
+ -I$(topdir)/ir/config -I$(top_srcdir)/ir/arch -I$(top_srcdir)/ir/lower -I$(top_srcdir)/ir/opt
include $(top_srcdir)/MakeTargets
-I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/tr -I$(top_srcdir)/ir/tv \
-I$(top_srcdir)/ir/debug -I$(top_srcdir)/ir/ana -I$(top_srcdir)/ir/st \
-I$(top_srcdir)/ir/stat -I$(top_srcdir)/ir/external -I$(top_srcdir)/ir/ana2 \
- -I$(topdir)/ir/config -I$(top_srcdir)/ir/arch -I$(top_srcdir)/ir/lower
+ -I$(topdir)/ir/config -I$(top_srcdir)/ir/arch -I$(top_srcdir)/ir/lower -I$(top_srcdir)/ir/opt
include $(top_srcdir)/MakeTargets