linux-cvs
[Top] [All Lists]

CVS Update@oss.sgi.com: linux

To: linux-cvs@oss.sgi.com
Subject: CVS Update@oss.sgi.com: linux
From: Ralf Baechle <ralf@oss.sgi.com>
Date: Sun, 2 Dec 2001 19:20:01 -0800
Sender: owner-linux-cvs@oss.sgi.com
CVSROOT:        /home/pub/cvs
Module name:    linux
Changes by:     ralf@oss.sgi.com        01/12/02 19:20:01

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

Log message:
        Fix another math emulation problem. The code that was failing looked
        like this:
        
        bc1f  1f
        nop
        ...
        1:
        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>