← Back to index
|
Original Bugzilla link
Bug 5321 – std.math: assumes X86 or X86_64 on FPU control word code
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2010-12-04T14:26:00Z
Last change time
2010-12-07T16:47:49Z
Keywords
patch
Assigned to
nobody
Creator
ibuclaw
Comments
Comment #0
by ibuclaw — 2010-12-04T14:26:37Z
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"); } }
Comment #1
by ibuclaw — 2010-12-04T14:28:11Z
Maybe s/D_InlineAsm_X86/X86_Any/ in the diff for 64bit too. Regards