https://github.com/llvm-beanz closed
https://github.com/llvm/llvm-project/pull/81190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/81190
>From f6188a3308188aa3037b05f685a6065bfc2d69fa Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 8 Feb 2024 11:08:59 -0500
Subject: [PATCH 1/6] [HLSL] Implementation of dot intrinsic This change
implements
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/81190
>From f6188a3308188aa3037b05f685a6065bfc2d69fa Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 8 Feb 2024 11:08:59 -0500
Subject: [PATCH 1/6] [HLSL] Implementation of dot intrinsic This change
implements
@@ -17959,6 +17964,54 @@ llvm::Value
*CodeGenFunction::EmitScalarOrConstFoldImmArg(unsigned ICEArguments,
return Arg;
}
+Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID,
+const CallExpr *E) {
+ if (!getLangOpts().H
@@ -17959,6 +17964,54 @@ llvm::Value
*CodeGenFunction::EmitScalarOrConstFoldImmArg(unsigned ICEArguments,
return Arg;
}
+Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID,
+const CallExpr *E) {
+ if (!getLangOpts().H
@@ -0,0 +1,110 @@
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm
-disable-llvm-passes -verify -verify-ignore-unexpected
+
+float test_no_second_arg ( float2 p0) {
+ return __builtin_hlsl_dot ( p0 );
+ // exp
@@ -17959,6 +17964,54 @@ llvm::Value
*CodeGenFunction::EmitScalarOrConstFoldImmArg(unsigned ICEArguments,
return Arg;
}
+Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID,
+const CallExpr *E) {
+ if (!getLangOpts().H
https://github.com/llvm-beanz approved this pull request.
A few small notes, but otherwise looks good.
https://github.com/llvm/llvm-project/pull/81190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listin
@@ -0,0 +1,110 @@
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm
-disable-llvm-passes -verify -verify-ignore-unexpected
+
+float test_no_second_arg ( float2 p0) {
+ return __builtin_hlsl_dot ( p0 );
+ // exp
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/81190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/81190
>From f6188a3308188aa3037b05f685a6065bfc2d69fa Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 8 Feb 2024 11:08:59 -0500
Subject: [PATCH 1/5] [HLSL] Implementation of dot intrinsic This change
implements
@@ -5161,6 +5166,157 @@ bool Sema::CheckPPCMMAType(QualType Type,
SourceLocation TypeLoc) {
return false;
}
+// Helper function for CheckHLSLBuiltinFunctionCall
+// Note: UsualArithmeticConversions handles the case where at least
+// one arg isn't a bool
+bool PromoteBoolsT
@@ -5161,6 +5166,157 @@ bool Sema::CheckPPCMMAType(QualType Type,
SourceLocation TypeLoc) {
return false;
}
+// Helper function for CheckHLSLBuiltinFunctionCall
+// Note: UsualArithmeticConversions handles the case where at least
+// one arg isn't a bool
+bool PromoteBoolsT
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/81190
>From fad7e6eac6a1a65ce00ab3e4f64d5774b426c91d Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 8 Feb 2024 11:08:59 -0500
Subject: [PATCH 1/4] [HLSL] Implementation of dot intrinsic This change
implements
@@ -17959,6 +17964,52 @@ llvm::Value
*CodeGenFunction::EmitScalarOrConstFoldImmArg(unsigned ICEArguments,
return Arg;
}
+Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID,
+const CallExpr *E) {
+ if (!getLangOpts().H
@@ -2961,6 +2962,10 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl,
unsigned BuiltinID,
}
}
+ if (getLangOpts().HLSL && CheckHLSLBuiltinFunctionCall(BuiltinID, TheCall)) {
+return ExprError();
+ }
llvm-beanz wrote:
nit: unnecessary braces.
@@ -5161,6 +5166,157 @@ bool Sema::CheckPPCMMAType(QualType Type,
SourceLocation TypeLoc) {
return false;
}
+// Helper function for CheckHLSLBuiltinFunctionCall
+// Note: UsualArithmeticConversions handles the case where at least
+// one arg isn't a bool
+bool PromoteBoolsT
@@ -19594,23 +19750,45 @@ bool
Sema::PrepareBuiltinElementwiseMathOneArgCall(CallExpr *TheCall) {
TheCall->setArg(0, A.get());
QualType TyA = A.get()->getType();
- if (checkMathBuiltinElementType(*this, A.get()->getBeginLoc(), TyA))
+ if (checkMathBuiltinElementType(*th
@@ -19594,23 +19750,45 @@ bool
Sema::PrepareBuiltinElementwiseMathOneArgCall(CallExpr *TheCall) {
TheCall->setArg(0, A.get());
QualType TyA = A.get()->getType();
- if (checkMathBuiltinElementType(*this, A.get()->getBeginLoc(), TyA))
+ if (checkMathBuiltinElementType(*th
@@ -19594,23 +19750,45 @@ bool
Sema::PrepareBuiltinElementwiseMathOneArgCall(CallExpr *TheCall) {
TheCall->setArg(0, A.get());
QualType TyA = A.get()->getType();
- if (checkMathBuiltinElementType(*this, A.get()->getBeginLoc(), TyA))
+ if (checkMathBuiltinElementType(*th
@@ -179,6 +179,98 @@ double3 cos(double3);
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_cos)
double4 cos(double4);
+//===--===//
+// dot product builtins
+//===
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/81190
>From fad7e6eac6a1a65ce00ab3e4f64d5774b426c91d Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 8 Feb 2024 11:08:59 -0500
Subject: [PATCH 1/4] [HLSL] Implementation of dot intrinsic This change
implements
https://github.com/farzonl ready_for_review
https://github.com/llvm/llvm-project/pull/81190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/81190
>From fad7e6eac6a1a65ce00ab3e4f64d5774b426c91d Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 8 Feb 2024 11:08:59 -0500
Subject: [PATCH 1/3] [HLSL] Implementation of dot intrinsic This change
implements
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/81190
>From fad7e6eac6a1a65ce00ab3e4f64d5774b426c91d Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 8 Feb 2024 11:08:59 -0500
Subject: [PATCH 1/3] [HLSL] Implementation of dot intrinsic This change
implements
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/81190
>From fad7e6eac6a1a65ce00ab3e4f64d5774b426c91d Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 8 Feb 2024 11:08:59 -0500
Subject: [PATCH 1/3] [HLSL] Implementation of dot intrinsic This change
implements
https://github.com/farzonl deleted
https://github.com/llvm/llvm-project/pull/81190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/81190
>From fad7e6eac6a1a65ce00ab3e4f64d5774b426c91d Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 8 Feb 2024 11:08:59 -0500
Subject: [PATCH 1/3] [HLSL] Implementation of dot intrinsic This change
implements
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/81190
>From fad7e6eac6a1a65ce00ab3e4f64d5774b426c91d Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 8 Feb 2024 11:08:59 -0500
Subject: [PATCH 1/3] [HLSL] Implementation of dot intrinsic This change
implements
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/81190
>From 595ce41f71bd9e0f83679bd5c742b3015bf30626 Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 8 Feb 2024 11:08:59 -0500
Subject: [PATCH 1/2] [HLSL] Implementation of dot intrinsic This change
implements
https://github.com/farzonl converted_to_draft
https://github.com/llvm/llvm-project/pull/81190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/81190
>From 595ce41f71bd9e0f83679bd5c742b3015bf30626 Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 8 Feb 2024 11:08:59 -0500
Subject: [PATCH 1/2] [HLSL] Implementation of dot intrinsic This change
implements
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/81190
>From 586ee65c5e820365a6fd150d7f246fbfa679ec3e Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 8 Feb 2024 11:08:59 -0500
Subject: [PATCH] [HLSL] Implementation of dot intrinsic This change implements
#700
https://github.com/python3kgae approved this pull request.
https://github.com/llvm/llvm-project/pull/81190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/81190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvmbot wrote:
@llvm/pr-subscribers-hlsl
@llvm/pr-subscribers-clang
Author: Farzon Lotfi (farzonl)
Changes
This change implements https://github.com/llvm/llvm-project/issues/70073
HLSL has a dot intrinsic defined here:
https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphi
llvmbot wrote:
@llvm/pr-subscribers-backend-x86
Author: Farzon Lotfi (farzonl)
Changes
This change implements https://github.com/llvm/llvm-project/issues/70073
HLSL has a dot intrinsic defined here:
https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-dot
The int
https://github.com/farzonl ready_for_review
https://github.com/llvm/llvm-project/pull/81190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/dmpots approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/81190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/81190
>From bebb3ad19cc1793090265e68b25c282f90b35227 Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 8 Feb 2024 11:08:59 -0500
Subject: [PATCH] [HLSL] Implementation of dot intrinsic This change implements
#700
@@ -19,4 +19,9 @@ def int_dx_flattened_thread_id_in_group :
Intrinsic<[llvm_i32_ty], [], [IntrNoMe
def int_dx_create_handle : ClangBuiltin<"__builtin_hlsl_create_handle">,
Intrinsic<[ llvm_ptr_ty ], [llvm_i8_ty], [IntrWillReturn]>;
-}
+
+def int_dx_dot :
+Intrinsic<[
https://github.com/farzonl deleted
https://github.com/llvm/llvm-project/pull/81190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -144,6 +144,92 @@ double3 cos(double3);
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_cos)
double4 cos(double4);
+//===--===//
+// dot product builtins
+//===
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/81190
>From f6dbbfbf6b8aa221035e39735c5c6e2d0936219c Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 8 Feb 2024 11:08:59 -0500
Subject: [PATCH] [HLSL] Implementation of dot intrinsic This change implements
#700
@@ -144,6 +144,92 @@ double3 cos(double3);
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_cos)
double4 cos(double4);
+//===--===//
+// dot product builtins
+//===
@@ -0,0 +1,202 @@
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
+// RUN: -emit-llvm -disable-llvm-passes -O3 -o - | FileCheck %s
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-h
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
+// RUN: -emit-llvm -disable-llvm-passes -verify -verify-ignore-unexpected
+
+float test_first_arg_is_not_vector ( floa
@@ -0,0 +1,202 @@
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
+// RUN: -emit-llvm -disable-llvm-passes -O3 -o - | FileCheck %s
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-h
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/81190
>From 2baaf5b41d80639fa7dfe739ad5501d2f5359bfa Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 8 Feb 2024 11:08:59 -0500
Subject: [PATCH] [HLSL] Implementation of dot intrinsic This change implements
#700
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff 4bf50e02554460df86903791380fb5ca17a28bdc
23c277da327c595633d159c13bc710f413024cb2 --
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/81190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/81190
>From 23c277da327c595633d159c13bc710f413024cb2 Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 8 Feb 2024 11:08:59 -0500
Subject: [PATCH] [HLSL] Implementation of dot intrinsic This change implements
#700
@@ -0,0 +1,202 @@
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
+// RUN: -emit-llvm -disable-llvm-passes -O3 -o - | FileCheck %s
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-h
@@ -0,0 +1,202 @@
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
+// RUN: -emit-llvm -disable-llvm-passes -O3 -o - | FileCheck %s
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-h
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
+// RUN: -emit-llvm -disable-llvm-passes -verify -verify-ignore-unexpected
+
+float test_first_arg_is_not_vector ( floa
@@ -144,6 +144,92 @@ double3 cos(double3);
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_cos)
double4 cos(double4);
+//===--===//
+// dot product builtins
+//===
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
+// RUN: -emit-llvm -disable-llvm-passes -verify -verify-ignore-unexpected
+
+float test_first_arg_is_not_vector ( floa
@@ -0,0 +1,202 @@
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
+// RUN: -emit-llvm -disable-llvm-passes -O3 -o - | FileCheck %s
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-h
@@ -144,6 +144,92 @@ double3 cos(double3);
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_cos)
double4 cos(double4);
+//===--===//
+// dot product builtins
+//===
@@ -4518,6 +4518,12 @@ def HLSLCreateHandle : LangBuiltin<"HLSL_LANG"> {
let Prototype = "void*(unsigned char)";
}
+def HLSLDotProduct : LangBuiltin<"HLSL_LANG"> {
+ let Spellings = ["__builtin_hlsl_dot"];
+ let Attributes = [NoThrow, Const, CustomTypeChecking];
--
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/81190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/81190
>From 73cc9fde36a44ba1715a3c9fc6d48196602d5dc4 Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 8 Feb 2024 11:08:59 -0500
Subject: [PATCH] [HLSL] Implementation of dot intrinsic This change implements
#700
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/81190
>From 4103940b5a2578efc08df554ccdf80cb34925d09 Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 8 Feb 2024 11:08:59 -0500
Subject: [PATCH] [HLSL] Implementation of dot intrinsic This change implements
#700
@@ -144,6 +144,92 @@ double3 cos(double3);
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_cos)
double4 cos(double4);
+//===--===//
+// dot product builtins
+//===
@@ -19,4 +19,9 @@ def int_dx_flattened_thread_id_in_group :
Intrinsic<[llvm_i32_ty], [], [IntrNoMe
def int_dx_create_handle : ClangBuiltin<"__builtin_hlsl_create_handle">,
Intrinsic<[ llvm_ptr_ty ], [llvm_i8_ty], [IntrWillReturn]>;
-}
+
+def int_dx_dot :
+Intrinsic<[
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/81190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -19,4 +19,9 @@ def int_dx_flattened_thread_id_in_group :
Intrinsic<[llvm_i32_ty], [], [IntrNoMe
def int_dx_create_handle : ClangBuiltin<"__builtin_hlsl_create_handle">,
Intrinsic<[ llvm_ptr_ty ], [llvm_i8_ty], [IntrWillReturn]>;
-}
+
+def int_dx_dot :
+Intrinsic<[
@@ -144,6 +144,92 @@ double3 cos(double3);
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_cos)
double4 cos(double4);
+//===--===//
+// dot product builtins
+//===
@@ -4518,6 +4518,12 @@ def HLSLCreateHandle : LangBuiltin<"HLSL_LANG"> {
let Prototype = "void*(unsigned char)";
}
+def HLSLDotProduct : LangBuiltin<"HLSL_LANG"> {
+ let Spellings = ["__builtin_hlsl_dot"];
+ let Attributes = [NoThrow, Const, CustomTypeChecking];
--
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/81190
>From 5082bc7fb49761424c7984a594a5afad9a03f04d Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 8 Feb 2024 11:08:59 -0500
Subject: [PATCH] [HLSL] Implementation of dot intrinsic This change implements
#700
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/81190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -19,4 +19,9 @@ def int_dx_flattened_thread_id_in_group :
Intrinsic<[llvm_i32_ty], [], [IntrNoMe
def int_dx_create_handle : ClangBuiltin<"__builtin_hlsl_create_handle">,
Intrinsic<[ llvm_ptr_ty ], [llvm_i8_ty], [IntrWillReturn]>;
-}
+
+def int_dx_dot :
+Intrinsic<[
@@ -19,4 +19,9 @@ def int_dx_flattened_thread_id_in_group :
Intrinsic<[llvm_i32_ty], [], [IntrNoMe
def int_dx_create_handle : ClangBuiltin<"__builtin_hlsl_create_handle">,
Intrinsic<[ llvm_ptr_ty ], [llvm_i8_ty], [IntrWillReturn]>;
-}
+
+def int_dx_dot :
+Intrinsic<[
@@ -4518,6 +4518,12 @@ def HLSLCreateHandle : LangBuiltin<"HLSL_LANG"> {
let Prototype = "void*(unsigned char)";
}
+def HLSLDotProduct : LangBuiltin<"HLSL_LANG"> {
+ let Spellings = ["__builtin_hlsl_dot"];
+ let Attributes = [NoThrow, Const, CustomTypeChecking];
+ let Pro
@@ -144,6 +144,92 @@ double3 cos(double3);
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_cos)
double4 cos(double4);
+//===--===//
+// dot product builtins
+//===
@@ -144,6 +144,92 @@ double3 cos(double3);
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_cos)
double4 cos(double4);
+//===--===//
+// dot product builtins
+//===
@@ -144,6 +144,92 @@ double3 cos(double3);
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_cos)
double4 cos(double4);
+//===--===//
+// dot product builtins
+//===
@@ -144,6 +144,92 @@ double3 cos(double3);
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_cos)
double4 cos(double4);
+//===--===//
+// dot product builtins
+//===
@@ -4518,6 +4518,12 @@ def HLSLCreateHandle : LangBuiltin<"HLSL_LANG"> {
let Prototype = "void*(unsigned char)";
}
+def HLSLDotProduct : LangBuiltin<"HLSL_LANG"> {
+ let Spellings = ["__builtin_hlsl_dot"];
+ let Attributes = [NoThrow, Const, CustomTypeChecking];
--
@@ -19,4 +19,9 @@ def int_dx_flattened_thread_id_in_group :
Intrinsic<[llvm_i32_ty], [], [IntrNoMe
def int_dx_create_handle : ClangBuiltin<"__builtin_hlsl_create_handle">,
Intrinsic<[ llvm_ptr_ty ], [llvm_i8_ty], [IntrWillReturn]>;
-}
+
+def int_dx_dot :
+Intrinsic<[
@@ -17895,6 +17898,52 @@ llvm::Value
*CodeGenFunction::EmitScalarOrConstFoldImmArg(unsigned ICEArguments,
return Arg;
}
+Value *CodeGenFunction::EmitDXILBuiltinExpr(unsigned BuiltinID,
+const CallExpr *E) {
+ switch (BuiltinID) {
@@ -19,4 +19,9 @@ def int_dx_flattened_thread_id_in_group :
Intrinsic<[llvm_i32_ty], [], [IntrNoMe
def int_dx_create_handle : ClangBuiltin<"__builtin_hlsl_create_handle">,
Intrinsic<[ llvm_ptr_ty ], [llvm_i8_ty], [IntrWillReturn]>;
-}
+
+def int_dx_dot :
+Intrinsic<[
@@ -17895,6 +17898,52 @@ llvm::Value
*CodeGenFunction::EmitScalarOrConstFoldImmArg(unsigned ICEArguments,
return Arg;
}
+Value *CodeGenFunction::EmitDXILBuiltinExpr(unsigned BuiltinID,
+const CallExpr *E) {
+ switch (BuiltinID) {
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/81190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz commented:
Super excited to see this coming along.
https://github.com/llvm/llvm-project/pull/81190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/dmpots edited https://github.com/llvm/llvm-project/pull/81190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/python3kgae edited
https://github.com/llvm/llvm-project/pull/81190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/python3kgae edited
https://github.com/llvm/llvm-project/pull/81190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4518,6 +4518,12 @@ def HLSLCreateHandle : LangBuiltin<"HLSL_LANG"> {
let Prototype = "void*(unsigned char)";
}
+def HLSLDotProduct : LangBuiltin<"HLSL_LANG"> {
+ let Spellings = ["__builtin_hlsl_dot"];
+ let Attributes = [NoThrow, Const, CustomTypeChecking];
+ let Pro
@@ -144,6 +144,92 @@ double3 cos(double3);
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_cos)
double4 cos(double4);
+//===--===//
+// dot product builtins
+//===
@@ -17895,6 +17898,52 @@ llvm::Value
*CodeGenFunction::EmitScalarOrConstFoldImmArg(unsigned ICEArguments,
return Arg;
}
+Value *CodeGenFunction::EmitDXILBuiltinExpr(unsigned BuiltinID,
+const CallExpr *E) {
+ switch (BuiltinID) {
https://github.com/farzonl created
https://github.com/llvm/llvm-project/pull/81190
This change implements #70073
HLSL has a dot intrinsic defined here:
https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-dot
The intrinsic itself is defined as a HLSL_LANG LangBuiltin i
92 matches
Mail list logo