Commit 1e4840bf authored by bellard's avatar bellard
Browse files

transformed TN into temporaries - add local temporaries usage when needed - optimized fcmovX

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4577 c046a42c-6fe2-441c-8c8c-71466251a162
parent 641d5fbe
......@@ -472,12 +472,6 @@ typedef union {
#define NB_MMU_MODES 2
typedef struct CPUX86State {
#if TARGET_LONG_BITS > HOST_LONG_BITS
/* temporaries if we cannot store them in host registers */
target_ulong t0, t1, t2;
#endif
target_ulong t3;
/* standard registers */
target_ulong regs[CPU_NB_REGS];
target_ulong eip;
......@@ -526,6 +520,7 @@ typedef struct CPUX86State {
XMMReg xmm_regs[CPU_NB_REGS];
XMMReg xmm_t0;
MMXReg mmx_t0;
target_ulong cc_tmp; /* temporary for rcr/rcl */
/* sysenter registers */
uint32_t sysenter_cs;
......
......@@ -29,60 +29,20 @@
#include "cpu-defs.h"
/* at least 4 register variables are defined */
register struct CPUX86State *env asm(AREG0);
#ifndef CPU_NO_GLOBAL_REGS
#if TARGET_LONG_BITS > HOST_LONG_BITS
/* no registers can be used */
#define T0 (env->t0)
#define T1 (env->t1)
#define T2 (env->t2)
#else
/* XXX: use unsigned long instead of target_ulong - better code will
be generated for 64 bit CPUs */
register target_ulong T0 asm(AREG1);
register target_ulong T1 asm(AREG2);
register target_ulong T2 asm(AREG3);
#endif /* ! (TARGET_LONG_BITS > HOST_LONG_BITS) */
#endif /* ! CPU_NO_GLOBAL_REGS */
#define A0 T2
extern FILE *logfile;
extern int loglevel;
#ifndef reg_EAX
#define EAX (env->regs[R_EAX])
#endif
#ifndef reg_ECX
#define ECX (env->regs[R_ECX])
#endif
#ifndef reg_EDX
#define EDX (env->regs[R_EDX])
#endif
#ifndef reg_EBX
#define EBX (env->regs[R_EBX])
#endif
#ifndef reg_ESP
#define ESP (env->regs[R_ESP])
#endif
#ifndef reg_EBP
#define EBP (env->regs[R_EBP])
#endif
#ifndef reg_ESI
#define ESI (env->regs[R_ESI])
#endif
#ifndef reg_EDI
#define EDI (env->regs[R_EDI])
#endif
#define EIP (env->eip)
#define EIP (env->eip)
#define DF (env->df)
#define CC_SRC (env->cc_src)
......
......@@ -287,11 +287,11 @@ target_ulong glue(helper_rcl, SUFFIX)(target_ulong t0, target_ulong t1)
if (count > 1)
res |= t0 >> (DATA_BITS + 1 - count);
t0 = res;
env->t3 = (eflags & ~(CC_C | CC_O)) |
env->cc_tmp = (eflags & ~(CC_C | CC_O)) |
(lshift(src ^ t0, 11 - (DATA_BITS - 1)) & CC_O) |
((src >> (DATA_BITS - count)) & CC_C);
} else {
env->t3 = -1;
env->cc_tmp = -1;
}
return t0;
}
......@@ -316,11 +316,11 @@ target_ulong glue(helper_rcr, SUFFIX)(target_ulong t0, target_ulong t1)
if (count > 1)
res |= t0 << (DATA_BITS + 1 - count);
t0 = res;
env->t3 = (eflags & ~(CC_C | CC_O)) |
env->cc_tmp = (eflags & ~(CC_C | CC_O)) |
(lshift(src ^ t0, 11 - (DATA_BITS - 1)) & CC_O) |
((src >> (count - 1)) & CC_C);
} else {
env->t3 = -1;
env->cc_tmp = -1;
}
return t0;
}
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment