Skip to content

Commit 6c7c32a

Browse files
committed
---
yaml --- r: 347407 b: refs/heads/master c: b9b809c h: refs/heads/master i: 347405: 61c2cbe 347403: 5f522aa 347399: 2ca8ec1 347391: 15a21f2
1 parent f5f6139 commit 6c7c32a

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: b63e32aec648b30d2337c41599fc70aa4680cc5a
2+
refs/heads/master: b9b809c14e0e51f0044dc462823551c9039bb0f7
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/stdlib/public/core/FloatingPoint.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ public protocol FloatingPoint : SignedNumeric, Strideable, Hashable
230230
/// the initializer has the same magnitude as `magnitudeOf`.
231231
init(signOf: Self, magnitudeOf: Self)
232232

233-
234233
/// Creates a new value, rounded to the closest possible representation.
235234
///
236235
/// If two representable values are equally close, the result is the value

trunk/stdlib/public/core/FloatingPointTypes.swift.gyb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,15 @@ extension ${Self}: BinaryFloatingPoint {
973973
%end
974974
}
975975

976+
// For core standard library floating-point types, LLVM can lower copysign
977+
// for us; this gets somewhat better codegen than the generic implementation,
978+
// but more importantly allows it to participate in other optimizations
979+
// at the LLVM level.
980+
@_transparent
981+
public init(signOf sign: ${Self}, magnitudeOf mag: ${Self}) {
982+
_value = Builtin.int_copysign_FPIEEE${bits}(mag._value, sign._value)
983+
}
984+
976985
/// Rounds the value to an integral value using the specified rounding rule.
977986
///
978987
/// The following example rounds a value using four different rounding rules:

0 commit comments

Comments
 (0)