@@ -103,21 +103,6 @@ static constexpr Operation Operations[] = {
103103#include " LongVectorOps.def"
104104};
105105
106- #define OP_WITH_OUT_PARAM (OPERATION, TYPE, IMPL ) \
107- template <> struct ExpectedBuilder <OpType::OPERATION, TYPE> { \
108- static std::vector<TYPE> buildExpected (Op<OpType::OPERATION, TYPE, 1 >, \
109- const InputSets<TYPE> &Inputs) { \
110- DXASSERT_NOMSG (Inputs.size () == 1 ); \
111- size_t VectorSize = Inputs[0 ].size (); \
112- std::vector<TYPE> Expected; \
113- Expected.resize (VectorSize * 2 ); \
114- for (size_t I = 0 ; I < VectorSize; ++I) { \
115- IMPL \
116- } \
117- return Expected; \
118- } \
119- };
120-
121106constexpr const Operation &getOperation (OpType Op) {
122107 if (Op < OpType::NumOpTypes)
123108 return Operations[unsigned (Op)];
@@ -643,6 +628,21 @@ struct StrictValidation {
643628#define DEFAULT_OP_2 (OP, IMPL ) OP_2(OP, DefaultValidation<T>, IMPL)
644629#define DEFAULT_OP_3 (OP, IMPL ) OP_3(OP, DefaultValidation<T>, IMPL)
645630
631+ #define OP_WITH_OUT_PARAM_1 (OPERATION, TYPE, IMPL ) \
632+ template <> struct ExpectedBuilder <OpType::OPERATION, TYPE> { \
633+ static std::vector<TYPE> buildExpected (Op<OpType::OPERATION, TYPE, 1 >, \
634+ const InputSets<TYPE> &Inputs) { \
635+ DXASSERT_NOMSG (Inputs.size () == 1 ); \
636+ const size_t VectorSize = Inputs[0 ].size (); \
637+ std::vector<TYPE> Expected; \
638+ Expected.resize (VectorSize * 2 ); \
639+ for (size_t I = 0 ; I < VectorSize; ++I) { \
640+ IMPL \
641+ } \
642+ return Expected; \
643+ } \
644+ };
645+
646646//
647647// TernaryMath
648648//
@@ -1030,7 +1030,7 @@ DEFAULT_OP_1(OpType::Log2, (std::log2(A)));
10301030// with special logic. Frexp is only supported for fp32 values.
10311031template <> struct Op <OpType::Frexp, float , 1 > : DefaultValidation<float > {};
10321032
1033- OP_WITH_OUT_PARAM (Frexp, float , {
1033+ OP_WITH_OUT_PARAM_1 (Frexp, float , {
10341034 int Exp = 0 ;
10351035 float Man = std::frexp (Inputs[0 ][I], &Exp);
10361036
@@ -1233,14 +1233,14 @@ FLOAT_SPECIAL_OP(OpType::IsNan, (std::isnan(A)));
12331233
12341234template <typename T> struct Op <OpType::ModF, T, 1 > : DefaultValidation<T> {};
12351235
1236- OP_WITH_OUT_PARAM (ModF, float , {
1236+ OP_WITH_OUT_PARAM_1 (ModF, float , {
12371237 float Exp = 0 .0f ;
12381238 float Man = std::modf (Inputs[0 ][I], &Exp);
12391239 Expected[I] = Man;
12401240 Expected[I + VectorSize] = Exp;
12411241});
12421242
1243- OP_WITH_OUT_PARAM (ModF, HLSLHalf_t, {
1243+ OP_WITH_OUT_PARAM_1 (ModF, HLSLHalf_t, {
12441244 float Exp = 0 .0f ;
12451245 float Inp = float (Inputs[0 ][I]);
12461246 float Man = std::modf (Inp, &Exp);
0 commit comments