tint: Implement const eval of binary multiply

Bug: tint:1581
Change-Id: I70ff40ed4d8faf0a665824fef936ffbafb3f0948
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/99362
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
Antonio Maiorano
2022-09-01 14:57:39 +00:00
committed by Dawn LUCI CQ
parent ae6f76fe3a
commit c20c5dfb4a
35 changed files with 1243 additions and 482 deletions

View File

@@ -1,5 +1,5 @@
[numthreads(1, 1, 1)]
void f() {
const float16_t r = (float16_t(1.0h) * float16_t(2.0h));
const float16_t r = float16_t(2.0h);
return;
}

View File

@@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void f() {
float16_t r = (1.0hf * 2.0hf);
float16_t r = 2.0hf;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@@ -1,5 +1,5 @@
[numthreads(1, 1, 1)]
void f() {
const float r = (1.0f * 2.0f);
const float r = 2.0f;
return;
}

View File

@@ -1,5 +1,5 @@
[numthreads(1, 1, 1)]
void f() {
const float r = (1.0f * 2.0f);
const float r = 2.0f;
return;
}

View File

@@ -1,7 +1,7 @@
#version 310 es
void f() {
float r = (1.0f * 2.0f);
float r = 2.0f;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@@ -1,5 +1,5 @@
[numthreads(1, 1, 1)]
void f() {
const int r = (1 * 2);
const int r = 2;
return;
}

View File

@@ -1,5 +1,5 @@
[numthreads(1, 1, 1)]
void f() {
const int r = (1 * 2);
const int r = 2;
return;
}

View File

@@ -1,7 +1,7 @@
#version 310 es
void f() {
int r = (1 * 2);
int r = 2;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@@ -1,5 +1,5 @@
[numthreads(1, 1, 1)]
void f() {
const uint r = (1u * 2u);
const uint r = 2u;
return;
}

View File

@@ -1,5 +1,5 @@
[numthreads(1, 1, 1)]
void f() {
const uint r = (1u * 2u);
const uint r = 2u;
return;
}

View File

@@ -1,7 +1,7 @@
#version 310 es
void f() {
uint r = (1u * 2u);
uint r = 2u;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;