Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify conversion sequences and overload scoring (#261)
This change is a shift in how conversion sequences and overload scoring is handled to disambiguate a few cases that DXC handles today through simpler rules. The main cases relate to scoring conversion sequences with dimension adjustment conversions. With this change an implicit conversion sequence is now defined as: Value conversion (lvalue to rvalue or array decay) Data conversion (int/float/bool/struct promotion or conversion) Dimension conversion (splat or truncate) CV qualifier conversion (add const) Conversion sequences are still assigned the rank of their "highest" conversion following the same chart as before where the ranks are: * Exact match * Scalar extension without promotion or conversion * Promotion * Scalar extension with promotion * Conversion * Scalar extension with conversion * Truncation without promotion or conversion * Truncation with promotion * Truncation with conversion Given these rules: ICS(float -> double) > ICS(float -> double3) ICS(float -> double3) > ICS(float -> half) ICS(float -> double2) == ICS(float -> dobule3) ICS(float -> half) > ICS(float -> half3) ICS(float4 -> double3) > ICS(float4 -> half3) ICS(float4 -> double4) > ICS(float4 -> float2) ICS(float4 -> half4) > ICS(float4 -> float2) 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