From: lkcl Date: Sun, 5 Jun 2022 01:37:40 +0000 (+0100) Subject: (no commit message) X-Git-Tag: opf_rfc_ls005_v1~1956 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a6736456bde398a6f1efb587d24f2e470579d3bd;p=libreriscv.git --- diff --git a/openpower/sv/fclass.mdwn b/openpower/sv/fclass.mdwn index 1b4e29799..64c432e9f 100644 --- a/openpower/sv/fclass.mdwn +++ b/openpower/sv/fclass.mdwn @@ -4,9 +4,17 @@ In SV just as with [[sv/fcvt]] single precision is to be considered half-of-elwi based on xvtstdcsp v3.0B p768 the instruction performs analysis of the FP number to determine if it is Infinity, NaN, Denormalised or Zero and if so which sign. -unlike xvtstdcsp the result is stored in a Condition Register specified by BF. +unlike xvtstdcsp the result is stored in a Condition Register +Field specified by BF. this allows it to be used as a predicate mask. setb may be used to create the equivalent of xvtstdcsp if desired. +The CR Field bits are set in a reasonably logical fashion: + +* BF.EQ is set if FRB is zero +* BF.LE is set if FRB is non-normalises +* BF.GE is set if FRB is infinite +* BF.SO is set if FRB is NaN + | 0.5| 6.8 |9..15 | 16.20 | 21...30 |31| name | Form | | -- | --- | -- | ----- | ------- |--| ------- | ------ | | PO | BF | DCMX | FRB | XO |dm2| fptstsp | X-Form| @@ -23,10 +31,10 @@ class.Zero <- (exponent = 0x00) & (fraction = 0) class.Denormal <- (exponent = 0x00) & (fraction != 0) CR{BF} <- ((dcmx[0] & class.NaN & !sign) | (dcmx[1] & class.NaN & sign)) || - ((dcmx[6] & class.Denormal & !sign) | - (dcmx[7] & class.Denormal & sign)) || ((dcmx[2] & class.Infinity & !sign) | (dcmx[3] & class.Infinity & sign)) || + ((dcmx[6] & class.Denormal & !sign) | + (dcmx[7] & class.Denormal & sign)) || ((dcmx[4] & class.Zero & !sign) | (dcmx[5] & class.Zero & sign)) ```