Skip to content

[HLSL] Integer conversion overload scoring #91075

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

Closed
Tracked by #67692
llvm-beanz opened this issue May 4, 2024 · 1 comment · Fixed by #96011
Closed
Tracked by #67692

[HLSL] Integer conversion overload scoring #91075

llvm-beanz opened this issue May 4, 2024 · 1 comment · Fixed by #96011
Assignees
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" HLSL HLSL Language Support

Comments

@llvm-beanz
Copy link
Collaborator

llvm-beanz commented May 4, 2024

Because of C/C++ usual arithmetic conversions, C++ overload resolution doesn't handle some cases that HLSL needs to handle for 16-bit types.

The following code is ambiguous to resolve based on currently implemented overload rules:

void Fn4(int64_t L);
void Fn4(int I);

void Call4(int16_t H) { Fn4(H); }

A similar example is here

Per HLSL rules the conversion should prefer the next smallest integer type (int) when promoting 16-bit values.

Depends on microsoft/hlsl-specs#232.

Acceptance Criteria

  • Tests verifying correct overload resolution of the case described above.
@llvm-beanz llvm-beanz converted this from a draft issue May 4, 2024
@llvm-beanz llvm-beanz added the HLSL HLSL Language Support label May 4, 2024
@llvm-beanz llvm-beanz self-assigned this May 6, 2024
@llvm-beanz llvm-beanz linked a pull request Jun 19, 2024 that will close this issue
@llvm-beanz llvm-beanz moved this to Active in HLSL Support Jun 20, 2024
@github-project-automation github-project-automation bot moved this from Active to Done in HLSL Support Jul 13, 2024
@EugeneZelenko EugeneZelenko added the clang:frontend Language frontend issues, e.g. anything involving "Sema" label Jul 13, 2024
@llvmbot
Copy link
Member

llvmbot commented Jul 13, 2024

@llvm/issue-subscribers-clang-frontend

Author: Chris B (llvm-beanz)

Because of C/C++ usual arithmetic conversions, C++ overload resolution doesn't handle some cases that HLSL needs to handle for 16-bit types.

The following code is ambiguous to resolve based on currently implemented overload rules:

void Fn4(int64_t L);
void Fn4(int I);

void Call4(int16_t H) { Fn4(H); }

A similar example is here

Per HLSL rules the conversion should prefer the next smallest integer type (int) when promoting 16-bit values.

Depends on microsoft/hlsl-specs#232.

Acceptance Criteria

  • Tests verifying correct overload resolution of the case described above.

@damyanp damyanp moved this to Closed in HLSL Support Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" HLSL HLSL Language Support
Projects
Status: Closed
Development

Successfully merging a pull request may close this issue.

3 participants