[clang] [HLSL] Adds matrix support for isnan() and isinf(). (PR #195586)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 22 12:53:39 PDT 2026


================
@@ -222,16 +222,17 @@ int4 AddIntMatrixConstant(int4x4 M) {
 // CHECK-NEXT:    store i32 [[INDEX]], ptr [[INDEX_ADDR]], align 4
 // CHECK-NEXT:    [[TMP1:%.*]] = load i32, ptr [[INDEX_ADDR]], align 4
 // CHECK-NEXT:    [[TMP2:%.*]] = load <6 x i32>, ptr [[M_ADDR]], align 4
+// CHECK-NEXT:    [[TRUNC:%.*]] = trunc <6 x i32> [[TMP2]] to <6 x i1>
 // CHECK-NEXT:    [[TMP3:%.*]] = add i32 0, [[TMP1]]
-// CHECK-NEXT:    [[MATRIX_ELEM:%.*]] = extractelement <6 x i32> [[TMP2]], i32 [[TMP3]]
-// CHECK-NEXT:    [[MATRIX_ROW_INS:%.*]] = insertelement <3 x i32> poison, i32 [[MATRIX_ELEM]], i32 0
+// CHECK-NEXT:    [[MATRIX_ELEM:%.*]] = extractelement <6 x i1> [[TRUNC]], i32 [[TMP3]]
+// CHECK-NEXT:    [[MATRIX_ROW_INS:%.*]] = insertelement <3 x i1> poison, i1 [[MATRIX_ELEM]], i32 0
----------------
farzonl wrote:

This is not correct in HLSL bools are i32 not i1.

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


More information about the cfe-commits mailing list