]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libphobos: RISC-V: Fix soft-float build errors with IEEE exception flags
authoribuclaw <ibuclaw@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 2 May 2019 16:38:08 +0000 (16:38 +0000)
committeribuclaw <ibuclaw@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 2 May 2019 16:38:08 +0000 (16:38 +0000)
libphobos/ChangeLog:

* std/math.d (IeeeFlags.getIeeeFlags): Handle RISC-V soft-float ABI.
(IeeeFlags.resetIeeeFlags): Likewise.
(FloatingPointControl.getControlState): Likewise.
(FloatingPointControl.setControlState): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@270815 138bc75d-0d04-0410-961f-82ee72b054a4

libphobos/ChangeLog
libphobos/src/std/math.d

index 0d937e02bfce9eb4ac9cecfd857ed3411988de56..780e30430ba78ea042e374a9484140aab1dc6394 100644 (file)
@@ -1,3 +1,10 @@
+2019-05-02  Maciej Rozycki  <macro@wdc.com>
+
+       * std/math.d (IeeeFlags.getIeeeFlags): Handle RISC-V soft-float ABI.
+       (IeeeFlags.resetIeeeFlags): Likewise.
+       (FloatingPointControl.getControlState): Likewise.
+       (FloatingPointControl.setControlState): Likewise.
+
 2019-04-25  Iain Buclaw  <ibuclaw@gdcproject.org>
 
        PR d/90250
index 7e6a97f1dcdcc43e18d130fe42fc64d2ae91e719..ff1633abf77c1700e89c10e006c2512498f53241 100644 (file)
@@ -4767,12 +4767,17 @@ private:
             }
             else version (RISCV_Any)
             {
-                uint result = void;
-                asm pure nothrow @nogc
+                version (D_SoftFloat)
+                    return 0;
+                else
                 {
-                    "frflags %0" : "=r" result;
+                    uint result = void;
+                    asm pure nothrow @nogc
+                    {
+                        "frflags %0" : "=r" result;
+                    }
+                    return result;
                 }
-                return result;
             }
             else
                 assert(0, "Not yet supported");
@@ -4850,10 +4855,15 @@ private:
             }
             else version (RISCV_Any)
             {
-                uint newValues = 0x0;
-                asm pure nothrow @nogc
+                version (D_SoftFloat)
+                    return;
+                else
                 {
-                    "fsflags %0" : : "r" newValues;
+                    uint newValues = 0x0;
+                    asm pure nothrow @nogc
+                    {
+                        "fsflags %0" : : "r" newValues;
+                    }
                 }
             }
             else
@@ -5450,12 +5460,17 @@ private:
             }
             else version (RISCV_Any)
             {
-                ControlState cont;
-                asm pure nothrow @nogc
+                version (D_SoftFloat)
+                    return 0;
+                else
                 {
-                    "frcsr %0" : "=r" cont;
+                    ControlState cont;
+                    asm pure nothrow @nogc
+                    {
+                        "frcsr %0" : "=r" cont;
+                    }
+                    return cont;
                 }
-                return cont;
             }
             else
                 assert(0, "Not yet supported");
@@ -5544,9 +5559,14 @@ private:
             }
             else version (RISCV_Any)
             {
-                asm pure nothrow @nogc
+                version (D_SoftFloat)
+                    return;
+                else
                 {
-                    "fscsr %0" : : "r" (newState);
+                    asm pure nothrow @nogc
+                    {
+                        "fscsr %0" : : "r" (newState);
+                    }
                 }
             }
             else