https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/105907
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/106096
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
farzonl wrote:
@tgymnich you got approval on this PR, is there something you are waiting on?
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co
@@ -0,0 +1,209 @@
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
+// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
+// RUN: --check-prefixes=CHECK,DXIL_CHECK,DXIL_NATIVE_HALF,NATIVE_
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/101989
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
farzonl wrote:
> @farzonl This PR requires the SPIRV part (#101987) to be merged.
I haven't signed off on that one because I wanted input from others. I'll ping
some folks.
If the pr is still sitting we can make a small change in this pr that will
unbloc it. Add the spirv intrinsic to this pr t
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/93879
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl closed
https://github.com/llvm/llvm-project/pull/93879
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/98948
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl created
https://github.com/llvm/llvm-project/pull/98949
## Change(s)
- `Builtins.td` - Add f16 support for libm arc and hyperbolic trig functions
- `CGBuiltin.cpp` - Emit constraint intrinsics for trig clang builtins
## History
This change is part of an implementation
@@ -654,6 +655,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine
&TM,
setOperationAction(ISD::FSIN , VT, Expand);
setOperationAction(ISD::FCOS , VT, Expand);
setOperationAction(ISD::FSINCOS, VT, Expand);
+ setOperationAction(ISD::FTAN,
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/90694
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -406,6 +406,16 @@ void TargetInfo::adjust(DiagnosticsEngine &Diags,
LangOptions &Opts) {
LongDoubleAlign = 64;
}
+ // HLSL explicitly defines the sizes and formats of some data types, and we
+ // need to conform to those regardless of what architecture you are
tar
@@ -4393,6 +4401,24 @@ getFixedEnumPromtion(Sema &S, const
StandardConversionSequence &SCS) {
return FixedEnumPromotion::ToPromotedUnderlyingType;
}
+static ImplicitConversionSequence::CompareKind
+HLSLCompareFloatingRank(QualType LHS, QualType RHS) {
+ assert(LHS->isVecto
@@ -0,0 +1,229 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -fnative-half-type
-finclude-default-header -Wconversion -verify -o - %s
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -fnative-half-type
-finclude-default-header -ast-dump %s | FileCheck %
farzonl wrote:
Are there test cases in `OverloadResolutionBugs.hlsl` that have been fixed by
this change and would need to be removed from that file?
https://github.com/llvm/llvm-project/pull/90222
___
cfe-commits mailing list
cfe-commits@lists.llvm.
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/90222
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
farzonl wrote:
@RKSimon @topperc When you have time could I get a review. Thank you!
https://github.com/llvm/llvm-project/pull/90503
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
farzonl wrote:
Hi @efriedma-quic @RKSimon when you have time could I get a review? Thank you!
https://github.com/llvm/llvm-project/pull/90276
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co
farzonl wrote:
> I'm worried if we add a whole new series of math intrinsics without adding
> the corresponding constrained intrinsics, it's going to be confusing for
> anyone trying to understand how math intrinsics work. Why does tan exist, but
> not constrained tan?
>
> `tan` is defined ba
farzonl wrote:
> > I didn't want the current set of changes to go stale.
>
> How many changes are we talking about here? If it's just the tan() ones,
> that's fine; it probably makes sense to land constrained-tan separately
> anyway.
There are 4 for tan. There will be more for the other intri
https://github.com/farzonl closed
https://github.com/llvm/llvm-project/pull/90276
___
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/90088
>From 745447fe5d55d08b1d0e212d9bfa7e56a8af94f6 Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Wed, 24 Apr 2024 17:34:04 -0400
Subject: [PATCH 1/5] start of tan intrinsic
---
clang/docs/LanguageExtensions.rst
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/90088
>From 745447fe5d55d08b1d0e212d9bfa7e56a8af94f6 Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Wed, 24 Apr 2024 17:34:04 -0400
Subject: [PATCH 1/5] start of tan intrinsic
---
clang/docs/LanguageExtensions.rst
https://github.com/farzonl closed
https://github.com/llvm/llvm-project/pull/90088
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3861,11 +3864,17 @@ def warn_availability_fuchsia_unavailable_minor :
Warning<
InGroup;
def warn_unguarded_availability :
- Warning<"%0 is only available on %1 %2 or newer">,
+ Warning<"%0 is only available %select{|in %4 environment }3on %1 %2 or
newer">,
--
https://github.com/farzonl deleted
https://github.com/llvm/llvm-project/pull/89809
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -18,14 +18,21 @@ namespace hlsl {
#define _HLSL_BUILTIN_ALIAS(builtin)
\
__attribute__((clang_builtin_alias(builtin)))
-#define _HLSL_AVAILABILITY(environment, version)
\
- __attribute__((availabil
@@ -0,0 +1,140 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel5.0-compute -fsyntax-only
-verify %s
farzonl wrote:
could we do different runs for pixel and mesh to cover their different version
availabilities from compute?
https://github.com/llvm/llvm-proje
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/89809
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl created
https://github.com/llvm/llvm-project/pull/93314
- `Builtins.td` - replace TanF128 with F16F128MathTemplate
- `CGBuiltin.cpp` - map existing tan builtins to `tan` and `constrained_tan`
intrinsic
- `ConstrainedOps.def` map tan and constrained_tan to an ISD
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/93314
>From 683dfa875e024acba12b229dbecd6d10573c891f Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Fri, 24 May 2024 10:01:52 -0400
Subject: [PATCH 1/2] [clang] Add tanf16 builtin and support for tan
constrained in
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/93314
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
farzonl wrote:
> IMO it'd be good to have a bit more context in the commit description about
> why this is being done. If you follow the breadcrumbs from the issue to the
> thread in the PR I think you can put it together, but a more local summary
> might be helpful.
done
https://github.com
@@ -183,6 +183,14 @@ void foo(double *d, float f, float *fp, long double *l,
int *i, const char *c, _
// CHECK: call x86_fp80 @llvm.experimental.constrained.sqrt.f80(x86_fp80
%{{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict")
// CHECK: call fp128 @llvm.experime
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/93314
>From 683dfa875e024acba12b229dbecd6d10573c891f Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Fri, 24 May 2024 10:01:52 -0400
Subject: [PATCH 1/3] [clang] Add tanf16 builtin and support for tan
constrained in
@@ -63,5 +63,6 @@ let TargetPrefix = "spv" in {
def int_spv_frac : DefaultAttrsIntrinsic<[LLVMMatchType<0>],
[llvm_anyfloat_ty]>;
def int_spv_lerp : Intrinsic<[LLVMMatchType<0>], [llvm_anyfloat_ty,
LLVMMatchType<0>,LLVMMatchType<0>],
[IntrNoMem, IntrWillReturn] >;
+
@@ -4707,6 +4707,12 @@ def HLSLIsinf : LangBuiltin<"HLSL_LANG"> {
let Prototype = "void(...)";
}
+def HLSLLength : LangBuiltin<"HLSL_LANG"> {
+ let Spellings = ["__builtin_hlsl_elementwise_length"];
farzonl wrote:
This shouldn't be an elementwise builtin s
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/101256
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl deleted
https://github.com/llvm/llvm-project/pull/101256
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4707,6 +4707,12 @@ def HLSLIsinf : LangBuiltin<"HLSL_LANG"> {
let Prototype = "void(...)";
}
+def HLSLLength : LangBuiltin<"HLSL_LANG"> {
+ let Spellings = ["__builtin_hlsl_elementwise_length"];
farzonl wrote:
I agree with Justin, This shouldn't be an
@@ -0,0 +1,10 @@
+; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s
2>&1 | FileCheck %s
+
+; DXIL operation length does not support double overload type
+; CHECK: LLVM ERROR: Invalid Overload
+
+define noundef double @test_length_double2(<2 x double> nou
https://github.com/farzonl created
https://github.com/llvm/llvm-project/pull/101543
Remove elementwise description for builtins that don't perform elementwise
operations.
>From 506961aad924a717365c65de0b91c88e1010ca15 Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 1 Aug 2024 14:55:14
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/101543
___
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/101543
>From 7664c3ea206a2c2e851b8d925c377af6e4bb6e11 Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 1 Aug 2024 14:55:14 -0400
Subject: [PATCH 1/2] [HLSL] cleanup builtin names used by HLSL Remove
elementwise
farzonl wrote:
Current test failures are because of
https://github.com/llvm/llvm-project/commit/5e84646982d1e should be fixed by
https://github.com/llvm/llvm-project/commit/c5f1395f2f7f92015748069528d46ad89cecc9f1
https://github.com/llvm/llvm-project/pull/101549
https://github.com/llvm/llvm-
https://github.com/farzonl closed
https://github.com/llvm/llvm-project/pull/101543
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,10 @@
+; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s
2>&1 | FileCheck %s
+
+; DXIL operation length does not support scalar types
+; CHECK: error: invalid intrinsic signature
+
+define noundef float @test_length_float(float noundef %p0) {
@@ -284,41 +303,55 @@ static bool expandClampIntrinsic(CallInst *Orig,
Intrinsic::ID ClampIntrinsic) {
Builder.SetInsertPoint(Orig);
auto *MaxCall = Builder.CreateIntrinsic(
Ty, getMaxForClamp(Ty, ClampIntrinsic), {X, Min}, nullptr, "dx.max");
- auto *MinCall =
-
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/102872
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -18666,6 +18666,15 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
/*ReturnType=*/Op0->getType(),
CGM.getHLSLRuntime().getRsqrtIntrinsic(),
ArrayRef{Op0}, nullptr, "hlsl.rsqrt");
}
+ case Builtin::BI__builtin_hlsl_elementwise_saturate: {
+Value
@@ -0,0 +1,54 @@
+// 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 -o - | FileCheck %s \
+// RUN: --check-prefixes=CHECK,NATIVE_HALF
+// RUN: %
@@ -362,6 +364,34 @@ static bool expandClampIntrinsic(CallInst *Orig,
Intrinsic::ID ClampIntrinsic) {
return true;
}
+static bool expandSaturateIntrinsic(CallInst *SaturateCall) {
farzonl wrote:
wait for @pow2clk change merges then change this to return `
@@ -1285,6 +1289,34 @@ static unsigned getBoolCmpOpcode(unsigned PredNum) {
}
}
+static APFloat getZeroFP(const Type *LLVMFloatTy) {
farzonl wrote:
I'm a little suprised this didn't already exist.
https://github.com/llvm/llvm-project/pull/104619
__
@@ -325,6 +325,16 @@ def Abs : DXILOp<6, unary> {
let attributes = [Attributes];
}
+def Saturate : DXILOp<7, unary> {
+ let Doc = "Clamps a single or double precision floating point value to
[0.0f...1.0f].";
+ let LLVMIntrinsic = int_dx_saturate;
+ let arguments = [ove
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/104619
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -362,6 +364,34 @@ static bool expandClampIntrinsic(CallInst *Orig,
Intrinsic::ID ClampIntrinsic) {
return true;
}
+static bool expandSaturateIntrinsic(CallInst *SaturateCall) {
+ FunctionType *FT = SaturateCall->getFunctionType();
+ Type *FTRetTy = FT->getReturnType();
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/104619
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -362,6 +364,34 @@ static bool expandClampIntrinsic(CallInst *Orig,
Intrinsic::ID ClampIntrinsic) {
return true;
}
+static bool expandSaturateIntrinsic(CallInst *SaturateCall) {
+ FunctionType *FT = SaturateCall->getFunctionType();
+ Type *FTRetTy = FT->getReturnType();
@@ -7,155 +7,155 @@
// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF
#ifdef __HLSL_ENABLE_16_BIT
-// NATIVE_HALF: %dx.dot = mul i16 %0, %1
-// NATIVE_HALF: ret i16 %dx.dot
+// NATIVE_HALF: %hlsl.dot = mul i16 %0, %1
+// NATIVE_HALF: ret i16 %hlsl.dot
int16_t test_
@@ -68,28 +69,65 @@ static Value *expandAbs(CallInst *Orig) {
"dx.max");
}
-static Value *expandIntegerDot(CallInst *Orig, Intrinsic::ID DotIntrinsic) {
+// Create DXIL dot intrinsics for floating point dot operations
+static Value *expandFloat
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/104656
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1446,6 +1449,67 @@ bool SPIRVInstructionSelector::selectRsqrt(Register
ResVReg,
.constrainAllUses(TII, TRI, RBI);
}
+// Since there is no integer dot implementation, expand by piecewise
multiplying
farzonl wrote:
```suggestion
// Since there is no
@@ -2157,6 +2221,16 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register
ResVReg,
break;
case Intrinsic::spv_thread_id:
return selectSpvThreadId(ResVReg, ResType, I);
+ case Intrinsic::spv_fdot:
+return BuildMI(BB, I, I.getDebugLoc(), TII.get(SPIRV::OpDot)
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/104656
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
farzonl wrote:
could you fixup normalize to use some of you fdot expansion? I think you need
to split the intrinsic check from the emitting check
https://github.com/llvm/llvm-project/blob/9cf27a4d8b1da0e7b51eacb9fb6096155c294d3f/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp#L278-L289
ht
@@ -2157,6 +2221,16 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register
ResVReg,
break;
case Intrinsic::spv_thread_id:
return selectSpvThreadId(ResVReg, ResType, I);
+ case Intrinsic::spv_fdot:
+return BuildMI(BB, I, I.getDebugLoc(), TII.get(SPIRV::OpDot)
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/104656
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -7,155 +7,155 @@
// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF
#ifdef __HLSL_ENABLE_16_BIT
-// NATIVE_HALF: %dx.dot = mul i16 %0, %1
-// NATIVE_HALF: ret i16 %dx.dot
+// NATIVE_HALF: %hlsl.dot = mul i16 %0, %1
+// NATIVE_HALF: ret i16 %hlsl.dot
int16_t test_
farzonl wrote:
closes #99158
https://github.com/llvm/llvm-project/pull/103299
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
farzonl wrote:
> > We have this work tracked here: #99158
> > there should be some dxil specific tasks.
>
> Seems like most boxes would be checked by this PR, except Sema checks:
>
> * what kind of Sema checks would be required for this one?
> Also, the intrinsic name in the issue is using ca
@@ -363,9 +382,13 @@ static bool expandIntrinsic(Function &F, CallInst *Orig) {
case Intrinsic::dx_normalize:
Result = expandNormalizeIntrinsic(Orig);
break;
+ case Intrinsic::dx_fdot:
+Result =
+expandFloatDotIntrinsic(Orig, Orig->getOperand(0),
Orig->g
@@ -1,161 +1,172 @@
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
-// RUN: --check-prefixes=CHECK,NATIVE_HALF
+// RUN: --check-pr
@@ -1446,6 +1452,90 @@ bool SPIRVInstructionSelector::selectRsqrt(Register
ResVReg,
.constrainAllUses(TII, TRI, RBI);
}
+// Select the OpDot instruction for the given float dot
+bool SPIRVInstructionSelector::selectFloatDot(Register ResVReg,
+
@@ -15,6 +15,7 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/Passes.h"
+#include "llvm/IR/DerivedTypes.h"
farzonl wrote:
revert?
https://github.com/llvm/llvm-project/pull/104619
___
@@ -0,0 +1,69 @@
+; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s |
FileCheck %s
+; Make sure the intrinsic dx.saturate is to appropriate DXIL op for
half/float/double data types.
+
+target datalayout =
"e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:
@@ -0,0 +1,69 @@
+; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s |
FileCheck %s
+; Make sure the intrinsic dx.saturate is to appropriate DXIL op for
half/float/double data types.
+
+target datalayout =
"e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:
@@ -0,0 +1,69 @@
+; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s |
FileCheck %s
+; Make sure the intrinsic dx.saturate is to appropriate DXIL op for
half/float/double data types.
+
+target datalayout =
"e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:
@@ -0,0 +1,69 @@
+; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s |
FileCheck %s
+; Make sure the intrinsic dx.saturate is to appropriate DXIL op for
half/float/double data types.
+
+target datalayout =
"e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:
@@ -0,0 +1,14 @@
+; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s
2>&1 | FileCheck %s
+; Make sure the intrinsic dx.saturate is to appropriate DXIL op for
half/float/double data types.
+
+target datalayout =
"e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i6
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/104619
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,53 @@
+//===-
DirectX.cpp-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
https://github.com/farzonl approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/104856
___
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/104856
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/102227
___
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/95999
>From bb837fd791d627fceffb73eaac70b8f4db2f4dda Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Tue, 18 Jun 2024 17:47:13 -0400
Subject: [PATCH] [HLSL][clang] Add elementwise builtins for trig intrinsics
This c
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/95999
>From 632ec448202a111a313536ffbf22589499dd214b Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Tue, 18 Jun 2024 17:47:13 -0400
Subject: [PATCH] [HLSL][clang] Add elementwise builtins for trig intrinsics
This c
https://github.com/farzonl closed
https://github.com/llvm/llvm-project/pull/95999
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -584,6 +585,39 @@ static Attr *handleOpenCLUnrollHint(Sema &S, Stmt *St,
const ParsedAttr &A,
return ::new (S.Context) OpenCLUnrollHintAttr(S.Context, A, UnrollFactor);
}
+static Attr *handleHLSLLoopHintAttr(Sema &S, Stmt *St, const ParsedAttr &A,
+
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/93879
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/108128
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1522,6 +1522,14 @@ bool CheckUnsignedIntRepresentation(Sema *S, CallExpr
*TheCall) {
checkAllUnsignedTypes);
}
+bool CheckIntRepresentation(Sema *S, CallExpr *TheCall) {
farzonl wrote:
It doesn't seem like this function
farzonl wrote:
I don't see a `clang/test/CodeGenHLSL/builtins/countbits.hlsl`
https://github.com/llvm/llvm-project/pull/108121
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
farzonl wrote:
Also we probably still want a
`clang/test/SemaHLSL/BuiltIns/countbits-errors.hlsl` to check the errors for
float representations.
https://github.com/llvm/llvm-project/pull/108121
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
farzonl wrote:
Code looks fine, I need to see more tests before I can sign off.
https://github.com/llvm/llvm-project/pull/108121
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1490,6 +1490,18 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
TheCall->setType(ArgTyA);
break;
}
+ case Builtin::BI__builtin_hlsl_step: {
+if (CheckFloatOrHalfRepresentations(&SemaRef, TheCall))
+ return true;
+
@@ -0,0 +1,31 @@
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.6-library %s -fnative-half-type -disable-llvm-passes
-verify -verify-ignore-unexpected
+
+void test_too_few_arg()
+{
+ return __builtin_hlsl_step();
+ // expected-error@-1 {{too few argu
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/106471
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,80 @@
+// 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
+
+#ifdef __HLSL_ENABLE_16_BIT
+// CHECK: define nound
@@ -0,0 +1,28 @@
+; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s |
FileCheck %s
farzonl wrote:
so I don't have to clean this up later can you change this to
```suggestion
; RUN: opt -S -scalarizer -dxil-op-lower
-mtriple=dxil-pc-shader
501 - 600 of 1462 matches
Mail list logo