[clang] [llvm] [HLSL] implement `mad` intrinsic (PR #83826)

S. Bharadwaj Yadavalli via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 4 08:54:08 PST 2024


================
@@ -0,0 +1,67 @@
+; RUN: opt -S -dxil-op-lower < %s | FileCheck %s
+
+; Make sure dxil operation function calls for round are generated for float and half.
+; CHECK:call half @dx.op.tertiary.f16(i32 46, half %{{.*}}, half %{{.*}}, half %{{.*}})
+; CHECK:call float @dx.op.tertiary.f32(i32 46, float %{{.*}}, float %{{.*}}, float %{{.*}})
+; CHECK:call double @dx.op.tertiary.f64(i32 46, double %{{.*}}, double %{{.*}}, double %{{.*}})
+
+
+target datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64"
+target triple = "dxil-pc-shadermodel6.7-library"
+
+; Function Attrs: noinline nounwind optnone
+define noundef half @"?test_mad_half@@YA$f16@$f16 at 00@Z"(half noundef %p0, half noundef %p1, half noundef %p2) #0 {
----------------
bharadwajy wrote:

Consider using unmangled names for function names in this as well as other test sources of this PR.

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


More information about the cfe-commits mailing list