-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[TLI] Add basic support for nextafter/nexttoward libcalls #166250
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -388,6 +388,10 @@ static void initializeLibCalls(TargetLibraryInfoImpl &TLI, const Triple &T, | |
| TLI.setAvailableWithName(LibFunc_logbf, "_logbf"); | ||
| else | ||
| TLI.setUnavailable(LibFunc_logbf); | ||
| TLI.setUnavailable(LibFunc_nextafter); | ||
| TLI.setUnavailable(LibFunc_nextafterf); | ||
| TLI.setUnavailable(LibFunc_nexttoward); | ||
| TLI.setUnavailable(LibFunc_nexttowardf); | ||
| TLI.setUnavailable(LibFunc_rint); | ||
| TLI.setUnavailable(LibFunc_rintf); | ||
| TLI.setUnavailable(LibFunc_round); | ||
|
|
@@ -418,6 +422,8 @@ static void initializeLibCalls(TargetLibraryInfoImpl &TLI, const Triple &T, | |
| TLI.setUnavailable(LibFunc_logbl); | ||
| TLI.setUnavailable(LibFunc_ilogbl); | ||
| TLI.setUnavailable(LibFunc_nearbyintl); | ||
| TLI.setUnavailable(LibFunc_nextafterl); | ||
| TLI.setUnavailable(LibFunc_nexttowardl); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was bit confused by the comment: as I believe this documentation implies long double support for many C99 functions goes back as early as MSVC 140. I haven't actually tried it myself though and might be misunderstanding something, so I'll just follow the pattern for now.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This quote in the documentation linked in the code comments seems interesting:
It's unfortunate that paragraph isn't more specific about the MSVC version, it's probably not worth worrying in this PR in any case. |
||
| TLI.setUnavailable(LibFunc_rintl); | ||
| TLI.setUnavailable(LibFunc_roundl); | ||
| TLI.setUnavailable(LibFunc_scalblnl); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,7 @@ | |
| # | ||
| # CHECK: << Total TLI yes SDK no: 18 | ||
| # CHECK: >> Total TLI no SDK yes: 0 | ||
| # CHECK: == Total TLI yes SDK yes: 271 | ||
| # CHECK: == Total TLI yes SDK yes: 277 | ||
| # | ||
| # WRONG_DETAIL: << TLI yes SDK no : '_ZdaPv' aka operator delete[](void*) | ||
| # WRONG_DETAIL: >> TLI no SDK yes: '_ZdaPvj' aka operator delete[](void*, unsigned int) | ||
|
|
@@ -48,14 +48,14 @@ | |
| # WRONG_DETAIL: << TLI yes SDK no : 'fminimum_numl' | ||
| # WRONG_SUMMARY: << Total TLI yes SDK no: 19{{$}} | ||
| # WRONG_SUMMARY: >> Total TLI no SDK yes: 1{{$}} | ||
| # WRONG_SUMMARY: == Total TLI yes SDK yes: 270 | ||
| # WRONG_SUMMARY: == Total TLI yes SDK yes: 276 | ||
| # | ||
| ## The -COUNT suffix doesn't care if there are too many matches, so check | ||
| ## the exact count first; the two directives should add up to that. | ||
| ## Yes, this means additions to TLI will fail this test, but the argument | ||
| ## to -COUNT can't be an expression. | ||
| # AVAIL: TLI knows 524 symbols, 289 available | ||
| # AVAIL-COUNT-289: {{^}} available | ||
| # AVAIL: TLI knows 530 symbols, 295 available | ||
| # AVAIL-COUNT-295: {{^}} available | ||
| # AVAIL-NOT: {{^}} available | ||
| # UNAVAIL-COUNT-235: not available | ||
| # UNAVAIL-NOT: not available | ||
|
|
@@ -778,6 +778,30 @@ DynamicSymbols: | |
| Type: STT_FUNC | ||
| Section: .text | ||
| Binding: STB_GLOBAL | ||
| - Name: nextafter | ||
| Type: STT_FUNC | ||
| Section: .text | ||
| Binding: STB_GLOBAL | ||
| - Name: nextafterf | ||
| Type: STT_FUNC | ||
| Section: .text | ||
| Binding: STB_GLOBAL | ||
| - Name: nextafterl | ||
| Type: STT_FUNC | ||
| Section: .text | ||
| Binding: STB_GLOBAL | ||
| - Name: nexttoward | ||
| Type: STT_FUNC | ||
| Section: .text | ||
| Binding: STB_GLOBAL | ||
| - Name: nexttowardf | ||
| Type: STT_FUNC | ||
| Section: .text | ||
| Binding: STB_GLOBAL | ||
| - Name: nexttowardl | ||
| Type: STT_FUNC | ||
| Section: .text | ||
| Binding: STB_GLOBAL | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see that other similar patches added entries here, but I wasn't sure where to find authoritative documentation on what math functions are supported for PS4. Is there some obvious documentation I'm missing? The closest I was able to find is this wiki, which doesn't seem the most authoritative. |
||
| - Name: perror | ||
| Type: STT_FUNC | ||
| Section: .text | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.