aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/fcvtmod_w_d.h
diff options
context:
space:
mode:
Diffstat (limited to 'riscv/insns/fcvtmod_w_d.h')
-rw-r--r--riscv/insns/fcvtmod_w_d.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/riscv/insns/fcvtmod_w_d.h b/riscv/insns/fcvtmod_w_d.h
index 89b9b95..e39400d 100644
--- a/riscv/insns/fcvtmod_w_d.h
+++ b/riscv/insns/fcvtmod_w_d.h
@@ -38,12 +38,14 @@ if (exp == 0) {
} else {
/* The fraction is shifted out entirely. */
frac = 0;
+ inexact = true;
}
- /* Notice overflow or inexact exceptions. */
+ /* Handle overflows */
if (true_exp > 31 || frac > (sign ? 0x80000000ull : 0x7fffffff)) {
/* Overflow, for which this operation raises invalid. */
invalid = true;
+ inexact = false; /* invalid takes precedence */
}
/* Honor the sign. */