================ @@ -158,6 +158,42 @@ namespace hlsl { return fn((float4)V1, (float4)V2, (float4)V3); \ } +#define _DXC_COMPAT_BINARY_VECTOR_SCALAR_OVERLOADS(fn) \ + template <typename T, uint N> \ + constexpr __detail::enable_if_t<(N > 1 && N <= 4), vector<T, N>> fn( \ + vector<T, N> V1, T V2) { \ + return fn(V1, (vector<T, N>)V2); \ + } \ + template <typename T, uint N> \ + constexpr __detail::enable_if_t<(N > 1 && N <= 4), vector<T, N>> fn( \ + T V1, vector<T, N> V2) { \ + return fn((vector<T, N>)V1, V2); \ + } + +#define _DXC_COMPAT_TERNARY_VECTOR_SCALAR_OVERLOADS(fn) \ + template <typename T, uint N> \ + constexpr __detail::enable_if_t<(N > 1 && N <= 4), vector<T, N>> fn( \ + T V1, vector<T, N> V2, vector<T, N> V3) { \ + return fn((vector<T, N>)V1, V2, V3); \ + } \ + template <typename T, uint N> \ + constexpr __detail::enable_if_t<(N > 1 && N <= 4), vector<T, N>> fn( \ + vector<T, N> V1, T V2, vector<T, N> V3) { \ + return fn(V1, (vector<T, N>)V2, V3); \ + } \ + template <typename T, uint N> \ + constexpr __detail::enable_if_t<(N > 1 && N <= 4), vector<T, N>> fn( \ + vector<T, N> V1, vector<T, N> V2, T V3) { \ + return fn(V1, V2, (vector<T, N>)V3); \ + } + +#define _DXC_COMPAT_TERNARY_SINGLE_VECTOR_SCALAR_OVERLOADS(fn) \ ---------------- V-FEXrt wrote:
Some intrinsics didn't need both so I didn't want to unnecessarily add extra overloads https://github.com/llvm/llvm-project/pull/139800 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits