[clang] [clang][HLSL] Add sign intrinsic part 4 (PR #108396)

Joshua Batista via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 16 10:24:11 PDT 2024


================
@@ -155,3 +197,24 @@ int3 test_sign_int64_t3(int64_t3 p0) { return sign(p0); }
 // CHECK: %hlsl.sign = call <4 x i32> @llvm.[[TARGET]].sign.v4i64(
 // CHECK: ret <4 x i32> %hlsl.sign
 int4 test_sign_int64_t4(int64_t4 p0) { return sign(p0); }
+
+
+// CHECK: define [[FNATTRS]] i32 @
+// CHECK: [[CMP:%.*]] = icmp eq i64 [[ARG:%.*]], 0
+// CHECK: %hlsl.sign = select i1 [[CMP]], i32 0, i32 1
+int test_sign_int64_t(uint64_t p0) { return sign(p0); }
----------------
bob80905 wrote:

The function names are missing a 'u'

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


More information about the cfe-commits mailing list