-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[stdlib][Part 1] De-gyb almost everything #21149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5469cd2
de-gyb builtinmath
Azoy eb8bd16
de-gyb codable
Azoy 4867255
de-gyb existentialcollection
Azoy 73250ad
de-gyb mirrors
Azoy 3f5c716
de-gyb runtime
Azoy 0c4aa60
de-gyb unavailablestringapis
Azoy eebf882
post de-gyb formatting
Azoy e3a4401
Reorder conformances in cake test
Azoy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
//===--- BuiltinMath.swift --------------------------------*- swift -*-===// | ||
// | ||
// This source file is part of the Swift.org open source project | ||
// | ||
// Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors | ||
// Licensed under Apache License v2.0 with Runtime Library Exception | ||
// | ||
// See https://swift.org/LICENSE.txt for license information | ||
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// Each of the following functions is ordered to match math.h | ||
|
||
// These functions have a corresponding LLVM intrinsic. | ||
// Note, keep this up to date with Darwin/tgmath.swift.gyb | ||
|
||
// Order of intrinsics: cos, sin, exp, exp2, log, log10, log2, nearbyint, rint | ||
|
||
// Float Intrinsics (32 bits) | ||
|
||
@_transparent | ||
public func _cos(_ x: Float) -> Float { | ||
return Float(Builtin.int_cos_FPIEEE32(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _sin(_ x: Float) -> Float { | ||
return Float(Builtin.int_sin_FPIEEE32(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _exp(_ x: Float) -> Float { | ||
return Float(Builtin.int_exp_FPIEEE32(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _exp2(_ x: Float) -> Float { | ||
return Float(Builtin.int_exp2_FPIEEE32(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _log(_ x: Float) -> Float { | ||
return Float(Builtin.int_log_FPIEEE32(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _log10(_ x: Float) -> Float { | ||
return Float(Builtin.int_log10_FPIEEE32(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _log2(_ x: Float) -> Float { | ||
return Float(Builtin.int_log2_FPIEEE32(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _nearbyint(_ x: Float) -> Float { | ||
return Float(Builtin.int_nearbyint_FPIEEE32(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _rint(_ x: Float) -> Float { | ||
return Float(Builtin.int_rint_FPIEEE32(x._value)) | ||
} | ||
|
||
// Double Intrinsics (64 bits) | ||
|
||
@_transparent | ||
public func _cos(_ x: Double) -> Double { | ||
return Double(Builtin.int_cos_FPIEEE64(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _sin(_ x: Double) -> Double { | ||
return Double(Builtin.int_sin_FPIEEE64(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _exp(_ x: Double) -> Double { | ||
return Double(Builtin.int_exp_FPIEEE64(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _exp2(_ x: Double) -> Double { | ||
return Double(Builtin.int_exp2_FPIEEE64(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _log(_ x: Double) -> Double { | ||
return Double(Builtin.int_log_FPIEEE64(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _log10(_ x: Double) -> Double { | ||
return Double(Builtin.int_log10_FPIEEE64(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _log2(_ x: Double) -> Double { | ||
return Double(Builtin.int_log2_FPIEEE64(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _nearbyint(_ x: Double) -> Double { | ||
return Double(Builtin.int_nearbyint_FPIEEE64(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _rint(_ x: Double) -> Double { | ||
return Double(Builtin.int_rint_FPIEEE64(x._value)) | ||
} | ||
|
||
// Float80 Intrinsics (80 bits) | ||
|
||
#if !(os(Windows) || os(Android)) && (arch(i386) || arch(x86_64)) | ||
@_transparent | ||
public func _cos(_ x: Float80) -> Float80 { | ||
return Float80(Builtin.int_cos_FPIEEE80(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _sin(_ x: Float80) -> Float80 { | ||
return Float80(Builtin.int_sin_FPIEEE80(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _exp(_ x: Float80) -> Float80 { | ||
return Float80(Builtin.int_exp_FPIEEE80(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _exp2(_ x: Float80) -> Float80 { | ||
return Float80(Builtin.int_exp2_FPIEEE80(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _log(_ x: Float80) -> Float80 { | ||
return Float80(Builtin.int_log_FPIEEE80(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _log10(_ x: Float80) -> Float80 { | ||
return Float80(Builtin.int_log10_FPIEEE80(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _log2(_ x: Float80) -> Float80 { | ||
return Float80(Builtin.int_log2_FPIEEE80(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _nearbyint(_ x: Float80) -> Float80 { | ||
return Float80(Builtin.int_nearbyint_FPIEEE80(x._value)) | ||
} | ||
|
||
@_transparent | ||
public func _rint(_ x: Float80) -> Float80 { | ||
return Float80(Builtin.int_rint_FPIEEE80(x._value)) | ||
} | ||
#endif |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't fix the test failure, but you could move ExistentialCollection.swift to the SWIFTLIB_SOURCES list (at line 210) if it isn't an "essential" source; and also change the copyright year of CMakeLists.txt (from 2018 to 2019).