* Mark libc math shims with always_inline attribute
We want these to always be inlined, so mark them with ... always_inline.
The compiler happened to do the right thing with them previously, but we
shouldn't depend on that.
<rdar://problem/30043258> master-next: IRGen/builtin_math.swift failing because sqrt(4) is not constant folded
For generic multi-payload enums, we would proceed down the
dynamic layout path without checking for a builtin descriptor.
As a result Set and Dictionary were always reported as being
9 bytes in size and not 8. Oops...
Fixes <rdar://problem/30066015>.
This optimization checks to see if a Character can fit in the 63-bit
small representation instead of unconditionally constructing a String
and paying the cost of that allocation. If it does, the small
representation is computed directly from its UTF-8 code units.
In optimized builds, this turns Character literals <= 8 UTF-8 code units
long into single 64-bit integer loads -- a huge improvement.
- CYGWIN symbol is used to distinguish Cygwin environment from other OS
and other environment in Windows.
- Added windows and windowsCygnus to OSVersion in StdlibUnittest
Added documentation description for third parameter of
formIndex(_:offsetBy:limitedBy:)
which was previously omitted.
Description copied from the 'index(_:offsetBy:limitedBy:)' method.
* Mark several C macros imported from <float.h> as deprecated.
These macros all have straightforward replacements in terms of static properties on FloatingPoint or BinaryFloatingPoint. It is necessary to add 1 in a few places because of differences between how C and Swift count significand bits and normalize the significand, but this is expected to have minimal impact on code in practice (and when it does have impact, using the Swift definition is generally simpler).
* Address review notes from @moiseev.
This fixes <rdar://problem/27871465>
Now that square root is being propoerly inlined and optimized away, it
is safe to deprecate these two constants in favor of a Swiftier API.
Fixes: <rdar://problem/30003973>
* Go back to using static inline implementations of sqrt and remainder now that SR-2089 is resolved.
* Fix typo: sqrt -> squareRoot.
* Added test for constant-folding sqrt with -O.
* Added test case requested by jrose.