Changeset 1437

Show
Ignore:
Timestamp:
11/16/07 12:29:36 (10 months ago)
Author:
common
Message:

libemu

  • fpu backwards traversal was dodgy, comparing fpu state with eflags does not make any sense
    look at the src/emu_track.c diff to see the mess
    when fixing, the size of the fpu state got shrinked to one bit, we don't need the others anyway
    TRACK_FPU_LAST_INSTRUCTION had to be adjusted to comply with one bit vars
  • sub reg32_a,reg32_b inits reg32_a if reg32_a == reg32_b
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libemu/trunk/include/emu/emu_cpu_data.h

    r1317 r1437  
    257257 
    258258 
    259 #define TRACK_FPU_LAST_INSTRUCTION  0x1 
     259#define TRACK_FPU_LAST_INSTRUCTION  0x0 
    260260 
    261261#define TRACK_INIT_FPU(instruction, what) (instruction).track.init.fpu |= 1 << (what); 
  • libemu/trunk/include/emu/emu_track.h

    r1317 r1437  
    5757        uint32_t reg[8]; 
    5858 
    59         uint8_t fpu; // used to store the last_instruction information required for fnstenv 
     59        uint8_t fpu:1; // used to store the last_instruction information required for fnstenv 
    6060}; 
    6161 
  • libemu/trunk/src/emu_cpu.c

    r1378 r1437  
    855855 
    856856                                TRACK_NEED_FPU(c->instr, TRACK_FPU_LAST_INSTRUCTION); 
    857                               TRACK_INIT_FPU(c->instr, TRACK_FPU_LAST_INSTRUCTION); 
     857//                            TRACK_INIT_FPU(c->instr, TRACK_FPU_LAST_INSTRUCTION); 
    858858                        } 
    859859                        else if( c->instr.fpu.fpu_data[1] == 0xee ) 
     
    862862                                TRACK_INIT_FPU(c->instr, TRACK_FPU_LAST_INSTRUCTION); 
    863863                        } 
     864                        else 
     865                        { // catch all others to init fpu 
     866                                TRACK_INIT_FPU(c->instr, TRACK_FPU_LAST_INSTRUCTION); 
     867                        } 
     868 
    864869                } 
    865870                else if( c->instr.fpu.fpu_data[0] == 0xdd ) 
  • libemu/trunk/src/emu_track.c

    r1317 r1437  
    238238        } 
    239239 
    240         for (i=0;i<8;i++) 
    241         { 
    242                 if ( (b->fpu & 1 << i) > (a->eflags & 1 << i)) 
    243                         return false; 
    244         } 
     240        if ( b->fpu > a->fpu ) 
     241                return false; 
    245242 
    246243 
  • libemu/trunk/src/functions/sub.c

    r1317 r1437  
    164164                                                                         c->reg[i->modrm.rm],  
    165165                                                                         -) 
     166                        if (i->modrm.opc == i->modrm.rm) 
     167                        { 
     168                                TRACK_INIT_REG32(c->instr, i->modrm.opc); 
     169                        }else 
     170                        { 
     171                                TRACK_NEED_REG32(c->instr, i->modrm.rm); 
     172                                TRACK_NEED_REG32(c->instr, i->modrm.opc); 
     173                        } 
     174 
    166175                } 
    167176        }