On Mon, Oct 26, 2020 at 01:05:00PM -0300, Raoni Fassina Firmino wrote: > On Mon, Sep 28, 2020 at 11:42:13AM -0500, will schmidt wrote: > > > +;; FE_INEXACT, FE_DIVBYZERO, FE_UNDERFLOW and FE_OVERFLOW flags. > > > +;; It doesn't handle values out of range, and always returns 0. > > > +;; Note that FE_INVALID is unsupported because it maps to more than > > > +;; one bit on FPSCR register. > > > > Should FE_INVALID have an explicit case statement path to FAIL? > > Because there is only 4 valid flags I am doing the other way around, > just checking if it is any of the valid flags and FAIL for any other > value, so there is no need of an explicit FE_INVALID case, but if it is > better to have one anyway to make the intention clear through code, I > don't know.
To clear VX ("invalid", bit 34) you need to clear all different VX bits (one per cause), so 39-44, 53-55. To *set* it you need to pick which one you want to set. Maybe this is all best left the the libc in use, which should have its own policy for that, it might not be the same on all libcs. Segher