Implement VSU
This commit is contained in:
+5
-5
@@ -857,7 +857,7 @@ static int cpuFloatCommon(VB *sim, double value, int32_t *bits) {
|
||||
}
|
||||
|
||||
/* Underflow */
|
||||
if (value < 0 ? value > -FLT_MIN : value < FLT_MIN) {
|
||||
if (value != 0 && value > -FLT_MIN && value < FLT_MIN) {
|
||||
sim->cpu.psw.fud = 1;
|
||||
floatVal = 0;
|
||||
/* TODO: Can this produce negative zero? */
|
||||
@@ -872,10 +872,10 @@ static int cpuFloatCommon(VB *sim, double value, int32_t *bits) {
|
||||
|
||||
/* Update state */
|
||||
*bits = cpuFloatToWord(floatVal);
|
||||
sim->cpu.psw.cy = floatVal < 0;
|
||||
sim->cpu.psw.ov = 0;
|
||||
sim->cpu.psw.s = floatVal < 0;
|
||||
sim->cpu.psw.z = floatVal == 0;
|
||||
sim->cpu.psw.cy = floatVal < 0;
|
||||
sim->cpu.psw.ov = 0;
|
||||
sim->cpu.psw.s = floatVal < 0;
|
||||
sim->cpu.psw.z = floatVal == 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user