summaryrefslogtreecommitdiff
path: root/target-i386/int_helper.c
diff options
context:
space:
mode:
authorliguang <lig.fnst@cn.fujitsu.com>2013-05-28 16:20:59 +0800
committerBlue Swirl <blauwirbel@gmail.com>2013-06-15 17:48:38 +0000
commit4b34e3ad83588602834c05c0d59a0d2973e9f48c (patch)
treeb0ef2c3786a17fd2b1c44d0a3576faa140749fb0 /target-i386/int_helper.c
parent371a775dc18ece3ff7d77328d1ee28cb2d473706 (diff)
target-i386/helper: remove EAX macro
Signed-off-by: liguang <lig.fnst@cn.fujitsu.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'target-i386/int_helper.c')
-rw-r--r--target-i386/int_helper.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/target-i386/int_helper.c b/target-i386/int_helper.c
index 74c7c36124..16d1ed53f5 100644
--- a/target-i386/int_helper.c
+++ b/target-i386/int_helper.c
@@ -45,7 +45,7 @@ void helper_divb_AL(CPUX86State *env, target_ulong t0)
{
unsigned int num, den, q, r;
- num = (EAX & 0xffff);
+ num = (env->regs[R_EAX] & 0xffff);
den = (t0 & 0xff);
if (den == 0) {
raise_exception(env, EXCP00_DIVZ);
@@ -56,14 +56,14 @@ void helper_divb_AL(CPUX86State *env, target_ulong t0)
}
q &= 0xff;
r = (num % den) & 0xff;
- EAX = (EAX & ~0xffff) | (r << 8) | q;
+ env->regs[R_EAX] = (env->regs[R_EAX] & ~0xffff) | (r << 8) | q;
}
void helper_idivb_AL(CPUX86State *env, target_ulong t0)
{
int num, den, q, r;
- num = (int16_t)EAX;
+ num = (int16_t)env->regs[R_EAX];
den = (int8_t)t0;
if (den == 0) {
raise_exception(env, EXCP00_DIVZ);
@@ -74,14 +74,14 @@ void helper_idivb_AL(CPUX86State *env, target_ulong t0)
}
q &= 0xff;
r = (num % den) & 0xff;
- EAX = (EAX & ~0xffff) | (r << 8) | q;
+ env->regs[R_EAX] = (env->regs[R_EAX] & ~0xffff) | (r << 8) | q;
}
void helper_divw_AX(CPUX86State *env, target_ulong t0)
{
unsigned int num, den, q, r;
- num = (EAX & 0xffff) | ((EDX & 0xffff) << 16);
+ num = (env->regs[R_EAX] & 0xffff) | ((EDX & 0xffff) << 16);
den = (t0 & 0xffff);
if (den == 0) {
raise_exception(env, EXCP00_DIVZ);
@@ -92,7 +92,7 @@ void helper_divw_AX(CPUX86State *env, target_ulong t0)
}
q &= 0xffff;
r = (num % den) & 0xffff;
- EAX = (EAX & ~0xffff) | q;
+ env->regs[R_EAX] = (env->regs[R_EAX] & ~0xffff) | q;
EDX = (EDX & ~0xffff) | r;
}
@@ -100,7 +100,7 @@ void helper_idivw_AX(CPUX86State *env, target_ulong t0)
{
int num, den, q, r;
- num = (EAX & 0xffff) | ((EDX & 0xffff) << 16);
+ num = (env->regs[R_EAX] & 0xffff) | ((EDX & 0xffff) << 16);
den = (int16_t)t0;
if (den == 0) {
raise_exception(env, EXCP00_DIVZ);
@@ -111,7 +111,7 @@ void helper_idivw_AX(CPUX86State *env, target_ulong t0)
}
q &= 0xffff;
r = (num % den) & 0xffff;
- EAX = (EAX & ~0xffff) | q;
+ env->regs[R_EAX] = (env->regs[R_EAX] & ~0xffff) | q;
EDX = (EDX & ~0xffff) | r;
}
@@ -120,7 +120,7 @@ void helper_divl_EAX(CPUX86State *env, target_ulong t0)
unsigned int den, r;
uint64_t num, q;
- num = ((uint32_t)EAX) | ((uint64_t)((uint32_t)EDX) << 32);
+ num = ((uint32_t)env->regs[R_EAX]) | ((uint64_t)((uint32_t)EDX) << 32);
den = t0;
if (den == 0) {
raise_exception(env, EXCP00_DIVZ);
@@ -130,7 +130,7 @@ void helper_divl_EAX(CPUX86State *env, target_ulong t0)
if (q > 0xffffffff) {
raise_exception(env, EXCP00_DIVZ);
}
- EAX = (uint32_t)q;
+ env->regs[R_EAX] = (uint32_t)q;
EDX = (uint32_t)r;
}
@@ -139,7 +139,7 @@ void helper_idivl_EAX(CPUX86State *env, target_ulong t0)
int den, r;
int64_t num, q;
- num = ((uint32_t)EAX) | ((uint64_t)((uint32_t)EDX) << 32);
+ num = ((uint32_t)env->regs[R_EAX]) | ((uint64_t)((uint32_t)EDX) << 32);
den = t0;
if (den == 0) {
raise_exception(env, EXCP00_DIVZ);
@@ -149,7 +149,7 @@ void helper_idivl_EAX(CPUX86State *env, target_ulong t0)
if (q != (int32_t)q) {
raise_exception(env, EXCP00_DIVZ);
}
- EAX = (uint32_t)q;
+ env->regs[R_EAX] = (uint32_t)q;
EDX = (uint32_t)r;
}
@@ -160,10 +160,10 @@ void helper_aam(CPUX86State *env, int base)
{
int al, ah;
- al = EAX & 0xff;
+ al = env->regs[R_EAX] & 0xff;
ah = al / base;
al = al % base;
- EAX = (EAX & ~0xffff) | al | (ah << 8);
+ env->regs[R_EAX] = (env->regs[R_EAX] & ~0xffff) | al | (ah << 8);
CC_DST = al;
}
@@ -171,10 +171,10 @@ void helper_aad(CPUX86State *env, int base)
{
int al, ah;
- al = EAX & 0xff;
- ah = (EAX >> 8) & 0xff;
+ al = env->regs[R_EAX] & 0xff;
+ ah = (env->regs[R_EAX] >> 8) & 0xff;
al = ((ah * base) + al) & 0xff;
- EAX = (EAX & ~0xffff) | al;
+ env->regs[R_EAX] = (env->regs[R_EAX] & ~0xffff) | al;
CC_DST = al;
}
@@ -186,8 +186,8 @@ void helper_aaa(CPUX86State *env)
eflags = cpu_cc_compute_all(env, CC_OP);
af = eflags & CC_A;
- al = EAX & 0xff;
- ah = (EAX >> 8) & 0xff;
+ al = env->regs[R_EAX] & 0xff;
+ ah = (env->regs[R_EAX] >> 8) & 0xff;
icarry = (al > 0xf9);
if (((al & 0x0f) > 9) || af) {
@@ -198,7 +198,7 @@ void helper_aaa(CPUX86State *env)
eflags &= ~(CC_C | CC_A);
al &= 0x0f;
}
- EAX = (EAX & ~0xffff) | al | (ah << 8);
+ env->regs[R_EAX] = (env->regs[R_EAX] & ~0xffff) | al | (ah << 8);
CC_SRC = eflags;
}
@@ -210,8 +210,8 @@ void helper_aas(CPUX86State *env)
eflags = cpu_cc_compute_all(env, CC_OP);
af = eflags & CC_A;
- al = EAX & 0xff;
- ah = (EAX >> 8) & 0xff;
+ al = env->regs[R_EAX] & 0xff;
+ ah = (env->regs[R_EAX] >> 8) & 0xff;
icarry = (al < 6);
if (((al & 0x0f) > 9) || af) {
@@ -222,7 +222,7 @@ void helper_aas(CPUX86State *env)
eflags &= ~(CC_C | CC_A);
al &= 0x0f;
}
- EAX = (EAX & ~0xffff) | al | (ah << 8);
+ env->regs[R_EAX] = (env->regs[R_EAX] & ~0xffff) | al | (ah << 8);
CC_SRC = eflags;
}
@@ -234,7 +234,7 @@ void helper_daa(CPUX86State *env)
eflags = cpu_cc_compute_all(env, CC_OP);
cf = eflags & CC_C;
af = eflags & CC_A;
- old_al = al = EAX & 0xff;
+ old_al = al = env->regs[R_EAX] & 0xff;
eflags = 0;
if (((al & 0x0f) > 9) || af) {
@@ -245,7 +245,7 @@ void helper_daa(CPUX86State *env)
al = (al + 0x60) & 0xff;
eflags |= CC_C;
}
- EAX = (EAX & ~0xff) | al;
+ env->regs[R_EAX] = (env->regs[R_EAX] & ~0xff) | al;
/* well, speed is not an issue here, so we compute the flags by hand */
eflags |= (al == 0) << 6; /* zf */
eflags |= parity_table[al]; /* pf */
@@ -261,7 +261,7 @@ void helper_das(CPUX86State *env)
eflags = cpu_cc_compute_all(env, CC_OP);
cf = eflags & CC_C;
af = eflags & CC_A;
- al = EAX & 0xff;
+ al = env->regs[R_EAX] & 0xff;
eflags = 0;
al1 = al;
@@ -276,7 +276,7 @@ void helper_das(CPUX86State *env)
al = (al - 0x60) & 0xff;
eflags |= CC_C;
}
- EAX = (EAX & ~0xff) | al;
+ env->regs[R_EAX] = (env->regs[R_EAX] & ~0xff) | al;
/* well, speed is not an issue here, so we compute the flags by hand */
eflags |= (al == 0) << 6; /* zf */
eflags |= parity_table[al]; /* pf */
@@ -381,12 +381,12 @@ void helper_divq_EAX(CPUX86State *env, target_ulong t0)
if (t0 == 0) {
raise_exception(env, EXCP00_DIVZ);
}
- r0 = EAX;
+ r0 = env->regs[R_EAX];
r1 = EDX;
if (div64(&r0, &r1, t0)) {
raise_exception(env, EXCP00_DIVZ);
}
- EAX = r0;
+ env->regs[R_EAX] = r0;
EDX = r1;
}
@@ -397,12 +397,12 @@ void helper_idivq_EAX(CPUX86State *env, target_ulong t0)
if (t0 == 0) {
raise_exception(env, EXCP00_DIVZ);
}
- r0 = EAX;
+ r0 = env->regs[R_EAX];
r1 = EDX;
if (idiv64(&r0, &r1, t0)) {
raise_exception(env, EXCP00_DIVZ);
}
- EAX = r0;
+ env->regs[R_EAX] = r0;
EDX = r1;
}
#endif