Revision a8ede8ba target-i386/helper.c

b/target-i386/helper.c
1157 1157
 * is_int is TRUE.  
1158 1158
 */
1159 1159
void raise_interrupt(int intno, int is_int, int error_code, 
1160
                     unsigned int next_eip)
1160
                     int next_eip_addend)
1161 1161
{
1162 1162
    env->exception_index = intno;
1163 1163
    env->error_code = error_code;
1164 1164
    env->exception_is_int = is_int;
1165
    env->exception_next_eip = next_eip;
1165
    env->exception_next_eip = env->eip + next_eip_addend;
1166 1166
    cpu_loop_exit();
1167 1167
}
1168 1168

  
......
2929 2929
    }
2930 2930
    
2931 2931
    if (env->cr[4] & CR4_OSFXSR_MASK) {
2932
        /* XXX: finish it, endianness */
2932
        /* XXX: finish it */
2933 2933
        stl(ptr + 0x18, 0); /* mxcsr */
2934 2934
        stl(ptr + 0x1c, 0); /* mxcsr_mask */
2935 2935
        nb_xmm_regs = 8 << data64;
2936 2936
        addr = ptr + 0xa0;
2937 2937
        for(i = 0; i < nb_xmm_regs; i++) {
2938
            stq(addr, env->xmm_regs[i].u.q[0]);
2939
            stq(addr, env->xmm_regs[i].u.q[1]);
2938
            stq(addr, env->xmm_regs[i].XMM_Q(0));
2939
            stq(addr + 8, env->xmm_regs[i].XMM_Q(1));
2940 2940
            addr += 16;
2941 2941
        }
2942 2942
    }
......
2972 2972
        nb_xmm_regs = 8 << data64;
2973 2973
        addr = ptr + 0xa0;
2974 2974
        for(i = 0; i < nb_xmm_regs; i++) {
2975
            env->xmm_regs[i].u.q[0] = ldq(addr);
2976
            env->xmm_regs[i].u.q[1] = ldq(addr);
2975
            env->xmm_regs[i].XMM_Q(0) = ldq(addr);
2976
            env->xmm_regs[i].XMM_Q(1) = ldq(addr + 8);
2977 2977
            addr += 16;
2978 2978
        }
2979 2979
    }
......
3099 3099
    }
3100 3100
}
3101 3101

  
3102
/* XXX: overflow support */
3102 3103
static void div64(uint64_t *plow, uint64_t *phigh, uint64_t b)
3103 3104
{
3104 3105
    uint64_t q, r, a1, a0;
......
3114 3115
    } else {
3115 3116
        /* XXX: use a better algorithm */
3116 3117
        for(i = 0; i < 64; i++) {
3118
            a1 = (a1 << 1) | (a0 >> 63);
3117 3119
            if (a1 >= b) {
3118 3120
                a1 -= b;
3119 3121
                qb = 1;
3120 3122
            } else {
3121 3123
                qb = 0;
3122 3124
            }
3123
            a1 = (a1 << 1) | (a0 >> 63);
3124 3125
            a0 = (a0 << 1) | qb;
3125 3126
        }
3126
#if defined(DEBUG_MULDIV) || 1
3127
#if defined(DEBUG_MULDIV)
3127 3128
        printf("div: 0x%016llx%016llx / 0x%016llx: q=0x%016llx r=0x%016llx\n",
3128 3129
               *phigh, *plow, b, a0, a1);
3129 3130
#endif
......
3167 3168
    EAX = r0;
3168 3169
    EDX = r1;
3169 3170
    CC_DST = r0;
3170
    CC_SRC = (r1 != (r0 >> 63));
3171
    CC_SRC = ((int64_t)r1 != ((int64_t)r0 >> 63));
3171 3172
}
3172 3173

  
3173 3174
void helper_imulq_T0_T1(void)

Also available in: Unified diff