Remove shifts of the PSR constants before applying to the trap frame.
Oring 0 doesn't do anything useful.
This commit is contained in:
parent
d290e6d4a4
commit
b5e21344a8
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: emul.c,v 1.17 2012/05/01 09:40:15 martin Exp $ */
|
||||
/* $NetBSD: emul.c,v 1.18 2015/11/27 13:45:17 joerg Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.17 2012/05/01 09:40:15 martin Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.18 2015/11/27 13:45:17 joerg Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -190,17 +190,17 @@ muldiv(struct trapframe *tf,
|
||||
tf->tf_psr &= ~PSR_ICC;
|
||||
|
||||
if (*rd == 0)
|
||||
tf->tf_psr |= PSR_Z << 20;
|
||||
tf->tf_psr |= PSR_Z;
|
||||
else {
|
||||
if (op.bits.sgn && *rd < 0)
|
||||
tf->tf_psr |= PSR_N << 20;
|
||||
tf->tf_psr |= PSR_N;
|
||||
if (op.bits.div) {
|
||||
if (*rd * *rs2 != *rs1)
|
||||
tf->tf_psr |= PSR_O << 20;
|
||||
tf->tf_psr |= PSR_O;
|
||||
}
|
||||
else {
|
||||
if (*rd / *rs2 != *rs1)
|
||||
tf->tf_psr |= PSR_O << 20;
|
||||
tf->tf_psr |= PSR_O;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user