Test denormal fp16 constants.

This commit is contained in:
Hans-Kristian Arntzen 2018-03-06 16:39:47 +01:00
parent 24dfe496c2
commit 547278da12
3 changed files with 15 additions and 13 deletions

View File

@ -11,7 +11,7 @@ layout(location = 3) in f16vec4 v4;
void main()
{
f16vec4 _508;
f16vec4 _580 = modf(v4, _508);
f16vec4 _511;
f16vec4 _583 = modf(v4, _511);
}

View File

@ -31,6 +31,7 @@ void test_constants()
float16_t e = (1.0hf / 0.0hf);
float16_t f = (-1.0hf / 0.0hf);
float16_t g = 1014.0hf;
float16_t h = 9.5367431640625e-07hf;
}
float16_t test_result()
@ -86,8 +87,8 @@ void test_builtins()
res = fract(v4);
res = mod(v4, v4);
f16vec4 tmp;
f16vec4 _229 = modf(v4, tmp);
res = _229;
f16vec4 _231 = modf(v4, tmp);
res = _231;
res = min(v4, v4);
res = max(v4, v4);
res = clamp(v4, v4, v4);
@ -98,10 +99,10 @@ void test_builtins()
bvec4 btmp = isnan(v4);
btmp = isinf(v4);
res = fma(v4, v4, v4);
ResType _273;
_273._m0 = frexp(v4, _273._m1);
ivec4 itmp = _273._m1;
res = _273._m0;
ResType _275;
_275._m0 = frexp(v4, _275._m1);
ivec4 itmp = _275._m1;
res = _275._m0;
res = ldexp(res, itmp);
uint pack0 = packFloat2x16(v4.xy);
uint pack1 = packFloat2x16(v4.zw);

View File

@ -25,11 +25,12 @@ void test_constants()
{
float16_t a = 1.0hf;
float16_t b = 1.5hf;
float16_t c = -1.5hf;
float16_t d = (0.0hf / 0.0hf);
float16_t e = (1.0hf / 0.0hf);
float16_t f = (-1.0hf / 0.0hf);
float16_t g = 1014.0hf;
float16_t c = -1.5hf; // Negatives
float16_t d = (0.0hf / 0.0hf); // NaN
float16_t e = (1.0hf / 0.0hf); // +Inf
float16_t f = (-1.0hf / 0.0hf); // -Inf
float16_t g = 1014.0hf; // Large.
float16_t h = 0.000001hf; // Denormal
}
float16_t test_result()