================ @@ -54,5 +54,67 @@ clamp(U p0, V p1, W p2) { return clamp(p0, (U)p1, (U)p2); } +//===----------------------------------------------------------------------===// +// max builtin overloads +//===----------------------------------------------------------------------===// + +template <typename T, typename U, uint N> +constexpr __detail::enable_if_t< + __detail::is_arithmetic<U>::Value && (N > 1 && N <= 4), vector<T, N>> +max(vector<T, N> p0, U p1) { + return max(p0, (vector<T, N>)p1); +} + +template <typename T, typename U, uint N> +constexpr __detail::enable_if_t< + __detail::is_arithmetic<U>::Value && (N > 1 && N <= 4), vector<T, N>> +max(U p0, vector<T, N> p1) { + return max((vector<T, N>)p0, p1); +} + +template <typename T, typename R, uint N> +constexpr __detail::enable_if_t<(N > 1 && N <= 4), vector<T, N>> +max(vector<T, N> p0, vector<R, N> p1) { ---------------- spall wrote:
Is this only a problem for max or is it also a problem for min? If I remove the min overload the DML shaders still error. https://github.com/llvm/llvm-project/pull/131666 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits