From: Luke Kenneth Casson Leighton Date: Wed, 26 Apr 2023 11:11:55 +0000 (+0100) Subject: whitespace X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2332b24dbbff3fa2c3df1c902d3add0ae8799c50;p=libreriscv.git whitespace --- diff --git a/openpower/sv/rfc/ls013.mdwn b/openpower/sv/rfc/ls013.mdwn index 81d43f9b0..084189d68 100644 --- a/openpower/sv/rfc/ls013.mdwn +++ b/openpower/sv/rfc/ls013.mdwn @@ -394,36 +394,36 @@ Add `MM` to the `Formats:` list for all of `FRT`, `FRA`, `FRB`, `XO (25:30)`, 32 instructions are required in SFFS to emulate fmax. ``` -#include -#include - -inline uint64_t asuint64(double f) { - union { - double f; - uint64_t i; - } u = {f}; - return u.i; -} - -inline int issignaling(double v) { - // copied from glibc: - // https://github.com/bminor/glibc/blob/e2756903329365134089d23548e9083d23bc3dd9/sysdeps/ieee754/dbl-64/math_config.h#L101 - uint64_t ix = asuint64(v); - return 2 * (ix ^ 0x0008000000000000) > 2 * 0x7ff8000000000000ULL; -} - -double fmax(double x, double y) { - // copied from glibc: - // https://github.com/bminor/glibc/blob/e2756903329365134089d23548e9083d23bc3dd9/math/s_fmax_template.c - if(__builtin_isgreaterequal(x, y)) - return x; - else if(__builtin_isless(x, y)) - return y; - else if(issignaling(x) || issignaling(y)) - return x + y; - else - return __builtin_isnan(y) ? x : y; -} + #include + #include + + inline uint64_t asuint64(double f) { + union { + double f; + uint64_t i; + } u = {f}; + return u.i; + } + + inline int issignaling(double v) { + // copied from glibc: + // https://github.com/bminor/glibc/blob/e2756903/sysdeps/ieee754/dbl-64/math_config.h#L101 + uint64_t ix = asuint64(v); + return 2 * (ix ^ 0x0008000000000000) > 2 * 0x7ff8000000000000ULL; + } + + double fmax(double x, double y) { + // copied from glibc: + // https://github.com/bminor/glibc/blob/e2756903/math/s_fmax_template.c + if(__builtin_isgreaterequal(x, y)) + return x; + else if(__builtin_isless(x, y)) + return y; + else if(issignaling(x) || issignaling(y)) + return x + y; + else + return __builtin_isnan(y) ? x : y; + } ``` Assembly listing: