Skip to content

Commit

Permalink
Update disambiguation rule
Browse files Browse the repository at this point in the history
This updates the ordering of conversion ranks and disambiguation rule to handle a few more cases:

ICS(float -> double) > ICS(float -> float3)
ICS(float -> float3) > ICS(float -> double3)
ICS(float -> double4) > ICS(float -> half4)
ICS(float -> double4) != ICS(float -> double3)
ICS(double -> float4) != ICS(double -> float3)
ICS(double -> float4) != ICS(double -> half3)

ICS(float4 -> float3) > ICS(float4 -> double3)
ICS(float4 -> float3) > ICS(float4 -> half3)
ICS(float4 -> double3) > ICS(float4 -> half3)
ICS(double4 -> float3) != ICS(double4 ->half3)
ICS(half4 -> float3) != ICS(half4 ->double3)
  • Loading branch information
llvm-beanz committed Jun 17, 2024
1 parent 64e905b commit e0473c9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions specs/language/overloading.tex
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,14 @@
& \ref{Conv.array} \\ \cline{1-2}\cline{4-4}
Qualification & Qualification Adjustment & & \ref{Conv.qual} \\ \cline{1-4}

Scalar splat & Scalar Extension & Extension
& \ref{Conv.vsplat} \\ \cline{1-4}

Integral promotion & &
& \ref{Conv.iconv} \& \ref{Conv.rank.int} \\ \cline{1-1}\cline{4-4}
Floating point promotion & Promotion & Promotion
& \ref{Conv.fconv} \& \ref{Conv.rank.float} \\ \cline{1-1}\cline{4-4}
Component-wise promotion & & & \ref{Conv.cwise} \\ \cline{1-4}

Scalar splat & Scalar Extension & Extension
& \ref{Conv.vsplat} \\ \cline{1-4}

Integral conversion & & & \ref{Conv.iconv} \\ \cline{1-1}\cline{4-4}
Floating point conversion & & & \ref{Conv.fconv} \\ \cline{1-1}\cline{4-4}
Expand Down Expand Up @@ -339,8 +338,8 @@
\item conversion of \texttt{B} to \texttt{A} is better than conversion of
\texttt{C} to \texttt{A}.
\end{itemize}
\item If \(ICS(f)\) and \(ICS(f`')\) are both \textbf{Promotion} or
\textbf{Conversion} ranked, and \(ICS(f)\) contains an \textbf{Extension}
conversion, but \(ICS(f`')\) does not contain an \textbf{Extension},
\(ICS(f`')\) is the better conversion than \(ICS(f')\).
\item If \(ICS(f)\) and \(ICS(f`')\) are both \textbf{Extension} or
\textbf{Truncation} ranked, the next highest ranked conversion in the
sequences are compared to disambiguate. If those conversions are of the same
rank, the sequences are ambiguous.
\end{itemize}

0 comments on commit e0473c9

Please sign in to comment.