提交 19f329ad 编写于 作者: B blueswir1

Convert branches and conditional moves to TCG


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4028 c046a42c-6fe2-441c-8c8c-71466251a162
上级 b3db8758
/* FCC1:FCC0: 0 =, 1 <, 2 >, 3 u */
void OPPROTO glue(op_eval_fbne, FCC)(void)
{
// !0
T2 = FFLAG_SET(FSR_FCC0) | FFLAG_SET(FSR_FCC1); /* L or G or U */
}
void OPPROTO glue(op_eval_fblg, FCC)(void)
{
// 1 or 2
T2 = FFLAG_SET(FSR_FCC0) ^ FFLAG_SET(FSR_FCC1);
}
void OPPROTO glue(op_eval_fbul, FCC)(void)
{
// 1 or 3
T2 = FFLAG_SET(FSR_FCC0);
}
void OPPROTO glue(op_eval_fbl, FCC)(void)
{
// 1
T2 = FFLAG_SET(FSR_FCC0) & !FFLAG_SET(FSR_FCC1);
}
void OPPROTO glue(op_eval_fbug, FCC)(void)
{
// 2 or 3
T2 = FFLAG_SET(FSR_FCC1);
}
void OPPROTO glue(op_eval_fbg, FCC)(void)
{
// 2
T2 = !FFLAG_SET(FSR_FCC0) & FFLAG_SET(FSR_FCC1);
}
void OPPROTO glue(op_eval_fbu, FCC)(void)
{
// 3
T2 = FFLAG_SET(FSR_FCC0) & FFLAG_SET(FSR_FCC1);
}
void OPPROTO glue(op_eval_fbe, FCC)(void)
{
// 0
T2 = !FFLAG_SET(FSR_FCC0) & !FFLAG_SET(FSR_FCC1);
}
void OPPROTO glue(op_eval_fbue, FCC)(void)
{
// 0 or 3
T2 = !(FFLAG_SET(FSR_FCC1) ^ FFLAG_SET(FSR_FCC0));
FORCE_RET();
}
void OPPROTO glue(op_eval_fbge, FCC)(void)
{
// 0 or 2
T2 = !FFLAG_SET(FSR_FCC0);
}
void OPPROTO glue(op_eval_fbuge, FCC)(void)
{
// !1
T2 = !(FFLAG_SET(FSR_FCC0) & !FFLAG_SET(FSR_FCC1));
}
void OPPROTO glue(op_eval_fble, FCC)(void)
{
// 0 or 1
T2 = !FFLAG_SET(FSR_FCC1);
}
void OPPROTO glue(op_eval_fbule, FCC)(void)
{
// !2
T2 = !(!FFLAG_SET(FSR_FCC0) & FFLAG_SET(FSR_FCC1));
}
void OPPROTO glue(op_eval_fbo, FCC)(void)
{
// !3
T2 = !(FFLAG_SET(FSR_FCC0) & FFLAG_SET(FSR_FCC1));
}
#undef FCC
#undef FFLAG_SET
......@@ -169,10 +169,6 @@
#include "fop_template.h"
#endif
#ifdef TARGET_SPARC64
#define XFLAG_SET(x) ((env->xcc&x)?1:0)
#endif
#define FLAG_SET(x) ((env->psr&x)?1:0)
void OPPROTO op_add_T1_T0_cc(void)
......@@ -857,249 +853,11 @@ void OPPROTO op_restore(void)
}
#endif
void OPPROTO op_eval_ba(void)
{
T2 = 1;
}
void OPPROTO op_eval_be(void)
{
T2 = FLAG_SET(PSR_ZERO);
}
void OPPROTO op_eval_ble(void)
{
target_ulong Z = FLAG_SET(PSR_ZERO), N = FLAG_SET(PSR_NEG), V = FLAG_SET(PSR_OVF);
T2 = Z | (N ^ V);
}
void OPPROTO op_eval_bl(void)
{
target_ulong N = FLAG_SET(PSR_NEG), V = FLAG_SET(PSR_OVF);
T2 = N ^ V;
}
void OPPROTO op_eval_bleu(void)
{
target_ulong Z = FLAG_SET(PSR_ZERO), C = FLAG_SET(PSR_CARRY);
T2 = C | Z;
}
void OPPROTO op_eval_bcs(void)
{
T2 = FLAG_SET(PSR_CARRY);
}
void OPPROTO op_eval_bvs(void)
{
T2 = FLAG_SET(PSR_OVF);
}
void OPPROTO op_eval_bn(void)
{
T2 = 0;
}
void OPPROTO op_eval_bneg(void)
{
T2 = FLAG_SET(PSR_NEG);
}
void OPPROTO op_eval_bne(void)
{
T2 = !FLAG_SET(PSR_ZERO);
}
void OPPROTO op_eval_bg(void)
{
target_ulong Z = FLAG_SET(PSR_ZERO), N = FLAG_SET(PSR_NEG), V = FLAG_SET(PSR_OVF);
T2 = !(Z | (N ^ V));
}
void OPPROTO op_eval_bge(void)
{
target_ulong N = FLAG_SET(PSR_NEG), V = FLAG_SET(PSR_OVF);
T2 = !(N ^ V);
}
void OPPROTO op_eval_bgu(void)
{
target_ulong Z = FLAG_SET(PSR_ZERO), C = FLAG_SET(PSR_CARRY);
T2 = !(C | Z);
}
void OPPROTO op_eval_bcc(void)
{
T2 = !FLAG_SET(PSR_CARRY);
}
void OPPROTO op_eval_bpos(void)
{
T2 = !FLAG_SET(PSR_NEG);
}
void OPPROTO op_eval_bvc(void)
{
T2 = !FLAG_SET(PSR_OVF);
}
#ifdef TARGET_SPARC64
void OPPROTO op_eval_xbe(void)
{
T2 = XFLAG_SET(PSR_ZERO);
}
void OPPROTO op_eval_xble(void)
{
target_ulong Z = XFLAG_SET(PSR_ZERO), N = XFLAG_SET(PSR_NEG), V = XFLAG_SET(PSR_OVF);
T2 = Z | (N ^ V);
}
void OPPROTO op_eval_xbl(void)
{
target_ulong N = XFLAG_SET(PSR_NEG), V = XFLAG_SET(PSR_OVF);
T2 = N ^ V;
}
void OPPROTO op_eval_xbleu(void)
{
target_ulong Z = XFLAG_SET(PSR_ZERO), C = XFLAG_SET(PSR_CARRY);
T2 = C | Z;
}
void OPPROTO op_eval_xbcs(void)
{
T2 = XFLAG_SET(PSR_CARRY);
}
void OPPROTO op_eval_xbvs(void)
{
T2 = XFLAG_SET(PSR_OVF);
}
void OPPROTO op_eval_xbneg(void)
{
T2 = XFLAG_SET(PSR_NEG);
}
void OPPROTO op_eval_xbne(void)
{
T2 = !XFLAG_SET(PSR_ZERO);
}
void OPPROTO op_eval_xbg(void)
{
target_ulong Z = XFLAG_SET(PSR_ZERO), N = XFLAG_SET(PSR_NEG), V = XFLAG_SET(PSR_OVF);
T2 = !(Z | (N ^ V));
}
void OPPROTO op_eval_xbge(void)
{
target_ulong N = XFLAG_SET(PSR_NEG), V = XFLAG_SET(PSR_OVF);
T2 = !(N ^ V);
}
void OPPROTO op_eval_xbgu(void)
{
target_ulong Z = XFLAG_SET(PSR_ZERO), C = XFLAG_SET(PSR_CARRY);
T2 = !(C | Z);
}
void OPPROTO op_eval_xbcc(void)
{
T2 = !XFLAG_SET(PSR_CARRY);
}
void OPPROTO op_eval_xbpos(void)
{
T2 = !XFLAG_SET(PSR_NEG);
}
void OPPROTO op_eval_xbvc(void)
{
T2 = !XFLAG_SET(PSR_OVF);
}
#endif
#define FCC
#define FFLAG_SET(x) (env->fsr & x? 1: 0)
#include "fbranch_template.h"
#ifdef TARGET_SPARC64
#define FCC _fcc1
#define FFLAG_SET(x) ((env->fsr & ((uint64_t)x >> 32))? 1: 0)
#include "fbranch_template.h"
#define FCC _fcc2
#define FFLAG_SET(x) ((env->fsr & ((uint64_t)x >> 34))? 1: 0)
#include "fbranch_template.h"
#define FCC _fcc3
#define FFLAG_SET(x) ((env->fsr & ((uint64_t)x >> 36))? 1: 0)
#include "fbranch_template.h"
#endif
#ifdef TARGET_SPARC64
void OPPROTO op_eval_brz(void)
{
T2 = (T0 == 0);
}
void OPPROTO op_eval_brnz(void)
{
T2 = (T0 != 0);
}
void OPPROTO op_eval_brlz(void)
{
T2 = ((int64_t)T0 < 0);
}
void OPPROTO op_eval_brlez(void)
{
T2 = ((int64_t)T0 <= 0);
}
void OPPROTO op_eval_brgz(void)
{
T2 = ((int64_t)T0 > 0);
}
void OPPROTO op_eval_brgez(void)
{
T2 = ((int64_t)T0 >= 0);
}
#endif
void OPPROTO op_jmp_label(void)
{
GOTO_LABEL_PARAM(1);
}
void OPPROTO op_jnz_T2_label(void)
{
if (T2)
GOTO_LABEL_PARAM(1);
FORCE_RET();
}
void OPPROTO op_jz_T2_label(void)
{
if (!T2)
GOTO_LABEL_PARAM(1);
FORCE_RET();
}
#define F_OP(name, p) void OPPROTO op_f##name##p(void)
#if defined(CONFIG_USER_ONLY)
......@@ -1310,26 +1068,6 @@ void OPPROTO op_fqtox(void)
}
#endif
void OPPROTO op_fmovs_cc(void)
{
if (T2)
FT0 = FT1;
}
void OPPROTO op_fmovd_cc(void)
{
if (T2)
DT0 = DT1;
}
#if defined(CONFIG_USER_ONLY)
void OPPROTO op_fmovq_cc(void)
{
if (T2)
QT0 = QT1;
}
#endif
void OPPROTO op_flushw(void)
{
if (env->cansave != NWINDOWS - 2) {
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册