[Top] [All Lists]

CVS linux

Subject: CVS linux
From: Ralf Baechle <>
Date: Sun, 2 Dec 2001 19:19:09 -0800
CVSROOT:        /home/pub/cvs
Module name:    linux
Changes by:        01/12/02 19:19:09

Modified files:
        arch/mips/math-emu: cp1emu.c 

Log message:
        Fix another math emulation problem. The code that was failing looked
        like this:
        bc1f  1f
        jr ra
        move v0,v1
        When the bc1f is emulated and the branch is taken, mips_dsemul gets
        called to emulate the delay slot insn. Before calling mips_dsemul, the
        branch emulation code sets CAUSEF_BD. mips_dsemul checks for nop and
        bails out early instead of going through the process of executing the
        insn. The loop in fpu_emulator_cop1Handler will call cop1Emulate with
        the BD flag set and epc pointing to the "jr ra" insn. cop1Emulate sees
        the BD flag and calculates the continue PC based on the jr insn target
        address.  cop1Emulate then bails out because the move in the jr delay
        slot is not a cop1 insn. This results in the program being restarted at
        the "jr ra" target address and the move in the jr delay slot being
        ignored. This only happens when a nop is in the cop1 branch delay slot
        because ds_emul will have the cpu execute other insns and that will
        clear the BD flag.
        Fixed by clearing the BD flag when ds_emul returns directly in the case
        of a nop.

<Prev in Thread] Current Thread [Next in Thread>