diff --git a/specs/language/conversions.tex b/specs/language/conversions.tex index 8cc32657..03df65c5 100644 --- a/specs/language/conversions.tex +++ b/specs/language/conversions.tex @@ -8,13 +8,11 @@ \item Zero or one conversion of either lvalue-to-rvalue, or array-to-pointer. \item Zero or one conversion of either integral conversion, floating point conversion, floating point-integral conversion, or boolean conversion, - derived-to-base-lvalue, vector splat, vector truncation. \footnote{This - differs from C++ with the addition of vector splat and truncation casting.}. - \item Zero or one conversion of either component-wise integral conversion, - component-wise floating point conversion, component-wise floating - point-integral conversion, or component-wise boolean - conversion\footnote{C++ does not support this conversion in the sequence for - component-wise conversion of vector and matrix types.}. + derived-to-base-lvalue, or flat conversion\footnote{This differs from C++ with + the addition of flat conversion.}. + \item Zero or one conversion of scalar-vector splat, or vector/matrix + truncation. \footnote{C++ does not support dimension altering conversions for + scalar, vector or matrix types.}. \item Zero or one qualification conversion. \end{enumerate} diff --git a/specs/language/overloading.tex b/specs/language/overloading.tex index 0c4e9636..0fab438f 100644 --- a/specs/language/overloading.tex +++ b/specs/language/overloading.tex @@ -271,7 +271,7 @@ & \ref{Conv.array} \\ \cline{1-2}\cline{4-4} Qualification & Qualification Adjustment & & \ref{Conv.qual} \\ \cline{1-4} - Scalar splat & Scalar Extension & Extension + Scalar splat (without conversion) & Scalar Extension & Extension & \ref{Conv.vsplat} \\ \cline{1-4} Integral promotion & & @@ -280,6 +280,8 @@ & \ref{Conv.fconv} \& \ref{Conv.rank.float} \\ \cline{1-1}\cline{4-4} Component-wise promotion & & & \ref{Conv.cwise} \\ \cline{1-4} + Scalar splat promotion & Scalar Extension Promotion & Promotion 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} @@ -288,18 +290,46 @@ Boolean conversion & & & \ref{Conv.bool} \\ \cline{1-1}\cline{4-4} Component-wise conversion & & & \ref{Conv.cwise} \\ \cline{1-4} - Vector truncation & Dimensionality Reduction & Truncation - & \ref{Conv.vtrunc} \\ \cline{1-4} + Scalar splat conversion & Scalar Extension Conversion & Conversion Extension + & \ref{Conv.vsplat} \\ \cline{1-4} + + Vector truncation (without conversion) & Dimensionality Reduction + & Truncation & \ref{Conv.vtrunc} \\ \cline{1-4} + + Vector truncation promotion & Dimensionality Reduction Promotion + & Truncation Promotion & \ref{Conv.vtrunc} \\ \cline{1-4} + + Vector truncation conversion & Dimensionality Reduction Conversion + & Truncation Conversion & \ref{Conv.vtrunc} \\ \cline{1-4} \hline \end{tabular} \end{center} -\p The rank of a conversion sequence is determined by considering the rank of -each conversion. Conversion sequence ranks are ordered such that \textbf{Exact -Match} rank is better than \textbf{Extension} rank, which is better than -\textbf{Promotion} rank, which is better than \textbf{Conversion} rank, which is -better than \textbf{Truncation} rank. The rank of a conversion sequence is the -rank of the worst ranked conversion in the sequence. +\p If a scalar splat conversion occurs in a conversion sequence where all other +conversions are \textbf{Exact Match} rank, the conversion is ranked as +\textbf{Extension}. If a scalar splat occurs in a conversion +sequence with a \textbf{Promotion} conversion, the conversion is ranked as +\textbf{Promotion Extension}. If a scalar splat occurs in a conversion +sequence with a \textbf{Conversion} conversion, the conversion is ranked as +\textbf{Conversion Extension}. + +\p If a vector truncation conversion occurs in a conversion sequence where all +other conversions are \textbf{Exact Match} rank, the conversion is ranked as +\textbf{Truncation}. If a vector truncation occurs in a conversion +sequence with a \textbf{Promotion} conversion, the conversion is ranked as +\textbf{Promotion Truncation}. If a vector truncation occurs in a conversion +sequence with a \textbf{Conversion} conversion, the conversion is ranked as +\textbf{Conversion Truncation}. + +\p Otherwise, the rank of a conversion sequence is determined by considering the +rank of each conversion. + +\p Conversion sequence ranks are ordered such that \textbf{Exact +Match} rank is better than \textbf{Exact Match Extension} rank, which is better +than \textbf{Promotion} rank, which is better than \textbf{Extension} rank, +which is better than \textbf{Conversion} rank, which is better than +\textbf{Truncation} rank. The rank of a conversion sequence is the rank of the +worst ranked conversion in the sequence. % TODO: Define user-defined conversion sequences. DXC doesn't actually support % these because we don't resolve overloads for user-defined conversion