www.digitalmars.com         C & C++   DMDScript  

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

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: ibuclaw ubuntu.com



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: -------
Dec 04 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5321


Iain Buclaw <ibuclaw ubuntu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |ibuclaw ubuntu.com



Maybe s/D_InlineAsm_X86/X86_Any/ in the diff for 64bit too.

Regards

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 04 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5321


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugdbug yahoo.com.au
         Resolution|                            |FIXED


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