]> git.proxmox.com Git - qemu.git/commit - target-mips/translate.c
target-mips: optimize ddiv/ddivu/div/divu with movcond
authorAurelien Jarno <aurelien@aurel32.net>
Tue, 9 Oct 2012 19:53:21 +0000 (21:53 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Wed, 31 Oct 2012 21:20:48 +0000 (22:20 +0100)
commit51127181cfac0315720e6ca502eb133a353f6b11
tree19573138089d6e5d3e95948b3bee16bfcb3a35a4
parentacf124655873cf7256877a35efd8dacca1b199d8
target-mips: optimize ddiv/ddivu/div/divu with movcond

The result of a division by 0, or a division of INT_MIN by -1 in the
signed case, is unpredictable. Just replace 0 by 1 in that case so that
it doesn't trigger a floating point exception on the host.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-mips/translate.c