whitespace
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 26 Apr 2023 11:11:55 +0000 (12:11 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 26 Apr 2023 11:11:55 +0000 (12:11 +0100)
openpower/sv/rfc/ls013.mdwn

index 81d43f9b00e8d04cf70323b341dab86b526a09e8..084189d684e2917815c32effb3a72c57e9fb610d 100644 (file)
@@ -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 <stdint.h>
-#include <string.h>
-
-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 <stdint.h>
+    #include <string.h>
+
+    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: