Skip to content
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

clang-cl should provide implementations of more MSVC ARM64 intrinsics #65405

Open
rnk opened this issue Sep 5, 2023 · 4 comments
Open

clang-cl should provide implementations of more MSVC ARM64 intrinsics #65405

rnk opened this issue Sep 5, 2023 · 4 comments
Assignees
Labels
clang-cl `clang-cl` driver. Don't use for other compiler parts platform:windows

Comments

@rnk
Copy link
Collaborator

rnk commented Sep 5, 2023

Some users have noticed that clang-cl does not provide some of the intrinsics listed in the MSVC ARM64 intrinsic list. In particular, the _Count* and _Copy* intrinsics seem worth implementing, like _CopyFloatFromInt32 and _CountLeadingZeros. See reference from the FP16 project here.

cc @amykhuang @pzhengqc

@rnk rnk added platform:windows clang-cl `clang-cl` driver. Don't use for other compiler parts labels Sep 5, 2023
@compnerd
Copy link
Member

compnerd commented Sep 6, 2023

@EugeneZelenko I assume that the windows label removal was accidental (if not please re-remove and leave a note as to why the MSVC behaviours are not really windows-y).

@EugeneZelenko
Copy link
Contributor

@compnerd: Isn't clang-cl Windows-only thing?

@compnerd
Copy link
Member

compnerd commented Sep 6, 2023

@EugeneZelenko yes, it is a windows thing, but can be used on other platforms. But that seems to indicate that it is supposed to be marked as windows (I was restoring the tag).

@amykhuang amykhuang self-assigned this Sep 7, 2023
@davidbienvenu
Copy link

Another intrinsic that would be helpful is __prefetch.

amykhuang added a commit that referenced this issue Sep 21, 2023
Implement the _Count* and _Copy* Windows ARM intrinsics:

```
double _CopyDoubleFromInt64(__int64)
float _CopyFloatFromInt32(__int32)
__int32 _CopyInt32FromFloat(float)
__int64 _CopyInt64FromDouble(double)
unsigned int _CountLeadingOnes(unsigned long)
unsigned int _CountLeadingOnes64(unsigned __int64)
unsigned int _CountLeadingSigns(long)
unsigned int _CountLeadingSigns64(__int64)
unsigned int _CountLeadingZeros(unsigned long)
unsigned int _CountLeadingZeros64(unsigned __int64)
unsigned int _CountOneBits(unsigned long)
unsigned int _CountOneBits64(unsigned __int64)
```

Full list of intrinsics here:
[https://learn.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics](https://learn.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics)

Bug: [65405](#65405)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang-cl `clang-cl` driver. Don't use for other compiler parts platform:windows
Projects
None yet
Development

No branches or pull requests

5 participants