aboutsummaryrefslogtreecommitdiff
path: root/target-i386/cc_helper.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2013-01-23 16:10:49 -0800
committerRichard Henderson <rth@twiddle.net>2013-02-18 15:25:55 -0800
commitdb9f2597722d5d8bc5f2330f186288d893114338 (patch)
tree240c865992c49a148ba7df2e0d50dffa7cb04a88 /target-i386/cc_helper.c
parent8601c0b6c553a018fc62007efa8ac2a71d77f449 (diff)
target-i386: Make helper_cc_compute_{all,c} const
Pass the data in explicitly, rather than indirectly via env. This avoids all sorts of unnecessary register spillage. Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-i386/cc_helper.c')
-rw-r--r--target-i386/cc_helper.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/target-i386/cc_helper.c b/target-i386/cc_helper.c
index 61427ddeac..a5d8181804 100644
--- a/target-i386/cc_helper.c
+++ b/target-i386/cc_helper.c
@@ -75,10 +75,8 @@ const uint8_t parity_table[256] = {
#endif
-uint32_t helper_cc_compute_all(CPUX86State *env, int op)
+target_ulong helper_cc_compute_all(target_ulong dst, target_ulong src1, int op)
{
- target_ulong dst = CC_DST, src1 = CC_SRC;
-
switch (op) {
default: /* should never happen */
return 0;
@@ -183,13 +181,11 @@ uint32_t helper_cc_compute_all(CPUX86State *env, int op)
uint32_t cpu_cc_compute_all(CPUX86State *env, int op)
{
- return helper_cc_compute_all(env, op);
+ return helper_cc_compute_all(CC_DST, CC_SRC, op);
}
-uint32_t helper_cc_compute_c(CPUX86State *env, int op)
+target_ulong helper_cc_compute_c(target_ulong dst, target_ulong src1, int op)
{
- target_ulong dst = CC_DST, src1 = CC_SRC;
-
switch (op) {
default: /* should never happen */
case CC_OP_LOGICB:
@@ -281,7 +277,7 @@ target_ulong helper_read_eflags(CPUX86State *env)
{
uint32_t eflags;
- eflags = helper_cc_compute_all(env, CC_OP);
+ eflags = cpu_cc_compute_all(env, CC_OP);
eflags |= (DF & DF_MASK);
eflags |= env->eflags & ~(VM_MASK | RF_MASK);
return eflags;