Home | History | Annotate | Download | only in functional

Lines Matching refs:Precision

124 inline bool supportsSignedZero (glu::Precision precision)
128 return precision == glu::PRECISION_HIGHP;
150 static int getMinMantissaBits (glu::Precision precision)
159 DE_ASSERT(de::inBounds<int>(precision, 0, DE_LENGTH_OF_ARRAY(bits)));
160 return bits[precision];
163 static int getMaxNormalizedValueExponent (glu::Precision precision)
172 DE_ASSERT(de::inBounds<int>(precision, 0, DE_LENGTH_OF_ARRAY(exponent)));
173 return exponent[precision];
176 static int getMinNormalizedValueExponent (glu::Precision precision)
185 DE_ASSERT(de::inBounds<int>(precision, 0, DE_LENGTH_OF_ARRAY(exponent)));
186 return exponent[precision];
417 static const char* getPrecisionPostfix (glu::Precision precision)
426 DE_ASSERT(de::inBounds<int>(precision, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
427 return s_postfix[precision];
445 static std::string getCommonFuncCaseName (glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
447 return string(glu::getDataTypeName(baseType)) + getPrecisionPostfix(precision) + getShaderTypePostfix(shaderType);
453 AbsCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
454 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "abs", shaderType)
456 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
457 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
478 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
482 fillRandomScalars(rnd, floatRanges[precision].x(), floatRanges[precision].y(), values[0], numValues*scalarSize);
484 fillRandomScalars(rnd, intRanges[precision].x(), intRanges[precision].y(), values[0], numValues*scalarSize);
490 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
495 const int mantissaBits = getMinMantissaBits(precision);
535 SignCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
536 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "sign", shaderType)
538 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
539 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
560 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
569 fillRandomScalars(rnd, floatRanges[precision].x(), floatRanges[precision].y(), (float*)values[0] + scalarSize*3, (numValues-3)*scalarSize);
576 fillRandomScalars(rnd, intRanges[precision].x(), intRanges[precision].y(), (int*)values[0] + scalarSize*3, (numValues-3)*scalarSize);
583 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
589 const deUint32 maxUlpDiff = precision == glu::PRECISION_LOWP ? getMaxUlpDiffFromBits(getMinMantissaBits(precision)) : 0;
641 RoundEvenCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
642 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "roundEven", shaderType)
644 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
645 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
660 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
665 if (precision != glu::PRECISION_LOWP)
670 const float v = de::clamp(float(ndx) - 10.5f, ranges[precision].x(), ranges[precision].y());
677 fillRandomScalars(rnd, ranges[precision].x(), ranges[precision].y(), (float*)values[0] + numSpecialCases*scalarSize, (numValues-numSpecialCases)*scalarSize);
679 // If precision is mediump, make sure values can be represented in fp16 exactly
680 if (precision == glu::PRECISION_MEDIUMP)
690 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
691 const bool hasSignedZero = supportsSignedZero(precision);
694 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
714 const int mantissaBits = getMinMantissaBits(precision);
752 ModfCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
753 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "modf", shaderType)
755 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
756 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
757 m_spec.outputs.push_back(Symbol("out1", glu::VarType(baseType, precision)));
772 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
775 fillRandomScalars(rnd, ranges[precision].x(), ranges[precision].y(), values[0], numValues*scalarSize);
781 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
782 const bool hasZeroSign = supportsSignedZero(precision);
785 const int mantissaBits = getMinMantissaBits(precision);
796 const int bitsLost = precision != glu::PRECISION_HIGHP ? numBitsLostInOp(in0, refOut0) : 0;
818 IsnanCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
819 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "isnan", shaderType)
826 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
835 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
837 const int mantissaBits = getMinMantissaBits(precision);
858 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
861 if (precision == glu::PRECISION_HIGHP)
877 else if (precision == glu::PRECISION_MEDIUMP || precision == glu::PRECISION_LOWP)
901 IsinfCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
902 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "isinf", shaderType)
909 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
918 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
920 const int mantissaBits = getMinMantissaBits(precision);
941 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
944 if (precision == glu::PRECISION_HIGHP)
960 else if (precision == glu::PRECISION_MEDIUMP)
985 FloatBitsToUintIntCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType, bool outIsSigned)
986 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), outIsSigned ? "floatBitsToInt" : "floatBitsToUint", shaderType)
992 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1008 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1011 fillRandomScalars(rnd, ranges[precision].x(), ranges[precision].y(), values[0], numValues*scalarSize);
1017 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1020 const int mantissaBits = getMinMantissaBits(precision);
1045 FloatBitsToIntCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1046 : FloatBitsToUintIntCase(context, baseType, precision, shaderType, true)
1054 FloatBitsToUintCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1055 : FloatBitsToUintIntCase(context, baseType, precision, shaderType, false)
1113 FloorCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1114 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "floor", shaderType)
1116 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1117 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
1132 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1135 fillRandomScalars(rnd, ranges[precision].x(), ranges[precision].y(), (float*)values[0], numValues*scalarSize);
1137 // If precision is mediump, make sure values can be represented in fp16 exactly
1138 if (precision == glu::PRECISION_MEDIUMP)
1148 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1151 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
1171 const int mantissaBits = getMinMantissaBits(precision);
1209 TruncCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1210 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "trunc", shaderType)
1212 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1213 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
1228 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1241 fillRandomScalars(rnd, ranges[precision].x(), ranges[precision].y(), (float*)values[0] + scalarSize*numSpecialCases, (numValues-numSpecialCases)*scalarSize);
1243 // If precision is mediump, make sure values can be represented in fp16 exactly
1244 if (precision == glu::PRECISION_MEDIUMP)
1254 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1257 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
1279 const int mantissaBits = getMinMantissaBits(precision);
1317 RoundCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1318 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "round", shaderType)
1320 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1321 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
1336 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1341 if (precision != glu::PRECISION_LOWP)
1346 const float v = de::clamp(float(ndx) - 5.5f, ranges[precision].x(), ranges[precision].y());
1353 fillRandomScalars(rnd, ranges[precision].x(), ranges[precision].y(), (float*)values[0] + numSpecialCases*scalarSize, (numValues-numSpecialCases)*scalarSize);
1355 // If precision is mediump, make sure values can be represented in fp16 exactly
1356 if (precision == glu::PRECISION_MEDIUMP)
1366 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1367 const bool hasZeroSign = supportsSignedZero(precision);
1370 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
1407 const int mantissaBits = getMinMantissaBits(precision);
1445 CeilCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1446 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "ceil", shaderType)
1448 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1449 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
1464 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1468 fillRandomScalars(rnd, ranges[precision].x(), ranges[precision].y(), (float*)values[0], numValues*scalarSize);
1470 // If precision is mediump, make sure values can be represented in fp16 exactly
1471 if (precision == glu::PRECISION_MEDIUMP)
1481 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1482 const bool hasZeroSign = supportsSignedZero(precision);
1485 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
1505 const int mantissaBits = getMinMantissaBits(precision);
1550 FractCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1551 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "fract", shaderType)
1553 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1554 m_spec.outputs.push_back(Symbol("out0", glu::VarType(baseType, precision)));
1569 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1574 if (precision != glu::PRECISION_LOWP)
1579 const float v = de::clamp(float(ndx) - 5.5f, ranges[precision].x(), ranges[precision].y());
1586 fillRandomScalars(rnd, ranges[precision].x(), ranges[precision].y(), (float*)values[0] + numSpecialCases*scalarSize, (numValues-numSpecialCases)*scalarSize);
1588 // If precision is mediump, make sure values can be represented in fp16 exactly
1589 if (precision == glu::PRECISION_MEDIUMP)
1599 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1600 const bool hasZeroSign = supportsSignedZero(precision);
1603 if (precision == glu::PRECISION_HIGHP || precision == glu::PRECISION_MEDIUMP)
1623 const int mantissaBits = getMinMantissaBits(precision);
1693 FrexpCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1694 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "frexp", shaderType)
1699 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1716 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1732 fillRandomScalars(rnd, ranges[precision].x(), ranges[precision].y(), (float*)values[0] + 8*scalarSize, (numValues-8)*scalarSize);
1738 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1740 const bool signedZero = supportsSignedZero(precision);
1742 const int mantissaBits = getMinMantissaBits(precision);
1773 LdexpCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1774 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "ldexp", shaderType)
1779 m_spec.inputs.push_back(Symbol("in0", glu::VarType(baseType, precision)));
1796 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1823 const int numEasyRandomCases = precision == glu::PRECISION_HIGHP ? 50 : (numValues-valueNdx);
1830 const float in = rnd.getFloat(ranges[precision].x(), ranges[precision].y());
1878 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1881 const int mantissaBits = getMinMantissaBits(precision);
1909 FmaCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
1910 : CommonFunctionCase(context, getCommonFuncCaseName(baseType, precision, shaderType).c_str(), "fma", shaderType)
1912 m_spec.inputs.push_back(Symbol("a", glu::VarType(baseType, precision)));
1913 m_spec.inputs.push_back(Symbol("b", glu::VarType(baseType, precision)));
1914 m_spec.inputs.push_back(Symbol("c", glu::VarType(baseType, precision)));
1915 m_spec.outputs.push_back(Symbol("res", glu::VarType(baseType, precision)));
1939 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
1941 const int numMantissaBits = getMinMantissaBits(precision);
1942 const int maxNormalizedValueExponent = getMaxNormalizedValueExponent(precision);
1943 const int minNormalizedValueExponent = getMinNormalizedValueExponent(precision);
1977 fillRandomScalars(rnd, ranges[precision].x(), ranges[precision].y(), (float*)values[inputNdx] + offs, numScalars);
1981 if (precision != glu::PRECISION_HIGHP)
2025 const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
2027 const bool signedZero = supportsSignedZero(precision);
2029 const int mantissaBits = getMinMantissaBits(precision);
2094 group->addChild(new TestClass(parent->getContext(), glu::DataType(scalarType + vecSize - 1), glu::Precision(prec), glu::ShaderType(shaderTypeNdx)));