================
@@ -4393,6 +4401,24 @@ getFixedEnumPromtion(Sema &S, const 
StandardConversionSequence &SCS) {
   return FixedEnumPromotion::ToPromotedUnderlyingType;
 }
 
+static ImplicitConversionSequence::CompareKind
+HLSLCompareFloatingRank(QualType LHS, QualType RHS) {
+  assert(LHS->isVectorType() == RHS->isVectorType() &&
----------------
llvm-beanz wrote:

I'm not yet handling scalar -> vector conversions. That won't change this code, 
but it will add extra handling in the `CompareStandardConversionSequences` 
function because we'll need to prefer scalar->vector conversions when the 
element type is the same (and maybe a promotion).

We don't yet generate the cast sequences for the scalar->vector conversions, so 
we can't yet handle them.

For context what this is doing: during overload resolution a list of candidate 
functions is generated by iterating over each possible function and generating 
possible conversion sequences for each overload. Then each conversion sequence 
is evaluated against the other to determine if it is better or worse to choose 
which overload we want. This code just extends that to allow floating point 
promotions and conversions more freely than C does, and uses the same logic for 
vector element conversions. 

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

Reply via email to