[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 30 10:31:29 PDT 2024


================
@@ -37,13 +39,12 @@ define noundef i32 @firstbituhigh_i64(i64 noundef %a) {
 entry:
 ; CHECK: [[O:%.*]] = OpBitcast %[[#]] %[[#]]
 ; CHECK: [[N:%.*]] = OpExtInst %[[#]] %[[#]] FindUMsb [[O]]
-; CHECK: [[M:%.*]] = OpVectorShuffle %[[#]] [[N]] [[N]] 0
-; CHECK: [[L:%.*]] = OpVectorShuffle %[[#]] [[N]] [[N]] 1
+; CHECK: [[M:%.*]] = OpVectorExtractDynamic %[[#]] [[N]] [[Z]]
+; CHECK: [[L:%.*]] = OpVectorExtractDynamic %[[#]] [[N]] [[X]]
----------------
farzonl wrote:

This looks right. Could you document the reason for the `OpVectorShuffle` ti `OpVectorExtractDynamic`. As a response to this comment.

https://github.com/llvm/llvm-project/pull/111082


More information about the cfe-commits mailing list