From 4b5c498923041272d9cb1bcea06e1f8ed7bc6f2b Mon Sep 17 00:00:00 2001 From: Jeff Bolz Date: Fri, 21 Jun 2019 23:39:05 -0500 Subject: [PATCH] Add a bunch of missing cases to promoteConstantUnion. Use macros to expand all the cases more simply. --- .../constantUnaryConversion.comp.out | 320 +++++++++--------- Test/baseResults/spv.constConstruct.vert.out | 269 ++++++++------- glslang/MachineIndependent/Intermediate.cpp | 245 ++------------ 3 files changed, 335 insertions(+), 499 deletions(-) diff --git a/Test/baseResults/constantUnaryConversion.comp.out b/Test/baseResults/constantUnaryConversion.comp.out index 4117e93f..fcaf6f22 100644 --- a/Test/baseResults/constantUnaryConversion.comp.out +++ b/Test/baseResults/constantUnaryConversion.comp.out @@ -9,17 +9,17 @@ local_size = (1, 1, 1) 0:? 'bool_init' ( const bool) 0:? true (const bool) 0:? 'int8_t_init' ( const int8_t) -0:? -1 (const int) +0:? -1 (const int8_t) 0:? 'int16_t_init' ( const int16_t) -0:? -2 (const int) +0:? -2 (const int16_t) 0:? 'int32_t_init' ( const int) 0:? -3 (const int) 0:? 'int64_t_init' ( const int64_t) 0:? -4 (const int64_t) 0:? 'uint8_t_init' ( const uint8_t) -0:? 1 (const int) +0:? 1 (const uint8_t) 0:? 'uint16_t_init' ( const uint16_t) -0:? 2 (const int) +0:? 2 (const uint16_t) 0:? 'uint32_t_init' ( const uint) 0:? 3 (const uint) 0:? 'uint64_t_init' ( const uint64_t) @@ -33,17 +33,17 @@ local_size = (1, 1, 1) 0:? 'bool_to_bool' ( const bool) 0:? true (const bool) 0:? 'int8_t_to_bool' ( const bool) -0:? -1 (const int) +0:? true (const bool) 0:? 'int16_t_to_bool' ( const bool) -0:? -2 (const int) +0:? true (const bool) 0:? 'int32_t_to_bool' ( const bool) 0:? true (const bool) 0:? 'int64_t_to_bool' ( const bool) 0:? true (const bool) 0:? 'uint8_t_to_bool' ( const bool) -0:? 1 (const int) +0:? true (const bool) 0:? 'uint16_t_to_bool' ( const bool) -0:? 2 (const int) +0:? true (const bool) 0:? 'uint32_t_to_bool' ( const bool) 0:? true (const bool) 0:? 'uint64_t_to_bool' ( const bool) @@ -55,53 +55,53 @@ local_size = (1, 1, 1) 0:? 'float64_t_to_bool' ( const bool) 0:? true (const bool) 0:? 'bool_to_int8_t' ( const int8_t) -0:? true (const bool) +0:? 1 (const int8_t) 0:? 'int8_t_to_int8_t' ( const int8_t) -0:? -1 (const int) +0:? -1 (const int8_t) 0:? 'int16_t_to_int8_t' ( const int8_t) -0:? -2 (const int) +0:? -2 (const int8_t) 0:? 'int32_t_to_int8_t' ( const int8_t) -0:? -3 (const int) +0:? -3 (const int8_t) 0:? 'int64_t_to_int8_t' ( const int8_t) -0:? -4 (const int64_t) +0:? -4 (const int8_t) 0:? 'uint8_t_to_int8_t' ( const int8_t) -0:? 1 (const int) +0:? 1 (const int8_t) 0:? 'uint16_t_to_int8_t' ( const int8_t) -0:? 2 (const int) +0:? 2 (const int8_t) 0:? 'uint32_t_to_int8_t' ( const int8_t) -0:? 3 (const uint) +0:? 3 (const int8_t) 0:? 'uint64_t_to_int8_t' ( const int8_t) -0:? 4 (const uint64_t) +0:? 4 (const int8_t) 0:? 'float16_t_to_int8_t' ( const int8_t) -0:? 42.000000 +0:? 42 (const int8_t) 0:? 'float32_t_to_int8_t' ( const int8_t) -0:? 13.000000 +0:? 13 (const int8_t) 0:? 'float64_t_to_int8_t' ( const int8_t) -0:? -4.000000 +0:? -4 (const int8_t) 0:? 'bool_to_int16_t' ( const int16_t) -0:? true (const bool) +0:? 1 (const int16_t) 0:? 'int8_t_to_int16_t' ( const int16_t) -0:? -1 (const int) +0:? -1 (const int16_t) 0:? 'int16_t_to_int16_t' ( const int16_t) -0:? -2 (const int) +0:? -2 (const int16_t) 0:? 'int32_t_to_int16_t' ( const int16_t) -0:? -3 (const int) +0:? -3 (const int16_t) 0:? 'int64_t_to_int16_t' ( const int16_t) -0:? -4 (const int64_t) +0:? -4 (const int16_t) 0:? 'uint8_t_to_int16_t' ( const int16_t) -0:? 1 (const int) +0:? 1 (const int16_t) 0:? 'uint16_t_to_int16_t' ( const int16_t) -0:? 2 (const int) +0:? 2 (const int16_t) 0:? 'uint32_t_to_int16_t' ( const int16_t) -0:? 3 (const uint) +0:? 3 (const int16_t) 0:? 'uint64_t_to_int16_t' ( const int16_t) -0:? 4 (const uint64_t) +0:? 4 (const int16_t) 0:? 'float16_t_to_int16_t' ( const int16_t) -0:? 42.000000 +0:? 42 (const int16_t) 0:? 'float32_t_to_int16_t' ( const int16_t) -0:? 13.000000 +0:? 13 (const int16_t) 0:? 'float64_t_to_int16_t' ( const int16_t) -0:? -4.000000 +0:? -4 (const int16_t) 0:? 'bool_to_int32_t' ( const int) 0:? 1 (const int) 0:? 'int8_t_to_int32_t' ( const int) @@ -129,17 +129,17 @@ local_size = (1, 1, 1) 0:? 'bool_to_int64_t' ( const int64_t) 0:? 1 (const int64_t) 0:? 'int8_t_to_int64_t' ( const int64_t) -0:? -1 (const int) +0:? -1 (const int64_t) 0:? 'int16_t_to_int64_t' ( const int64_t) -0:? -2 (const int) +0:? -2 (const int64_t) 0:? 'int32_t_to_int64_t' ( const int64_t) 0:? -3 (const int64_t) 0:? 'int64_t_to_int64_t' ( const int64_t) 0:? -4 (const int64_t) 0:? 'uint8_t_to_int64_t' ( const int64_t) -0:? 1 (const int) +0:? 1 (const int64_t) 0:? 'uint16_t_to_int64_t' ( const int64_t) -0:? 2 (const int) +0:? 2 (const int64_t) 0:? 'uint32_t_to_int64_t' ( const int64_t) 0:? 3 (const int64_t) 0:? 'uint64_t_to_int64_t' ( const int64_t) @@ -151,67 +151,67 @@ local_size = (1, 1, 1) 0:? 'float64_t_to_int64_t' ( const int64_t) 0:? -4 (const int64_t) 0:? 'bool_to_uint8_t' ( const uint8_t) -0:? true (const bool) +0:? 1 (const uint8_t) 0:? 'int8_t_to_uint8_t' ( const uint8_t) -0:? -1 (const int) +0:? 255 (const uint8_t) 0:? 'int16_t_to_uint8_t' ( const uint8_t) -0:? -2 (const int) +0:? 254 (const uint8_t) 0:? 'int32_t_to_uint8_t' ( const uint8_t) -0:? -3 (const int) +0:? 253 (const uint8_t) 0:? 'int64_t_to_uint8_t' ( const uint8_t) -0:? -4 (const int64_t) +0:? 252 (const uint8_t) 0:? 'uint8_t_to_uint8_t' ( const uint8_t) -0:? 1 (const int) +0:? 1 (const uint8_t) 0:? 'uint16_t_to_uint8_t' ( const uint8_t) -0:? 2 (const int) +0:? 2 (const uint8_t) 0:? 'uint32_t_to_uint8_t' ( const uint8_t) -0:? 3 (const uint) +0:? 3 (const uint8_t) 0:? 'uint64_t_to_uint8_t' ( const uint8_t) -0:? 4 (const uint64_t) +0:? 4 (const uint8_t) 0:? 'float16_t_to_uint8_t' ( const uint8_t) -0:? 42.000000 +0:? 42 (const uint8_t) 0:? 'float32_t_to_uint8_t' ( const uint8_t) -0:? 13.000000 +0:? 13 (const uint8_t) 0:? 'float64_t_to_uint8_t' ( const uint8_t) -0:? -4.000000 +0:? 252 (const uint8_t) 0:? 'bool_to_uint16_t' ( const uint16_t) -0:? true (const bool) +0:? 1 (const uint16_t) 0:? 'int8_t_to_uint16_t' ( const uint16_t) -0:? -1 (const int) +0:? 65535 (const uint16_t) 0:? 'int16_t_to_uint16_t' ( const uint16_t) -0:? -2 (const int) +0:? 65534 (const uint16_t) 0:? 'int32_t_to_uint16_t' ( const uint16_t) -0:? -3 (const int) +0:? 65533 (const uint16_t) 0:? 'int64_t_to_uint16_t' ( const uint16_t) -0:? -4 (const int64_t) +0:? 65532 (const uint16_t) 0:? 'uint8_t_to_uint16_t' ( const uint16_t) -0:? 1 (const int) +0:? 1 (const uint16_t) 0:? 'uint16_t_to_uint16_t' ( const uint16_t) -0:? 2 (const int) +0:? 2 (const uint16_t) 0:? 'uint32_t_to_uint16_t' ( const uint16_t) -0:? 3 (const uint) +0:? 3 (const uint16_t) 0:? 'uint64_t_to_uint16_t' ( const uint16_t) -0:? 4 (const uint64_t) +0:? 4 (const uint16_t) 0:? 'float16_t_to_uint16_t' ( const uint16_t) -0:? 42.000000 +0:? 42 (const uint16_t) 0:? 'float32_t_to_uint16_t' ( const uint16_t) -0:? 13.000000 +0:? 13 (const uint16_t) 0:? 'float64_t_to_uint16_t' ( const uint16_t) -0:? -4.000000 +0:? 65532 (const uint16_t) 0:? 'bool_to_uint32_t' ( const uint) 0:? 1 (const uint) 0:? 'int8_t_to_uint32_t' ( const uint) -0:? -1 (const int) +0:? 4294967295 (const uint) 0:? 'int16_t_to_uint32_t' ( const uint) -0:? -2 (const int) +0:? 4294967294 (const uint) 0:? 'int32_t_to_uint32_t' ( const uint) 0:? 4294967293 (const uint) 0:? 'int64_t_to_uint32_t' ( const uint) 0:? 4294967292 (const uint) 0:? 'uint8_t_to_uint32_t' ( const uint) -0:? 1 (const int) +0:? 1 (const uint) 0:? 'uint16_t_to_uint32_t' ( const uint) -0:? 2 (const int) +0:? 2 (const uint) 0:? 'uint32_t_to_uint32_t' ( const uint) 0:? 3 (const uint) 0:? 'uint64_t_to_uint32_t' ( const uint) @@ -225,17 +225,17 @@ local_size = (1, 1, 1) 0:? 'bool_to_uint64_t' ( const uint64_t) 0:? 1 (const uint64_t) 0:? 'int8_t_to_uint64_t' ( const uint64_t) -0:? -1 (const int) +0:? 18446744073709551615 (const uint64_t) 0:? 'int16_t_to_uint64_t' ( const uint64_t) -0:? -2 (const int) +0:? 18446744073709551614 (const uint64_t) 0:? 'int32_t_to_uint64_t' ( const uint64_t) 0:? 18446744073709551613 (const uint64_t) 0:? 'int64_t_to_uint64_t' ( const uint64_t) 0:? 18446744073709551612 (const uint64_t) 0:? 'uint8_t_to_uint64_t' ( const uint64_t) -0:? 1 (const int) +0:? 1 (const uint64_t) 0:? 'uint16_t_to_uint64_t' ( const uint64_t) -0:? 2 (const int) +0:? 2 (const uint64_t) 0:? 'uint32_t_to_uint64_t' ( const uint64_t) 0:? 3 (const uint64_t) 0:? 'uint64_t_to_uint64_t' ( const uint64_t) @@ -249,17 +249,17 @@ local_size = (1, 1, 1) 0:? 'bool_to_float16_t' ( const float16_t) 0:? 1.000000 0:? 'int8_t_to_float16_t' ( const float16_t) -0:? -1 (const int) +0:? -1.000000 0:? 'int16_t_to_float16_t' ( const float16_t) -0:? -2 (const int) +0:? -2.000000 0:? 'int32_t_to_float16_t' ( const float16_t) 0:? -3.000000 0:? 'int64_t_to_float16_t' ( const float16_t) 0:? -4.000000 0:? 'uint8_t_to_float16_t' ( const float16_t) -0:? 1 (const int) +0:? 1.000000 0:? 'uint16_t_to_float16_t' ( const float16_t) -0:? 2 (const int) +0:? 2.000000 0:? 'uint32_t_to_float16_t' ( const float16_t) 0:? 3.000000 0:? 'uint64_t_to_float16_t' ( const float16_t) @@ -273,17 +273,17 @@ local_size = (1, 1, 1) 0:? 'bool_to_float32_t' ( const float) 0:? 1.000000 0:? 'int8_t_to_float32_t' ( const float) -0:? -1 (const int) +0:? -1.000000 0:? 'int16_t_to_float32_t' ( const float) -0:? -2 (const int) +0:? -2.000000 0:? 'int32_t_to_float32_t' ( const float) 0:? -3.000000 0:? 'int64_t_to_float32_t' ( const float) 0:? -4.000000 0:? 'uint8_t_to_float32_t' ( const float) -0:? 1 (const int) +0:? 1.000000 0:? 'uint16_t_to_float32_t' ( const float) -0:? 2 (const int) +0:? 2.000000 0:? 'uint32_t_to_float32_t' ( const float) 0:? 3.000000 0:? 'uint64_t_to_float32_t' ( const float) @@ -297,17 +297,17 @@ local_size = (1, 1, 1) 0:? 'bool_to_float64_t' ( const double) 0:? 1.000000 0:? 'int8_t_to_float64_t' ( const double) -0:? -1 (const int) +0:? -1.000000 0:? 'int16_t_to_float64_t' ( const double) -0:? -2 (const int) +0:? -2.000000 0:? 'int32_t_to_float64_t' ( const double) 0:? -3.000000 0:? 'int64_t_to_float64_t' ( const double) 0:? -4.000000 0:? 'uint8_t_to_float64_t' ( const double) -0:? 1 (const int) +0:? 1.000000 0:? 'uint16_t_to_float64_t' ( const double) -0:? 2 (const int) +0:? 2.000000 0:? 'uint32_t_to_float64_t' ( const double) 0:? 3.000000 0:? 'uint64_t_to_float64_t' ( const double) @@ -333,17 +333,17 @@ local_size = (1, 1, 1) 0:? 'bool_init' ( const bool) 0:? true (const bool) 0:? 'int8_t_init' ( const int8_t) -0:? -1 (const int) +0:? -1 (const int8_t) 0:? 'int16_t_init' ( const int16_t) -0:? -2 (const int) +0:? -2 (const int16_t) 0:? 'int32_t_init' ( const int) 0:? -3 (const int) 0:? 'int64_t_init' ( const int64_t) 0:? -4 (const int64_t) 0:? 'uint8_t_init' ( const uint8_t) -0:? 1 (const int) +0:? 1 (const uint8_t) 0:? 'uint16_t_init' ( const uint16_t) -0:? 2 (const int) +0:? 2 (const uint16_t) 0:? 'uint32_t_init' ( const uint) 0:? 3 (const uint) 0:? 'uint64_t_init' ( const uint64_t) @@ -357,17 +357,17 @@ local_size = (1, 1, 1) 0:? 'bool_to_bool' ( const bool) 0:? true (const bool) 0:? 'int8_t_to_bool' ( const bool) -0:? -1 (const int) +0:? true (const bool) 0:? 'int16_t_to_bool' ( const bool) -0:? -2 (const int) +0:? true (const bool) 0:? 'int32_t_to_bool' ( const bool) 0:? true (const bool) 0:? 'int64_t_to_bool' ( const bool) 0:? true (const bool) 0:? 'uint8_t_to_bool' ( const bool) -0:? 1 (const int) +0:? true (const bool) 0:? 'uint16_t_to_bool' ( const bool) -0:? 2 (const int) +0:? true (const bool) 0:? 'uint32_t_to_bool' ( const bool) 0:? true (const bool) 0:? 'uint64_t_to_bool' ( const bool) @@ -379,53 +379,53 @@ local_size = (1, 1, 1) 0:? 'float64_t_to_bool' ( const bool) 0:? true (const bool) 0:? 'bool_to_int8_t' ( const int8_t) -0:? true (const bool) +0:? 1 (const int8_t) 0:? 'int8_t_to_int8_t' ( const int8_t) -0:? -1 (const int) +0:? -1 (const int8_t) 0:? 'int16_t_to_int8_t' ( const int8_t) -0:? -2 (const int) +0:? -2 (const int8_t) 0:? 'int32_t_to_int8_t' ( const int8_t) -0:? -3 (const int) +0:? -3 (const int8_t) 0:? 'int64_t_to_int8_t' ( const int8_t) -0:? -4 (const int64_t) +0:? -4 (const int8_t) 0:? 'uint8_t_to_int8_t' ( const int8_t) -0:? 1 (const int) +0:? 1 (const int8_t) 0:? 'uint16_t_to_int8_t' ( const int8_t) -0:? 2 (const int) +0:? 2 (const int8_t) 0:? 'uint32_t_to_int8_t' ( const int8_t) -0:? 3 (const uint) +0:? 3 (const int8_t) 0:? 'uint64_t_to_int8_t' ( const int8_t) -0:? 4 (const uint64_t) +0:? 4 (const int8_t) 0:? 'float16_t_to_int8_t' ( const int8_t) -0:? 42.000000 +0:? 42 (const int8_t) 0:? 'float32_t_to_int8_t' ( const int8_t) -0:? 13.000000 +0:? 13 (const int8_t) 0:? 'float64_t_to_int8_t' ( const int8_t) -0:? -4.000000 +0:? -4 (const int8_t) 0:? 'bool_to_int16_t' ( const int16_t) -0:? true (const bool) +0:? 1 (const int16_t) 0:? 'int8_t_to_int16_t' ( const int16_t) -0:? -1 (const int) +0:? -1 (const int16_t) 0:? 'int16_t_to_int16_t' ( const int16_t) -0:? -2 (const int) +0:? -2 (const int16_t) 0:? 'int32_t_to_int16_t' ( const int16_t) -0:? -3 (const int) +0:? -3 (const int16_t) 0:? 'int64_t_to_int16_t' ( const int16_t) -0:? -4 (const int64_t) +0:? -4 (const int16_t) 0:? 'uint8_t_to_int16_t' ( const int16_t) -0:? 1 (const int) +0:? 1 (const int16_t) 0:? 'uint16_t_to_int16_t' ( const int16_t) -0:? 2 (const int) +0:? 2 (const int16_t) 0:? 'uint32_t_to_int16_t' ( const int16_t) -0:? 3 (const uint) +0:? 3 (const int16_t) 0:? 'uint64_t_to_int16_t' ( const int16_t) -0:? 4 (const uint64_t) +0:? 4 (const int16_t) 0:? 'float16_t_to_int16_t' ( const int16_t) -0:? 42.000000 +0:? 42 (const int16_t) 0:? 'float32_t_to_int16_t' ( const int16_t) -0:? 13.000000 +0:? 13 (const int16_t) 0:? 'float64_t_to_int16_t' ( const int16_t) -0:? -4.000000 +0:? -4 (const int16_t) 0:? 'bool_to_int32_t' ( const int) 0:? 1 (const int) 0:? 'int8_t_to_int32_t' ( const int) @@ -453,17 +453,17 @@ local_size = (1, 1, 1) 0:? 'bool_to_int64_t' ( const int64_t) 0:? 1 (const int64_t) 0:? 'int8_t_to_int64_t' ( const int64_t) -0:? -1 (const int) +0:? -1 (const int64_t) 0:? 'int16_t_to_int64_t' ( const int64_t) -0:? -2 (const int) +0:? -2 (const int64_t) 0:? 'int32_t_to_int64_t' ( const int64_t) 0:? -3 (const int64_t) 0:? 'int64_t_to_int64_t' ( const int64_t) 0:? -4 (const int64_t) 0:? 'uint8_t_to_int64_t' ( const int64_t) -0:? 1 (const int) +0:? 1 (const int64_t) 0:? 'uint16_t_to_int64_t' ( const int64_t) -0:? 2 (const int) +0:? 2 (const int64_t) 0:? 'uint32_t_to_int64_t' ( const int64_t) 0:? 3 (const int64_t) 0:? 'uint64_t_to_int64_t' ( const int64_t) @@ -475,67 +475,67 @@ local_size = (1, 1, 1) 0:? 'float64_t_to_int64_t' ( const int64_t) 0:? -4 (const int64_t) 0:? 'bool_to_uint8_t' ( const uint8_t) -0:? true (const bool) +0:? 1 (const uint8_t) 0:? 'int8_t_to_uint8_t' ( const uint8_t) -0:? -1 (const int) +0:? 255 (const uint8_t) 0:? 'int16_t_to_uint8_t' ( const uint8_t) -0:? -2 (const int) +0:? 254 (const uint8_t) 0:? 'int32_t_to_uint8_t' ( const uint8_t) -0:? -3 (const int) +0:? 253 (const uint8_t) 0:? 'int64_t_to_uint8_t' ( const uint8_t) -0:? -4 (const int64_t) +0:? 252 (const uint8_t) 0:? 'uint8_t_to_uint8_t' ( const uint8_t) -0:? 1 (const int) +0:? 1 (const uint8_t) 0:? 'uint16_t_to_uint8_t' ( const uint8_t) -0:? 2 (const int) +0:? 2 (const uint8_t) 0:? 'uint32_t_to_uint8_t' ( const uint8_t) -0:? 3 (const uint) +0:? 3 (const uint8_t) 0:? 'uint64_t_to_uint8_t' ( const uint8_t) -0:? 4 (const uint64_t) +0:? 4 (const uint8_t) 0:? 'float16_t_to_uint8_t' ( const uint8_t) -0:? 42.000000 +0:? 42 (const uint8_t) 0:? 'float32_t_to_uint8_t' ( const uint8_t) -0:? 13.000000 +0:? 13 (const uint8_t) 0:? 'float64_t_to_uint8_t' ( const uint8_t) -0:? -4.000000 +0:? 252 (const uint8_t) 0:? 'bool_to_uint16_t' ( const uint16_t) -0:? true (const bool) +0:? 1 (const uint16_t) 0:? 'int8_t_to_uint16_t' ( const uint16_t) -0:? -1 (const int) +0:? 65535 (const uint16_t) 0:? 'int16_t_to_uint16_t' ( const uint16_t) -0:? -2 (const int) +0:? 65534 (const uint16_t) 0:? 'int32_t_to_uint16_t' ( const uint16_t) -0:? -3 (const int) +0:? 65533 (const uint16_t) 0:? 'int64_t_to_uint16_t' ( const uint16_t) -0:? -4 (const int64_t) +0:? 65532 (const uint16_t) 0:? 'uint8_t_to_uint16_t' ( const uint16_t) -0:? 1 (const int) +0:? 1 (const uint16_t) 0:? 'uint16_t_to_uint16_t' ( const uint16_t) -0:? 2 (const int) +0:? 2 (const uint16_t) 0:? 'uint32_t_to_uint16_t' ( const uint16_t) -0:? 3 (const uint) +0:? 3 (const uint16_t) 0:? 'uint64_t_to_uint16_t' ( const uint16_t) -0:? 4 (const uint64_t) +0:? 4 (const uint16_t) 0:? 'float16_t_to_uint16_t' ( const uint16_t) -0:? 42.000000 +0:? 42 (const uint16_t) 0:? 'float32_t_to_uint16_t' ( const uint16_t) -0:? 13.000000 +0:? 13 (const uint16_t) 0:? 'float64_t_to_uint16_t' ( const uint16_t) -0:? -4.000000 +0:? 65532 (const uint16_t) 0:? 'bool_to_uint32_t' ( const uint) 0:? 1 (const uint) 0:? 'int8_t_to_uint32_t' ( const uint) -0:? -1 (const int) +0:? 4294967295 (const uint) 0:? 'int16_t_to_uint32_t' ( const uint) -0:? -2 (const int) +0:? 4294967294 (const uint) 0:? 'int32_t_to_uint32_t' ( const uint) 0:? 4294967293 (const uint) 0:? 'int64_t_to_uint32_t' ( const uint) 0:? 4294967292 (const uint) 0:? 'uint8_t_to_uint32_t' ( const uint) -0:? 1 (const int) +0:? 1 (const uint) 0:? 'uint16_t_to_uint32_t' ( const uint) -0:? 2 (const int) +0:? 2 (const uint) 0:? 'uint32_t_to_uint32_t' ( const uint) 0:? 3 (const uint) 0:? 'uint64_t_to_uint32_t' ( const uint) @@ -549,17 +549,17 @@ local_size = (1, 1, 1) 0:? 'bool_to_uint64_t' ( const uint64_t) 0:? 1 (const uint64_t) 0:? 'int8_t_to_uint64_t' ( const uint64_t) -0:? -1 (const int) +0:? 18446744073709551615 (const uint64_t) 0:? 'int16_t_to_uint64_t' ( const uint64_t) -0:? -2 (const int) +0:? 18446744073709551614 (const uint64_t) 0:? 'int32_t_to_uint64_t' ( const uint64_t) 0:? 18446744073709551613 (const uint64_t) 0:? 'int64_t_to_uint64_t' ( const uint64_t) 0:? 18446744073709551612 (const uint64_t) 0:? 'uint8_t_to_uint64_t' ( const uint64_t) -0:? 1 (const int) +0:? 1 (const uint64_t) 0:? 'uint16_t_to_uint64_t' ( const uint64_t) -0:? 2 (const int) +0:? 2 (const uint64_t) 0:? 'uint32_t_to_uint64_t' ( const uint64_t) 0:? 3 (const uint64_t) 0:? 'uint64_t_to_uint64_t' ( const uint64_t) @@ -573,17 +573,17 @@ local_size = (1, 1, 1) 0:? 'bool_to_float16_t' ( const float16_t) 0:? 1.000000 0:? 'int8_t_to_float16_t' ( const float16_t) -0:? -1 (const int) +0:? -1.000000 0:? 'int16_t_to_float16_t' ( const float16_t) -0:? -2 (const int) +0:? -2.000000 0:? 'int32_t_to_float16_t' ( const float16_t) 0:? -3.000000 0:? 'int64_t_to_float16_t' ( const float16_t) 0:? -4.000000 0:? 'uint8_t_to_float16_t' ( const float16_t) -0:? 1 (const int) +0:? 1.000000 0:? 'uint16_t_to_float16_t' ( const float16_t) -0:? 2 (const int) +0:? 2.000000 0:? 'uint32_t_to_float16_t' ( const float16_t) 0:? 3.000000 0:? 'uint64_t_to_float16_t' ( const float16_t) @@ -597,17 +597,17 @@ local_size = (1, 1, 1) 0:? 'bool_to_float32_t' ( const float) 0:? 1.000000 0:? 'int8_t_to_float32_t' ( const float) -0:? -1 (const int) +0:? -1.000000 0:? 'int16_t_to_float32_t' ( const float) -0:? -2 (const int) +0:? -2.000000 0:? 'int32_t_to_float32_t' ( const float) 0:? -3.000000 0:? 'int64_t_to_float32_t' ( const float) 0:? -4.000000 0:? 'uint8_t_to_float32_t' ( const float) -0:? 1 (const int) +0:? 1.000000 0:? 'uint16_t_to_float32_t' ( const float) -0:? 2 (const int) +0:? 2.000000 0:? 'uint32_t_to_float32_t' ( const float) 0:? 3.000000 0:? 'uint64_t_to_float32_t' ( const float) @@ -621,17 +621,17 @@ local_size = (1, 1, 1) 0:? 'bool_to_float64_t' ( const double) 0:? 1.000000 0:? 'int8_t_to_float64_t' ( const double) -0:? -1 (const int) +0:? -1.000000 0:? 'int16_t_to_float64_t' ( const double) -0:? -2 (const int) +0:? -2.000000 0:? 'int32_t_to_float64_t' ( const double) 0:? -3.000000 0:? 'int64_t_to_float64_t' ( const double) 0:? -4.000000 0:? 'uint8_t_to_float64_t' ( const double) -0:? 1 (const int) +0:? 1.000000 0:? 'uint16_t_to_float64_t' ( const double) -0:? 2 (const int) +0:? 2.000000 0:? 'uint32_t_to_float64_t' ( const double) 0:? 3.000000 0:? 'uint64_t_to_float64_t' ( const double) diff --git a/Test/baseResults/spv.constConstruct.vert.out b/Test/baseResults/spv.constConstruct.vert.out index 12f4c300..5922b34a 100644 --- a/Test/baseResults/spv.constConstruct.vert.out +++ b/Test/baseResults/spv.constConstruct.vert.out @@ -2,7 +2,7 @@ spv.constConstruct.vert Validation failed // Module Version 10000 // Generated by (magic number): 80007 -// Id's are bound by 137 +// Id's are bound by 150 Capability Shader Capability Float64 @@ -25,133 +25,146 @@ Validation failed 7:6(float16_t) Constant 15360 8:6(float16_t) Constant 16384 9:6(float16_t) Constant 16896 - 10:6(float16_t) Constant 0 - 11:6(float16_t) Constant 17920 - 12:6(float16_t) Constant 18176 - 13:6(float16_t) Constant 18688 - 14:6(float16_t) Constant 18816 - 15: TypeFloat 32 - 16: 15(float) Constant 1099431936 - 17: 15(float) Constant 1099956224 - 18: 15(float) Constant 1100480512 - 19: 15(float) Constant 2139095040 - 20: 15(float) Constant 0 - 21: 15(float) Constant 1102053376 - 22: 15(float) Constant 1102577664 - 23: 15(float) Constant 1104150528 - 24: 15(float) Constant 1104674816 - 25: 15(float) Constant 1065353216 - 26: TypeFloat 64 - 27:26(float64_t) Constant 0 1077968896 - 28:26(float64_t) Constant 0 1078001664 - 29:26(float64_t) Constant 0 1078034432 - 30:26(float64_t) Constant 36 0 - 31:26(float64_t) Constant 37 0 - 32:26(float64_t) Constant 0 1078132736 - 33:26(float64_t) Constant 0 1078165504 - 34:26(float64_t) Constant 40 0 - 35:26(float64_t) Constant 41 0 - 36:26(float64_t) Constant 0 1078263808 - 37:26(float64_t) Constant 0 1078296576 - 38:26(float64_t) Constant 0 1072693248 - 39: TypeInt 8 1 - 40: 39(int8_t) Constant 0 - 41: 39(int8_t) Constant 52 - 42: 39(int8_t) Constant 53 - 43: 39(int8_t) Constant 54 - 44: 39(int8_t) Constant 55 - 45: 39(int8_t) Constant 56 - 46: 39(int8_t) Constant 57 - 47: 39(int8_t) Constant 58 - 48: 39(int8_t) Constant 59 - 49: 39(int8_t) Constant 1 - 50: TypeInt 16 1 - 51: 50(int16_t) Constant 0 - 52: 50(int16_t) Constant 68 - 53: 50(int16_t) Constant 69 - 54: 50(int16_t) Constant 70 - 55: 50(int16_t) Constant 71 - 56: 50(int16_t) Constant 72 - 57: 50(int16_t) Constant 73 - 58: 50(int16_t) Constant 74 - 59: 50(int16_t) Constant 75 - 60: 50(int16_t) Constant 1 - 61: TypeInt 32 1 - 62: 61(int) Constant 81 - 63: 61(int) Constant 82 - 64: 61(int) Constant 83 - 65: 61(int) Constant 84 - 66: 61(int) Constant 85 - 67: 61(int) Constant 86 - 68: 61(int) Constant 87 - 69: 61(int) Constant 88 - 70: 61(int) Constant 89 - 71: 61(int) Constant 90 - 72: 61(int) Constant 91 - 73: 61(int) Constant 1 - 74: TypeInt 64 1 - 75: 74(int64_t) Constant 97 0 - 76: 74(int64_t) Constant 98 0 - 77: 74(int64_t) Constant 99 0 - 78: 74(int64_t) Constant 100 1702109236 - 79: 74(int64_t) Constant 101 0 - 80: 74(int64_t) Constant 102 0 - 81: 74(int64_t) Constant 103 0 - 82: 74(int64_t) Constant 104 0 - 83: 74(int64_t) Constant 105 0 - 84: 74(int64_t) Constant 106 0 - 85: 74(int64_t) Constant 107 0 - 86: 74(int64_t) Constant 1 0 - 87: TypeInt 8 0 - 88: 87(int8_t) Constant 0 - 89: 87(int8_t) Constant 116 - 90: 87(int8_t) Constant 117 - 91: 87(int8_t) Constant 118 - 92: 87(int8_t) Constant 119 - 93: 87(int8_t) Constant 120 - 94: 87(int8_t) Constant 121 - 95: 87(int8_t) Constant 122 - 96: 87(int8_t) Constant 123 - 97: 87(int8_t) Constant 1 - 98: TypeInt 16 0 - 99: 98(int16_t) Constant 0 - 100: 98(int16_t) Constant 132 - 101: 98(int16_t) Constant 133 - 102: 98(int16_t) Constant 134 - 103: 98(int16_t) Constant 135 - 104: 98(int16_t) Constant 136 - 105: 98(int16_t) Constant 137 - 106: 98(int16_t) Constant 138 - 107: 98(int16_t) Constant 139 - 108: 98(int16_t) Constant 1 - 109: TypeInt 32 0 - 110: 109(int) Constant 145 - 111: 109(int) Constant 146 - 112: 109(int) Constant 147 - 113: 109(int) Constant 148 - 114: 109(int) Constant 149 - 115: 109(int) Constant 150 - 116: 109(int) Constant 151 - 117: 109(int) Constant 152 - 118: 109(int) Constant 153 - 119: 109(int) Constant 154 - 120: 109(int) Constant 155 - 121: 109(int) Constant 1 - 122: TypeInt 64 0 - 123:122(int64_t) Constant 161 0 - 124:122(int64_t) Constant 162 0 - 125:122(int64_t) Constant 163 0 - 126:122(int64_t) Constant 164 0 - 127:122(int64_t) Constant 165 0 - 128:122(int64_t) Constant 166 0 - 129:122(int64_t) Constant 167 0 - 130:122(int64_t) Constant 168 0 - 131:122(int64_t) Constant 169 0 - 132:122(int64_t) Constant 170 0 - 133:122(int64_t) Constant 171 0 - 134:122(int64_t) Constant 1 0 - 135: TypeBool - 136: 135(bool) ConstantTrue + 10:6(float16_t) Constant 17408 + 11:6(float16_t) Constant 17664 + 12:6(float16_t) Constant 17920 + 13:6(float16_t) Constant 18176 + 14:6(float16_t) Constant 18432 + 15:6(float16_t) Constant 18560 + 16:6(float16_t) Constant 18688 + 17:6(float16_t) Constant 18816 + 18: TypeFloat 32 + 19: 18(float) Constant 1099431936 + 20: 18(float) Constant 1099956224 + 21: 18(float) Constant 1100480512 + 22: 18(float) Constant 1101004800 + 23: 18(float) Constant 1101529088 + 24: 18(float) Constant 1102053376 + 25: 18(float) Constant 1102577664 + 26: 18(float) Constant 1103101952 + 27: 18(float) Constant 1103626240 + 28: 18(float) Constant 1104150528 + 29: 18(float) Constant 1104674816 + 30: 18(float) Constant 1065353216 + 31: TypeFloat 64 + 32:31(float64_t) Constant 0 1077968896 + 33:31(float64_t) Constant 0 1078001664 + 34:31(float64_t) Constant 0 1078034432 + 35:31(float64_t) Constant 0 1078067200 + 36:31(float64_t) Constant 0 1078099968 + 37:31(float64_t) Constant 0 1078132736 + 38:31(float64_t) Constant 0 1078165504 + 39:31(float64_t) Constant 0 1078198272 + 40:31(float64_t) Constant 0 1078231040 + 41:31(float64_t) Constant 0 1078263808 + 42:31(float64_t) Constant 0 1078296576 + 43:31(float64_t) Constant 0 1072693248 + 44: TypeInt 8 1 + 45: 44(int8_t) Constant 49 + 46: 44(int8_t) Constant 50 + 47: 44(int8_t) Constant 51 + 48: 44(int8_t) Constant 52 + 49: 44(int8_t) Constant 53 + 50: 44(int8_t) Constant 54 + 51: 44(int8_t) Constant 55 + 52: 44(int8_t) Constant 56 + 53: 44(int8_t) Constant 57 + 54: 44(int8_t) Constant 58 + 55: 44(int8_t) Constant 59 + 56: 44(int8_t) Constant 1 + 57: TypeInt 16 1 + 58: 57(int16_t) Constant 65 + 59: 57(int16_t) Constant 66 + 60: 57(int16_t) Constant 67 + 61: 57(int16_t) Constant 68 + 62: 57(int16_t) Constant 69 + 63: 57(int16_t) Constant 70 + 64: 57(int16_t) Constant 71 + 65: 57(int16_t) Constant 72 + 66: 57(int16_t) Constant 73 + 67: 57(int16_t) Constant 74 + 68: 57(int16_t) Constant 75 + 69: 57(int16_t) Constant 1 + 70: TypeInt 32 1 + 71: 70(int) Constant 81 + 72: 70(int) Constant 82 + 73: 70(int) Constant 83 + 74: 70(int) Constant 84 + 75: 70(int) Constant 85 + 76: 70(int) Constant 86 + 77: 70(int) Constant 87 + 78: 70(int) Constant 88 + 79: 70(int) Constant 89 + 80: 70(int) Constant 90 + 81: 70(int) Constant 91 + 82: 70(int) Constant 1 + 83: TypeInt 64 1 + 84: 83(int64_t) Constant 97 0 + 85: 83(int64_t) Constant 98 0 + 86: 83(int64_t) Constant 99 0 + 87: 83(int64_t) Constant 100 0 + 88: 83(int64_t) Constant 101 0 + 89: 83(int64_t) Constant 102 0 + 90: 83(int64_t) Constant 103 0 + 91: 83(int64_t) Constant 104 0 + 92: 83(int64_t) Constant 105 0 + 93: 83(int64_t) Constant 106 0 + 94: 83(int64_t) Constant 107 0 + 95: 83(int64_t) Constant 1 0 + 96: TypeInt 8 0 + 97: 96(int8_t) Constant 113 + 98: 96(int8_t) Constant 114 + 99: 96(int8_t) Constant 115 + 100: 96(int8_t) Constant 116 + 101: 96(int8_t) Constant 117 + 102: 96(int8_t) Constant 118 + 103: 96(int8_t) Constant 119 + 104: 96(int8_t) Constant 120 + 105: 96(int8_t) Constant 121 + 106: 96(int8_t) Constant 122 + 107: 96(int8_t) Constant 123 + 108: 96(int8_t) Constant 1 + 109: TypeInt 16 0 + 110:109(int16_t) Constant 129 + 111:109(int16_t) Constant 130 + 112:109(int16_t) Constant 131 + 113:109(int16_t) Constant 65412 + 114:109(int16_t) Constant 133 + 115:109(int16_t) Constant 134 + 116:109(int16_t) Constant 135 + 117:109(int16_t) Constant 136 + 118:109(int16_t) Constant 137 + 119:109(int16_t) Constant 138 + 120:109(int16_t) Constant 139 + 121:109(int16_t) Constant 1 + 122: TypeInt 32 0 + 123: 122(int) Constant 145 + 124: 122(int) Constant 146 + 125: 122(int) Constant 147 + 126: 122(int) Constant 4294967188 + 127: 122(int) Constant 149 + 128: 122(int) Constant 150 + 129: 122(int) Constant 151 + 130: 122(int) Constant 152 + 131: 122(int) Constant 153 + 132: 122(int) Constant 154 + 133: 122(int) Constant 155 + 134: 122(int) Constant 1 + 135: TypeInt 64 0 + 136:135(int64_t) Constant 161 0 + 137:135(int64_t) Constant 162 0 + 138:135(int64_t) Constant 163 0 + 139:135(int64_t) Constant 4294967204 4294967295 + 140:135(int64_t) Constant 165 0 + 141:135(int64_t) Constant 166 0 + 142:135(int64_t) Constant 167 0 + 143:135(int64_t) Constant 168 0 + 144:135(int64_t) Constant 169 0 + 145:135(int64_t) Constant 170 0 + 146:135(int64_t) Constant 171 0 + 147:135(int64_t) Constant 1 0 + 148: TypeBool + 149: 148(bool) ConstantTrue 4(main): 2 Function None 3 5: Label Return diff --git a/glslang/MachineIndependent/Intermediate.cpp b/glslang/MachineIndependent/Intermediate.cpp index 584d8805..640e738a 100644 --- a/glslang/MachineIndependent/Intermediate.cpp +++ b/glslang/MachineIndependent/Intermediate.cpp @@ -3788,217 +3788,40 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC TConstUnionArray leftUnionArray(size); for (int i=0; i < size; i++) { - switch (promoteTo) { - case EbtFloat: - switch (node->getType().getBasicType()) { - case EbtInt: - leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getIConst())); - break; - case EbtUint: - leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getUConst())); - break; - case EbtInt64: - leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getI64Const())); - break; - case EbtUint64: - leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getU64Const())); - break; - case EbtBool: - leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getBConst())); - break; - case EbtFloat: - case EbtDouble: - case EbtFloat16: - leftUnionArray[i] = rightUnionArray[i]; - break; - default: - return node; - } - break; - case EbtDouble: - switch (node->getType().getBasicType()) { - case EbtInt: - leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getIConst())); - break; - case EbtUint: - leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getUConst())); - break; - case EbtInt64: - leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getI64Const())); - break; - case EbtUint64: - leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getU64Const())); - break; - case EbtBool: - leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getBConst())); - break; - case EbtFloat: - case EbtDouble: - case EbtFloat16: - leftUnionArray[i] = rightUnionArray[i]; - break; - default: - return node; - } - break; - case EbtFloat16: - switch (node->getType().getBasicType()) { - case EbtInt: - leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getIConst())); - break; - case EbtUint: - leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getUConst())); - break; - case EbtInt64: - leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getI64Const())); - break; - case EbtUint64: - leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getU64Const())); - break; - case EbtBool: - leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getBConst())); - break; - case EbtFloat: - case EbtDouble: - case EbtFloat16: - leftUnionArray[i] = rightUnionArray[i]; - break; - default: - return node; - } - break; - case EbtInt: - switch (node->getType().getBasicType()) { - case EbtInt: - leftUnionArray[i] = rightUnionArray[i]; - break; - case EbtUint: - leftUnionArray[i].setIConst(static_cast(rightUnionArray[i].getUConst())); - break; - case EbtInt64: - leftUnionArray[i].setIConst(static_cast(rightUnionArray[i].getI64Const())); - break; - case EbtUint64: - leftUnionArray[i].setIConst(static_cast(rightUnionArray[i].getU64Const())); - break; - case EbtBool: - leftUnionArray[i].setIConst(static_cast(rightUnionArray[i].getBConst())); - break; - case EbtFloat: - case EbtDouble: - case EbtFloat16: - leftUnionArray[i].setIConst(static_cast(rightUnionArray[i].getDConst())); - break; - default: - return node; - } - break; - case EbtUint: - switch (node->getType().getBasicType()) { - case EbtInt: - leftUnionArray[i].setUConst(static_cast(rightUnionArray[i].getIConst())); - break; - case EbtUint: - leftUnionArray[i] = rightUnionArray[i]; - break; - case EbtInt64: - leftUnionArray[i].setUConst(static_cast(rightUnionArray[i].getI64Const())); - break; - case EbtUint64: - leftUnionArray[i].setUConst(static_cast(rightUnionArray[i].getU64Const())); - break; - case EbtBool: - leftUnionArray[i].setUConst(static_cast(rightUnionArray[i].getBConst())); - break; - case EbtFloat: - case EbtDouble: - case EbtFloat16: - leftUnionArray[i].setUConst(static_cast(rightUnionArray[i].getDConst())); - break; - default: - return node; - } - break; - case EbtBool: - switch (node->getType().getBasicType()) { - case EbtInt: - leftUnionArray[i].setBConst(rightUnionArray[i].getIConst() != 0); - break; - case EbtUint: - leftUnionArray[i].setBConst(rightUnionArray[i].getUConst() != 0); - break; - case EbtInt64: - leftUnionArray[i].setBConst(rightUnionArray[i].getI64Const() != 0); - break; - case EbtUint64: - leftUnionArray[i].setBConst(rightUnionArray[i].getU64Const() != 0); - break; - case EbtBool: - leftUnionArray[i] = rightUnionArray[i]; - break; - case EbtFloat: - case EbtDouble: - case EbtFloat16: - leftUnionArray[i].setBConst(rightUnionArray[i].getDConst() != 0.0); - break; - default: - return node; - } - break; - case EbtInt64: - switch (node->getType().getBasicType()) { - case EbtInt: - leftUnionArray[i].setI64Const(static_cast(rightUnionArray[i].getIConst())); - break; - case EbtUint: - leftUnionArray[i].setI64Const(static_cast(rightUnionArray[i].getUConst())); - break; - case EbtInt64: - leftUnionArray[i] = rightUnionArray[i]; - break; - case EbtUint64: - leftUnionArray[i].setI64Const(static_cast(rightUnionArray[i].getU64Const())); - break; - case EbtBool: - leftUnionArray[i].setI64Const(static_cast(rightUnionArray[i].getBConst())); - break; - case EbtFloat: - case EbtDouble: - case EbtFloat16: - leftUnionArray[i].setI64Const(static_cast(rightUnionArray[i].getDConst())); - break; - default: - return node; - } - break; - case EbtUint64: - switch (node->getType().getBasicType()) { - case EbtInt: - leftUnionArray[i].setU64Const(static_cast(rightUnionArray[i].getIConst())); - break; - case EbtUint: - leftUnionArray[i].setU64Const(static_cast(rightUnionArray[i].getUConst())); - break; - case EbtInt64: - leftUnionArray[i].setU64Const(static_cast(rightUnionArray[i].getI64Const())); - break; - case EbtUint64: - leftUnionArray[i] = rightUnionArray[i]; - break; - case EbtBool: - leftUnionArray[i].setU64Const(static_cast(rightUnionArray[i].getBConst())); - break; - case EbtFloat: - case EbtDouble: - case EbtFloat16: - leftUnionArray[i].setU64Const(static_cast(rightUnionArray[i].getDConst())); - break; - default: - return node; - } - break; - default: - return node; + +#define PROMOTE(Set, CType, Get) leftUnionArray[i].Set(static_cast(rightUnionArray[i].Get())); + +#define TO_ALL(Get) \ + switch (promoteTo) { \ + case EbtFloat16: PROMOTE(setDConst, double, Get); break; \ + case EbtFloat: PROMOTE(setDConst, double, Get); break; \ + case EbtDouble: PROMOTE(setDConst, double, Get); break; \ + case EbtInt8: PROMOTE(setI8Const, char, Get); break; \ + case EbtInt16: PROMOTE(setI16Const, short, Get); break; \ + case EbtInt: PROMOTE(setIConst, int, Get); break; \ + case EbtInt64: PROMOTE(setI64Const, long long, Get); break; \ + case EbtUint8: PROMOTE(setU8Const, unsigned char, Get); break; \ + case EbtUint16: PROMOTE(setU16Const, unsigned short, Get); break; \ + case EbtUint: PROMOTE(setUConst, unsigned int, Get); break; \ + case EbtUint64: PROMOTE(setU64Const, unsigned long long, Get); break; \ + case EbtBool: PROMOTE(setBConst, bool, Get); break; \ + default: return node; \ + } + + switch (node->getType().getBasicType()) { + case EbtFloat16: TO_ALL(getDConst); break; + case EbtFloat: TO_ALL(getDConst); break; + case EbtDouble: TO_ALL(getDConst); break; + case EbtInt8: TO_ALL(getI8Const); break; + case EbtInt16: TO_ALL(getI16Const); break; + case EbtInt: TO_ALL(getIConst); break; + case EbtInt64: TO_ALL(getI64Const); break; + case EbtUint8: TO_ALL(getU8Const); break; + case EbtUint16: TO_ALL(getU16Const); break; + case EbtUint: TO_ALL(getUConst); break; + case EbtUint64: TO_ALL(getU64Const); break; + case EbtBool: TO_ALL(getBConst); break; + default: return node; } }