[Issue 5321] New: std.math: assumes X86 or X86_64 on FPU control word code

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Dec 4 14:28:13 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=5321

           Summary: std.math: assumes X86 or X86_64 on FPU control word
                    code
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: ibuclaw at ubuntu.com


--- Comment #0 from Iain Buclaw <ibuclaw at ubuntu.com> 2010-12-04 14:26:37 PST ---
Patch:

--- phobos-trunk~/phobos/std/math.d    2010-12-03 03:25:12.000000000 +0000
+++ phobos-trunk/phobos/std/math.d    2010-12-04 22:25:33.889486613 +0000
@@ -1957,7 +1957,8 @@
             DIVBYZERO_MASK = 0x040,
             INVALID_MASK   = 0x200
         }
-    }
+    } else
+        static assert(0, "Not implemented");
 private:
     static uint getIeeeFlags()
     {
@@ -2139,30 +2140,45 @@
     // Clear all pending exceptions
     static void clearExceptions()
     {
-        asm
+        version (D_InlineAsm_X86)
         {
-            fclex;
+            asm
+            {
+                fclex;
+            }
         }
+        else
+            assert(0, "Not yet supported");
     }
     // Read from the control register
     static ushort getControlState()
     {
         short cont;
-        asm
+        version (D_InlineAsm_X86)
         {
-            xor EAX, EAX;
-            fstcw cont;
+            asm
+            {
+                xor EAX, EAX;
+                fstcw cont;
+            }
         }
+        else
+            assert(0, "Not yet supported");
         return cont;
     }
     // Set the control register
     static void setControlState(ushort newState)
     {
-        asm
+        version (D_InlineAsm_X86)
         {
-             fclex;
-             fldcw newState;
+            asm
+            {
+                fclex;
+                fldcw newState;
+            }
         }
+        else
+            assert(0, "Not yet supported");
     }
 }

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list