Skip to content

[HLSL] Add bool compatibility overloads #92941

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

Open
llvm-beanz opened this issue May 21, 2024 · 1 comment
Open

[HLSL] Add bool compatibility overloads #92941

llvm-beanz opened this issue May 21, 2024 · 1 comment
Assignees
Labels
HLSL HLSL Language Support

Comments

@llvm-beanz
Copy link
Collaborator

We have two options to consider here:

  1. Observe C rules
    -or-
  2. Adopt new HLSL rules as proposed in [Overload.Res] Add overload resolution sections microsoft/hlsl-specs#244

Option 1: C Rules

If we choose Option 1, this task is to add bool overloads for intrinsic where it makes sense to call them with bool values, and properly codegen those as if bool was converted to `int.

Option 2: New HLSL Rules

The spec PR posted above suggests treating bool effectively as lower than the lowest rank of integer type. A slight variation is that we could treat it as promotable to int.

@llvm-beanz llvm-beanz self-assigned this May 21, 2024
@llvm-beanz llvm-beanz converted this from a draft issue May 21, 2024
@llvm-beanz llvm-beanz added the HLSL HLSL Language Support label May 21, 2024
@llvm-beanz llvm-beanz linked a pull request Jun 19, 2024 that will close this issue
@llvm-beanz
Copy link
Collaborator Author

For this change we've decided to follow C rules, so the next step here will be to audit the existing functions in HLSL.h and add appropriate boolean overloads for methods.

@damyanp damyanp moved this to Ready in HLSL Support Oct 9, 2024
@llvm-beanz llvm-beanz changed the title [HLSL] Boolean conversion overload scoring [HLSL] Add bool compatibility overloads Feb 21, 2025
@llvm-beanz llvm-beanz moved this from Ready to Planning in HLSL Support Feb 21, 2025
@llvm-beanz llvm-beanz moved this from Planning to Ready in HLSL Support Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HLSL HLSL Language Support
Projects
Status: Ready
Development

No branches or pull requests

1 participant