Merge pull request #947 from klickverbot/run-tls-dtors

Issue 13414 - Static destructors not called correctly with dynamic loading
Merge pull request #992 from MartinNowak/2.066

cherry-picks for 2.066.1
core.stdc.math: full support for MSVCRT 2013+
Remove ldc.longdouble as it conflicts with MSVCRT 2013+ and is obsolete if real == double
core.stdc.fenv: get rid of linking error when using MSVC 2013+
core.math: proper support for MSVCRT 2013+
core.math: use LLVM fabs intrinsic
Merge pull request #13 from kinke/ldcmath

core.stdc.math: full support for MSVCRT 2013+
Implement exception chaining for Win64.

This also reverts d12cc013df9d because this is a code generation issue.
Fix a bug in intrinsics.di: llvm.fabs and llvm.floor are only available with LLVM 3.2+
The llvm.fabs intrinsic is ony available with LLVM 3.2+
PPC32/PPC64: Add inline assembler for getStackTop().

This also enables inlining of the function.
PPC: Improvements to thread code.

The callWithStackShell() code is now implemented as inline assembler.
A fiber_switchContext() implementation is added for PPC64.

With both changes all purely thread related and most fiber related test cases pass.
Implement core.checkedint in terms of LLVM intrinsics.
Merge of the ARM EH work by David.

See issue #489.
Fix PPC bugs.

1) Workaround LLVM bug 21443. The trick is to clobber r0 which forces
   LLVM to choose a different register.

2) Store stack pointer into variable sp.
PPC64: Load TOC register in fiber_switchContext.

The TOC pointer was saved but not loaded. The TOC pointer is nonvolatile
for local calls (inside the same module).
Fix dynamic thread vector (DTV) pointers on some platforms.

On PowerPC and Mips platforms the dynamic thread vector (DTV) pointers
point 0x8000 past the start of each TLS block. This commit adds support
for this offset.
Add intrinsics llvm.minnum and llvm.maxnum.

They are new in LLVM 3.6.
Add intrinsics llvm.debugtrap and llvm.expect.

Changes comment style of llvm.minnum and llvm.maxnum, too.