GLSL: Fold constant SHRT_MIN/INT_MIN/LLONG_MIN % -1 to 0.

This commit is contained in:
Aaron Muir Hamilton
2017-10-25 00:11:53 +00:00
parent b5b0846244
commit f83e2f0690
4 changed files with 88 additions and 1 deletions

12
Test/constFoldIntMin.frag Normal file
View File

@@ -0,0 +1,12 @@
#version 460 core
#extension GL_AMD_gpu_shader_int16 : enable
#extension GL_ARB_gpu_shader_int64 : enable
void a(){
int16_t u = -32768S / -1S; // SHRT_MIN
int v = -2147483648 / -1; // INT_MIN
int64_t w = -9223372036854775808L / -1L; // LLONG_MIN
int16_t x = -32768S % -1S; // SHRT_MIN
int y = -2147483648 % -1; // INT_MIN
int64_t z = -9223372036854775808L % -1L; // LLONG_MIN
}