Revision 7d08d856 target-ppc/fpu_helper.c

b/target-ppc/fpu_helper.c
430 430

  
431 431
void helper_store_fpscr(CPUPPCState *env, uint64_t arg, uint32_t mask)
432 432
{
433
    /*
434
     * We use only the 32 LSB of the incoming fpr
435
     */
436
    uint32_t prev, new;
433
    target_ulong prev, new;
437 434
    int i;
438 435

  
439 436
    prev = env->fpscr;
440
    new = (uint32_t)arg;
441
    new &= ~0x60000000;
442
    new |= prev & 0x60000000;
443
    for (i = 0; i < 8; i++) {
437
    new = (target_ulong)arg;
438
    new &= ~0x60000000LL;
439
    new |= prev & 0x60000000LL;
440
    for (i = 0; i < sizeof(target_ulong) * 2; i++) {
444 441
        if (mask & (1 << i)) {
445
            env->fpscr &= ~(0xF << (4 * i));
446
            env->fpscr |= new & (0xF << (4 * i));
442
            env->fpscr &= ~(0xFLL << (4 * i));
443
            env->fpscr |= new & (0xFLL << (4 * i));
447 444
        }
448 445
    }
449 446
    /* Update VX and FEX */

Also available in: Unified diff