[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-02 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed 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

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-01 Thread Tex Riddell via cfe-commits
https://github.com/tex3d 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

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-01 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/90222 >From a173605b6043739e69f89d3a559a4f6a68d5fc0a Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Thu, 25 Apr 2024 15:47:22 -0500 Subject: [PATCH 1/2] [HLSL] Shore up floating point conversions This PR

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-01 Thread Farzon Lotfi via cfe-commits
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

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-01 Thread Chris B via cfe-commits
@@ -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

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-01 Thread Chris B via cfe-commits
@@ -4393,6 +4401,24 @@ getFixedEnumPromtion(Sema , const StandardConversionSequence ) { return FixedEnumPromotion::ToPromotedUnderlyingType; } +static ImplicitConversionSequence::CompareKind +HLSLCompareFloatingRank(QualType LHS, QualType RHS) { +

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-01 Thread Farzon Lotfi via cfe-commits
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

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-01 Thread Farzon Lotfi via cfe-commits
@@ -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

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-01 Thread Chris B via cfe-commits
@@ -2616,6 +2617,13 @@ bool Sema::IsFloatingPointPromotion(QualType FromType, QualType ToType) { ToBuiltin->getKind() == BuiltinType::Ibm128)) return true; + // In HLSL, `half` promotes to `float` or `double`, regardless of whether + // or not

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-01 Thread Farzon Lotfi via cfe-commits
@@ -4393,6 +4401,24 @@ getFixedEnumPromtion(Sema , const StandardConversionSequence ) { return FixedEnumPromotion::ToPromotedUnderlyingType; } +static ImplicitConversionSequence::CompareKind +HLSLCompareFloatingRank(QualType LHS, QualType RHS) { +

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-01 Thread Chris B via cfe-commits
@@ -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

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-01 Thread S. Bharadwaj Yadavalli via cfe-commits
@@ -2616,6 +2617,13 @@ bool Sema::IsFloatingPointPromotion(QualType FromType, QualType ToType) { ToBuiltin->getKind() == BuiltinType::Ibm128)) return true; + // In HLSL, `half` promotes to `float` or `double`, regardless of whether + // or not

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-01 Thread Cooper Partin via cfe-commits
https://github.com/coopp approved this pull request. Looks good. Took me a while to go through all of the tests. Looks like everything is covered! https://github.com/llvm/llvm-project/pull/90222 ___ cfe-commits mailing list

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-01 Thread Tex Riddell via cfe-commits
@@ -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

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-04-29 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/90222 >From a173605b6043739e69f89d3a559a4f6a68d5fc0a Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Thu, 25 Apr 2024 15:47:22 -0500 Subject: [PATCH] [HLSL] Shore up floating point conversions This PR fixes

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-04-26 Thread Chris B via cfe-commits
@@ -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

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-04-26 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp 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

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-04-26 Thread Damyan Pepper via cfe-commits
@@ -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

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-04-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Chris B (llvm-beanz) Changes This PR fixes bugs in HLSL floating conversions. HLSL always has `half`, `float` and `double` types, which promote in the order: `half`-`float`-`double` and convert in the order: `double`-`float`-`half` As

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-04-26 Thread Chris B via cfe-commits
https://github.com/llvm-beanz created https://github.com/llvm/llvm-project/pull/90222 This PR fixes bugs in HLSL floating conversions. HLSL always has `half`, `float` and `double` types, which promote in the order: `half`->`float`->`double` and convert in the order: