Browse Source
Merge pull request #1357 from ptomsich/ptomsich/1312-fix-fcvtmod_w_d-exceptions
Zfa: fix exception behaviour for fcvtmod.w.d
pull/1208/merge
Andrew Waterman
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
1 deletions
-
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. */ |
|
|
|
|