tint: Remove ConversionFailure::kTooSmall

Nothing errors on this. Simplifies code.
Also: Disable MSVC warnings about constant overflow.

Fixed: tint:1564
Change-Id: I5bb2c2ebb89966f5b3f7cbcd73672e110b1b98cd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91622
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
Ben Clayton
2022-05-27 20:22:26 +00:00
committed by Dawn LUCI CQ
parent 4b04721075
commit 572eaf271e
13 changed files with 141 additions and 97 deletions

View File

@@ -0,0 +1,3 @@
fn foo() {
let b = 1e-40f;
}

View File

@@ -0,0 +1,10 @@
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
void foo() {
float b = 9.9999461e-41f;
}

View File

@@ -0,0 +1,8 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
void foo() {
const float b = 9.9999461e-41f;
}

View File

@@ -0,0 +1,7 @@
#include <metal_stdlib>
using namespace metal;
void foo() {
float const b = 9.9999461e-41f;
}

View File

@@ -0,0 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 9
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %foo "foo"
%void = OpTypeVoid
%1 = OpTypeFunction %void
%float = OpTypeFloat 32
%float_0x1_16c2pn133 = OpConstant %float 0x1.16c2p-133
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%foo = OpFunction %void None %1
%6 = OpLabel
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,3 @@
fn foo() {
let b = 0x1.16c2p-133;
}