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

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 4 10:38:45 PDT 2024


================
@@ -0,0 +1,91 @@
+; RUN: opt -S -scalarizer -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
+
+; Make sure dxil operation function calls for firstbithigh are generated for all integer types.
+
+define noundef i16 @test_firstbithigh_ushort(i16 noundef %a) {
+entry:
+; CHECK: call i16 @dx.op.unary.i16(i32 33, i16 %{{.*}})
----------------
farzonl wrote:

In DXC the call return value is always i32. I don't know if this would pass the verifier and if it did, I don't know that it would run correctly in the DirectX runtime. 

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


More information about the cfe-commits mailing list