Implement VSU

This commit is contained in:
2024-10-20 18:52:19 -05:00
parent 50903c7513
commit 3afe0282c2
7 changed files with 734 additions and 43 deletions
+5 -5
View File
@@ -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;
}