return NULL;
}
-/**
- * Translate the stx names into %st(x).
- */
-static char *get_x87_reg_name(const arch_register_t *reg, char *buf) {
- const char *name = arch_register_get_name(reg);
-
- buf[0] = '%';
- buf[1] = 's';
- buf[2] = 't';
-
- if (name[2] == '0')
- buf[3] = '\0';
- else {
- buf[3] = '(';
- buf[4] = name[2];
- buf[5] = ')';
- buf[6] = '\0';
- }
-
- return buf;
-}
-
/**
* Emits registers and/or address mode of a binary operation.
*/
const arch_register_t *in2 = attr->x87[1];
const arch_register_t *out = attr->x87[2];
const arch_register_t *in;
- char buf1[7], buf2[7];
in = out ? (REGS_ARE_EQUAL(out, in2) ? in1 : in2) : in2;
out = out ? out : in1;
lc_esnprintf(arg_env, cmd_buf, SNPRINTF_BUF_LEN, "ucomis%M %s", get_irn_n(irn, 2), ia32_emit_binop(irn, env));
}
else if (is_ia32_PsiCondSet(irn)) {
- /* omit compare because flags are already set by And/Or */
- snprintf(cmd_buf, SNPRINTF_BUF_LEN, " ");
+ lc_esnprintf(arg_env, cmd_buf, SNPRINTF_BUF_LEN, "cmp %1S, 0", irn);
}
else {
assert(0 && "unsupported Set");
assert(cls1 == cls2 && "Register class mismatch at Perm");
if (cls1 == &ia32_reg_classes[CLASS_ia32_gp]) {
+#if 0
if(emit_env->isa->opt_arch == arch_athlon) {
// xchg commands are Vector path on athlons and therefore stall the DirectPath pipeline
- // it is nearly always beneficial to use the 3 xor trick instead of an xchg
+ // it is often beneficial to use the 3 xor trick instead of an xchg
cmnt_buf[0] = 0;
lc_esnprintf(ia32_get_arg_env(), cmd_buf, SNPRINTF_BUF_LEN, "xor %1S, %2S", irn, irn);
IA32_DO_EMIT(irn);
IA32_DO_EMIT(irn);
lc_esnprintf(ia32_get_arg_env(), cmd_buf, SNPRINTF_BUF_LEN, "xor %1S, %2S", irn, irn);
} else {
+#endif
lc_esnprintf(ia32_get_arg_env(), cmd_buf, SNPRINTF_BUF_LEN, "xchg %1S, %2S", irn, irn);
+#if 0
}
+#endif
}
else if (cls1 == &ia32_reg_classes[CLASS_ia32_xmm]) {
lc_esnprintf(ia32_get_arg_env(), cmd_buf, SNPRINTF_BUF_LEN,