Merge pull request #2821 from greg-lunarg/conv0

[RFC] add more negative float conversions to test constantUnaryConversion.comp and remove the undefined ones
This commit is contained in:
Greg Fischer 2021-11-15 14:49:53 -07:00 committed by GitHub
commit 8a7860e4cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 154 additions and 25 deletions

View File

@ -3,8 +3,8 @@ Shader version: 450
Requested GL_EXT_shader_explicit_arithmetic_types
local_size = (1, 1, 1)
0:? Sequence
0:48 Function Definition: main( ( global void)
0:48 Function Parameters:
0:69 Function Definition: main( ( global void)
0:69 Function Parameters:
0:? Linker Objects
0:? 'bool_init' ( const bool)
0:? true (const bool)
@ -29,6 +29,12 @@ local_size = (1, 1, 1)
0:? 'float32_t_init' ( const float)
0:? 13.000000
0:? 'float64_t_init' ( const double)
0:? 4.000000
0:? 'neg_float16_t_init' ( const float16_t)
0:? -42.000000
0:? 'neg_float32_t_init' ( const float)
0:? -13.000000
0:? 'neg_float64_t_init' ( const double)
0:? -4.000000
0:? 'bool_to_bool' ( const bool)
0:? true (const bool)
@ -77,7 +83,7 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_int8_t' ( const int8_t)
0:? 13 (const int8_t)
0:? 'float64_t_to_int8_t' ( const int8_t)
0:? -4 (const int8_t)
0:? 4 (const int8_t)
0:? 'bool_to_int16_t' ( const int16_t)
0:? 1 (const int16_t)
0:? 'int8_t_to_int16_t' ( const int16_t)
@ -101,7 +107,7 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_int16_t' ( const int16_t)
0:? 13 (const int16_t)
0:? 'float64_t_to_int16_t' ( const int16_t)
0:? -4 (const int16_t)
0:? 4 (const int16_t)
0:? 'bool_to_int32_t' ( const int)
0:? 1 (const int)
0:? 'int8_t_to_int32_t' ( const int)
@ -125,7 +131,7 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_int32_t' ( const int)
0:? 13 (const int)
0:? 'float64_t_to_int32_t' ( const int)
0:? -4 (const int)
0:? 4 (const int)
0:? 'bool_to_int64_t' ( const int64_t)
0:? 1 (const int64_t)
0:? 'int8_t_to_int64_t' ( const int64_t)
@ -149,7 +155,7 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_int64_t' ( const int64_t)
0:? 13 (const int64_t)
0:? 'float64_t_to_int64_t' ( const int64_t)
0:? -4 (const int64_t)
0:? 4 (const int64_t)
0:? 'bool_to_uint8_t' ( const uint8_t)
0:? 1 (const uint8_t)
0:? 'int8_t_to_uint8_t' ( const uint8_t)
@ -173,7 +179,7 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_uint8_t' ( const uint8_t)
0:? 13 (const uint8_t)
0:? 'float64_t_to_uint8_t' ( const uint8_t)
0:? 252 (const uint8_t)
0:? 4 (const uint8_t)
0:? 'bool_to_uint16_t' ( const uint16_t)
0:? 1 (const uint16_t)
0:? 'int8_t_to_uint16_t' ( const uint16_t)
@ -197,7 +203,7 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_uint16_t' ( const uint16_t)
0:? 13 (const uint16_t)
0:? 'float64_t_to_uint16_t' ( const uint16_t)
0:? 65532 (const uint16_t)
0:? 4 (const uint16_t)
0:? 'bool_to_uint32_t' ( const uint)
0:? 1 (const uint)
0:? 'int8_t_to_uint32_t' ( const uint)
@ -221,7 +227,7 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_uint32_t' ( const uint)
0:? 13 (const uint)
0:? 'float64_t_to_uint32_t' ( const uint)
0:? 4294967292 (const uint)
0:? 4 (const uint)
0:? 'bool_to_uint64_t' ( const uint64_t)
0:? 1 (const uint64_t)
0:? 'int8_t_to_uint64_t' ( const uint64_t)
@ -245,7 +251,7 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_uint64_t' ( const uint64_t)
0:? 13 (const uint64_t)
0:? 'float64_t_to_uint64_t' ( const uint64_t)
0:? 18446744073709551612 (const uint64_t)
0:? 4 (const uint64_t)
0:? 'bool_to_float16_t' ( const float16_t)
0:? 1.000000
0:? 'int8_t_to_float16_t' ( const float16_t)
@ -269,7 +275,7 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_float16_t' ( const float16_t)
0:? 13.000000
0:? 'float64_t_to_float16_t' ( const float16_t)
0:? -4.000000
0:? 4.000000
0:? 'bool_to_float32_t' ( const float)
0:? 1.000000
0:? 'int8_t_to_float32_t' ( const float)
@ -293,7 +299,7 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_float32_t' ( const float)
0:? 13.000000
0:? 'float64_t_to_float32_t' ( const float)
0:? -4.000000
0:? 4.000000
0:? 'bool_to_float64_t' ( const double)
0:? 1.000000
0:? 'int8_t_to_float64_t' ( const double)
@ -317,6 +323,54 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_float64_t' ( const double)
0:? 13.000000
0:? 'float64_t_to_float64_t' ( const double)
0:? 4.000000
0:? 'neg_float16_t_to_bool' ( const bool)
0:? true (const bool)
0:? 'neg_float32_t_to_bool' ( const bool)
0:? true (const bool)
0:? 'neg_float64_t_to_bool' ( const bool)
0:? true (const bool)
0:? 'neg_float16_t_to_int8_t' ( const int8_t)
0:? -42 (const int8_t)
0:? 'neg_float32_t_to_int8_t' ( const int8_t)
0:? -13 (const int8_t)
0:? 'neg_float64_t_to_int8_t' ( const int8_t)
0:? -4 (const int8_t)
0:? 'neg_float16_t_to_int16_t' ( const int16_t)
0:? -42 (const int16_t)
0:? 'neg_float32_t_to_int16_t' ( const int16_t)
0:? -13 (const int16_t)
0:? 'neg_float64_t_to_int16_t' ( const int16_t)
0:? -4 (const int16_t)
0:? 'neg_float16_t_to_int32_t' ( const int)
0:? -42 (const int)
0:? 'neg_float32_t_to_int32_t' ( const int)
0:? -13 (const int)
0:? 'neg_float64_t_to_int32_t' ( const int)
0:? -4 (const int)
0:? 'neg_float16_t_to_int64_t' ( const int64_t)
0:? -42 (const int64_t)
0:? 'neg_float32_t_to_int64_t' ( const int64_t)
0:? -13 (const int64_t)
0:? 'neg_float64_t_to_int64_t' ( const int64_t)
0:? -4 (const int64_t)
0:? 'neg_float16_t_to_float16_t' ( const float16_t)
0:? -42.000000
0:? 'neg_float32_t_to_float16_t' ( const float16_t)
0:? -13.000000
0:? 'neg_float64_t_to_float16_t' ( const float16_t)
0:? -4.000000
0:? 'neg_float16_t_to_float32_t' ( const float)
0:? -42.000000
0:? 'neg_float32_t_to_float32_t' ( const float)
0:? -13.000000
0:? 'neg_float64_t_to_float32_t' ( const float)
0:? -4.000000
0:? 'neg_float16_t_to_float64_t' ( const double)
0:? -42.000000
0:? 'neg_float32_t_to_float64_t' ( const double)
0:? -13.000000
0:? 'neg_float64_t_to_float64_t' ( const double)
0:? -4.000000
@ -327,8 +381,8 @@ Shader version: 450
Requested GL_EXT_shader_explicit_arithmetic_types
local_size = (1, 1, 1)
0:? Sequence
0:48 Function Definition: main( ( global void)
0:48 Function Parameters:
0:69 Function Definition: main( ( global void)
0:69 Function Parameters:
0:? Linker Objects
0:? 'bool_init' ( const bool)
0:? true (const bool)
@ -353,6 +407,12 @@ local_size = (1, 1, 1)
0:? 'float32_t_init' ( const float)
0:? 13.000000
0:? 'float64_t_init' ( const double)
0:? 4.000000
0:? 'neg_float16_t_init' ( const float16_t)
0:? -42.000000
0:? 'neg_float32_t_init' ( const float)
0:? -13.000000
0:? 'neg_float64_t_init' ( const double)
0:? -4.000000
0:? 'bool_to_bool' ( const bool)
0:? true (const bool)
@ -401,7 +461,7 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_int8_t' ( const int8_t)
0:? 13 (const int8_t)
0:? 'float64_t_to_int8_t' ( const int8_t)
0:? -4 (const int8_t)
0:? 4 (const int8_t)
0:? 'bool_to_int16_t' ( const int16_t)
0:? 1 (const int16_t)
0:? 'int8_t_to_int16_t' ( const int16_t)
@ -425,7 +485,7 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_int16_t' ( const int16_t)
0:? 13 (const int16_t)
0:? 'float64_t_to_int16_t' ( const int16_t)
0:? -4 (const int16_t)
0:? 4 (const int16_t)
0:? 'bool_to_int32_t' ( const int)
0:? 1 (const int)
0:? 'int8_t_to_int32_t' ( const int)
@ -449,7 +509,7 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_int32_t' ( const int)
0:? 13 (const int)
0:? 'float64_t_to_int32_t' ( const int)
0:? -4 (const int)
0:? 4 (const int)
0:? 'bool_to_int64_t' ( const int64_t)
0:? 1 (const int64_t)
0:? 'int8_t_to_int64_t' ( const int64_t)
@ -473,7 +533,7 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_int64_t' ( const int64_t)
0:? 13 (const int64_t)
0:? 'float64_t_to_int64_t' ( const int64_t)
0:? -4 (const int64_t)
0:? 4 (const int64_t)
0:? 'bool_to_uint8_t' ( const uint8_t)
0:? 1 (const uint8_t)
0:? 'int8_t_to_uint8_t' ( const uint8_t)
@ -497,7 +557,7 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_uint8_t' ( const uint8_t)
0:? 13 (const uint8_t)
0:? 'float64_t_to_uint8_t' ( const uint8_t)
0:? 252 (const uint8_t)
0:? 4 (const uint8_t)
0:? 'bool_to_uint16_t' ( const uint16_t)
0:? 1 (const uint16_t)
0:? 'int8_t_to_uint16_t' ( const uint16_t)
@ -521,7 +581,7 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_uint16_t' ( const uint16_t)
0:? 13 (const uint16_t)
0:? 'float64_t_to_uint16_t' ( const uint16_t)
0:? 65532 (const uint16_t)
0:? 4 (const uint16_t)
0:? 'bool_to_uint32_t' ( const uint)
0:? 1 (const uint)
0:? 'int8_t_to_uint32_t' ( const uint)
@ -545,7 +605,7 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_uint32_t' ( const uint)
0:? 13 (const uint)
0:? 'float64_t_to_uint32_t' ( const uint)
0:? 4294967292 (const uint)
0:? 4 (const uint)
0:? 'bool_to_uint64_t' ( const uint64_t)
0:? 1 (const uint64_t)
0:? 'int8_t_to_uint64_t' ( const uint64_t)
@ -569,7 +629,7 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_uint64_t' ( const uint64_t)
0:? 13 (const uint64_t)
0:? 'float64_t_to_uint64_t' ( const uint64_t)
0:? 18446744073709551612 (const uint64_t)
0:? 4 (const uint64_t)
0:? 'bool_to_float16_t' ( const float16_t)
0:? 1.000000
0:? 'int8_t_to_float16_t' ( const float16_t)
@ -593,7 +653,7 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_float16_t' ( const float16_t)
0:? 13.000000
0:? 'float64_t_to_float16_t' ( const float16_t)
0:? -4.000000
0:? 4.000000
0:? 'bool_to_float32_t' ( const float)
0:? 1.000000
0:? 'int8_t_to_float32_t' ( const float)
@ -617,7 +677,7 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_float32_t' ( const float)
0:? 13.000000
0:? 'float64_t_to_float32_t' ( const float)
0:? -4.000000
0:? 4.000000
0:? 'bool_to_float64_t' ( const double)
0:? 1.000000
0:? 'int8_t_to_float64_t' ( const double)
@ -641,5 +701,53 @@ local_size = (1, 1, 1)
0:? 'float32_t_to_float64_t' ( const double)
0:? 13.000000
0:? 'float64_t_to_float64_t' ( const double)
0:? 4.000000
0:? 'neg_float16_t_to_bool' ( const bool)
0:? true (const bool)
0:? 'neg_float32_t_to_bool' ( const bool)
0:? true (const bool)
0:? 'neg_float64_t_to_bool' ( const bool)
0:? true (const bool)
0:? 'neg_float16_t_to_int8_t' ( const int8_t)
0:? -42 (const int8_t)
0:? 'neg_float32_t_to_int8_t' ( const int8_t)
0:? -13 (const int8_t)
0:? 'neg_float64_t_to_int8_t' ( const int8_t)
0:? -4 (const int8_t)
0:? 'neg_float16_t_to_int16_t' ( const int16_t)
0:? -42 (const int16_t)
0:? 'neg_float32_t_to_int16_t' ( const int16_t)
0:? -13 (const int16_t)
0:? 'neg_float64_t_to_int16_t' ( const int16_t)
0:? -4 (const int16_t)
0:? 'neg_float16_t_to_int32_t' ( const int)
0:? -42 (const int)
0:? 'neg_float32_t_to_int32_t' ( const int)
0:? -13 (const int)
0:? 'neg_float64_t_to_int32_t' ( const int)
0:? -4 (const int)
0:? 'neg_float16_t_to_int64_t' ( const int64_t)
0:? -42 (const int64_t)
0:? 'neg_float32_t_to_int64_t' ( const int64_t)
0:? -13 (const int64_t)
0:? 'neg_float64_t_to_int64_t' ( const int64_t)
0:? -4 (const int64_t)
0:? 'neg_float16_t_to_float16_t' ( const float16_t)
0:? -42.000000
0:? 'neg_float32_t_to_float16_t' ( const float16_t)
0:? -13.000000
0:? 'neg_float64_t_to_float16_t' ( const float16_t)
0:? -4.000000
0:? 'neg_float16_t_to_float32_t' ( const float)
0:? -42.000000
0:? 'neg_float32_t_to_float32_t' ( const float)
0:? -13.000000
0:? 'neg_float64_t_to_float32_t' ( const float)
0:? -4.000000
0:? 'neg_float16_t_to_float64_t' ( const double)
0:? -42.000000
0:? 'neg_float32_t_to_float64_t' ( const double)
0:? -13.000000
0:? 'neg_float64_t_to_float64_t' ( const double)
0:? -4.000000

View File

@ -13,11 +13,18 @@ const uint32_t uint32_t_init = uint32_t(3);
const uint64_t uint64_t_init = uint64_t(4);
const float16_t float16_t_init = float16_t(42.0);
const float32_t float32_t_init = float32_t(13.0);
const float64_t float64_t_init = float64_t(-4.0);
const float64_t float64_t_init = float64_t(4.0);
const float16_t neg_float16_t_init = float16_t(-42.0);
const float32_t neg_float32_t_init = float32_t(-13.0);
const float64_t neg_float64_t_init = float64_t(-4.0);
#define TYPE_TO_TYPE(x, y) \
const x y##_to_##x = x(y##_init)
#define TYPE_TO_TYPE_PREFIX(prefix, x, y) \
const x prefix##_##y##_to_##x = x(prefix##_##y##_init)
#define TYPE_TO(x) \
TYPE_TO_TYPE(x, bool); \
TYPE_TO_TYPE(x, int8_t); \
@ -45,4 +52,18 @@ TYPE_TO(float16_t);
TYPE_TO(float32_t);
TYPE_TO(float64_t);
#define NEG_FLOAT_TO(x) \
TYPE_TO_TYPE_PREFIX(neg, x, float16_t); \
TYPE_TO_TYPE_PREFIX(neg, x, float32_t); \
TYPE_TO_TYPE_PREFIX(neg, x, float64_t)
NEG_FLOAT_TO(bool);
NEG_FLOAT_TO(int8_t);
NEG_FLOAT_TO(int16_t);
NEG_FLOAT_TO(int32_t);
NEG_FLOAT_TO(int64_t);
NEG_FLOAT_TO(float16_t);
NEG_FLOAT_TO(float32_t);
NEG_FLOAT_TO(float64_t);
void main() {}