[clang] [HLSL][clang] Add elementwise builtin for atan2 (p3) (PR #110187)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 30 10:20:01 PDT 2024


================
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify -DTEST_FUNC=__builtin_elementwise_atan2
+// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify -DTEST_FUNC=__builtin_elementwise_pow
+
+double2 test_double_builtin(double2 p0, double2 p1) {
----------------
farzonl wrote:

```suggestion
double test_double_builtin(double p0, double p1) {
  return TEST_FUNC(p0, p1);
  // expected-error at -1 {{passing 'double' to parameter of incompatible type 'float'}}
}

double2 test_vec_double_builtin(double2 p0, double2 p1) {
```

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


More information about the cfe-commits mailing list