diff --git a/modules/compiler/builtins/abacus/source/abacus_math/powr.cpp b/modules/compiler/builtins/abacus/source/abacus_math/powr.cpp index 7c63475b8..cbf2b76a2 100644 --- a/modules/compiler/builtins/abacus/source/abacus_math/powr.cpp +++ b/modules/compiler/builtins/abacus/source/abacus_math/powr.cpp @@ -45,12 +45,14 @@ inline T powr(const T x, const T y) { result = __abacus_select(result, bit, SignedType(xIsInf | yIsInf | (x == 0.0f))); - // Return for any input where y is zero - result = __abacus_select(result, T(1.0), SignedType(y == 0.0f)); + // Return 1 for any input where x is 1 or y is zero and we do not subsequently + // change it to NaN. + result = + __abacus_select(result, T(1.0f), SignedType((x == 1.0f) | (y == 0.0f))); - // Return NAN in the following conditions: - // * x is NAN - // * y is NAN + // Return NaN in the following conditions: + // * x is NaN + // * y is NaN // * x is less than zero // * x is +/- zero and y is +/- zero // * x is INFINITY and y is +/- zero diff --git a/source/cl/test/UnitCL/source/ktst_precision.cpp b/source/cl/test/UnitCL/source/ktst_precision.cpp index 278c5cb35..dbab14596 100644 --- a/source/cl/test/UnitCL/source/ktst_precision.cpp +++ b/source/cl/test/UnitCL/source/ktst_precision.cpp @@ -1807,8 +1807,7 @@ TEST_P(HalfMathBuiltinsPow, Precision_80_Half_pow) { TestAgainstRef<4_ULP>(pow_ref); } -// TODO: OCK-523 -TEST_P(HalfMathBuiltinsPow, DISABLED_Precision_81_Half_powr) { +TEST_P(HalfMathBuiltinsPow, Precision_81_Half_powr) { if (!UCL::hasHalfSupport(device)) { GTEST_SKIP(); }