This is an archive of the discontinued LLVM Phabricator instance.

[HLSL] Add reversebits library function
ClosedPublic

Authored by bob80905 on Aug 2 2023, 12:30 PM.

Details

Summary

This change exposes the reversebits library function for HLSL, excluding floating point types.
The reversebits function is supported for all scalar, vector, and matrix types.

The full documentation of the HLSL reversebits function is available here:
https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/reversebits

Diff Detail

Event Timeline

bob80905 created this revision.Aug 2 2023, 12:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2023, 12:30 PM
Herald added a subscriber: Anastasia. · View Herald Transcript
bob80905 requested review of this revision.Aug 2 2023, 12:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2023, 12:30 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
bob80905 updated this revision to Diff 546576.Aug 2 2023, 12:31 PM
  • change builtin name to reversebits
bob80905 retitled this revision from [HLSL] Add bitreverse library function to [HLSL] Add reversebits library function.Aug 2 2023, 12:34 PM
bob80905 edited the summary of this revision. (Show Details)
bob80905 edited the summary of this revision. (Show Details)
bob80905 edited the summary of this revision. (Show Details)
python3kgae added inline comments.Aug 2 2023, 12:43 PM
clang/test/CodeGenHLSL/builtins/bitreverse.hlsl
33

Not NO_HALF, it is integer :).

And __HLSL_ENABLE_16_BIT only defined once.
Maybe just one RUN line is enough.

bob80905 updated this revision to Diff 546585.Aug 2 2023, 1:21 PM
  • rename file, make merge 2 Runs into 1 with enable16bit defined
python3kgae accepted this revision.Aug 2 2023, 2:15 PM

Don't need -fnative-half-type in the RUN line.

This revision is now accepted and ready to land.Aug 2 2023, 2:15 PM
bob80905 updated this revision to Diff 546618.Aug 2 2023, 2:42 PM
  • remove fnative half type from run line
This revision was landed with ongoing or failed builds.Aug 2 2023, 8:51 PM
This revision was automatically updated to reflect the committed changes.