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
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.
Merge tag 'v2.066.1' into ldc
Win64: fix vararg ABI for extern(C)
Experimental generic vararg ABI fix & clean-up.
System V AMD64 ABI still unsupported because I can't experiment with it.
core.stdc.stdarg: re-add support for System V AMD64 ABI.