mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 18:59:21 +00:00
Add const-eval for atanh.
This CL adds const-eval for the `atanh` operator. Bug: tint:1581 Change-Id: I7d8989a348ad1d8ca463dae90233fd82d6faf2d9 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106849 Commit-Queue: Dan Sinclair <dsinclair@chromium.org> Reviewed-by: Antonio Maiorano <amaiorano@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
19c761ffe5
commit
4c8401f33c
@@ -233,7 +233,7 @@ DataMap polyfillAtanh(Level level) {
|
||||
TEST_F(BuiltinPolyfillTest, ShouldRunAtanh) {
|
||||
auto* src = R"(
|
||||
fn f() {
|
||||
atanh(1.0);
|
||||
atanh(0.9f);
|
||||
}
|
||||
)";
|
||||
|
||||
@@ -246,7 +246,7 @@ fn f() {
|
||||
TEST_F(BuiltinPolyfillTest, Atanh_Full_f32) {
|
||||
auto* src = R"(
|
||||
fn f() {
|
||||
let r : f32 = atanh(1234);
|
||||
let r : f32 = atanh(0f);
|
||||
}
|
||||
)";
|
||||
|
||||
@@ -256,7 +256,7 @@ fn tint_atanh(x : f32) -> f32 {
|
||||
}
|
||||
|
||||
fn f() {
|
||||
let r : f32 = tint_atanh(1234);
|
||||
let r : f32 = tint_atanh(0.0f);
|
||||
}
|
||||
)";
|
||||
|
||||
@@ -268,7 +268,7 @@ fn f() {
|
||||
TEST_F(BuiltinPolyfillTest, Atanh_Full_vec3_f32) {
|
||||
auto* src = R"(
|
||||
fn f() {
|
||||
let r : vec3<f32> = atanh(vec3<f32>(1234));
|
||||
let r : vec3<f32> = atanh(vec3<f32>(0f));
|
||||
}
|
||||
)";
|
||||
|
||||
@@ -278,7 +278,7 @@ fn tint_atanh(x : vec3<f32>) -> vec3<f32> {
|
||||
}
|
||||
|
||||
fn f() {
|
||||
let r : vec3<f32> = tint_atanh(vec3<f32>(1234));
|
||||
let r : vec3<f32> = tint_atanh(vec3<f32>(0.0f));
|
||||
}
|
||||
)";
|
||||
|
||||
@@ -290,7 +290,7 @@ fn f() {
|
||||
TEST_F(BuiltinPolyfillTest, Atanh_Range_f32) {
|
||||
auto* src = R"(
|
||||
fn f() {
|
||||
let r : f32 = atanh(1234);
|
||||
let r : f32 = atanh(0f);
|
||||
}
|
||||
)";
|
||||
|
||||
@@ -300,7 +300,7 @@ fn tint_atanh(x : f32) -> f32 {
|
||||
}
|
||||
|
||||
fn f() {
|
||||
let r : f32 = tint_atanh(1234);
|
||||
let r : f32 = tint_atanh(0.0f);
|
||||
}
|
||||
)";
|
||||
|
||||
@@ -312,17 +312,21 @@ fn f() {
|
||||
TEST_F(BuiltinPolyfillTest, Atanh_Range_vec3_f32) {
|
||||
auto* src = R"(
|
||||
fn f() {
|
||||
let r : vec3<f32> = atanh(vec3<f32>(1234));
|
||||
let r : vec3<f32> = atanh(vec3<f32>(0f));
|
||||
}
|
||||
)";
|
||||
|
||||
auto* expect = R"(
|
||||
fn tint_atanh(x : vec3<f32>) -> vec3<f32> {
|
||||
return select(atanh(x), vec3<f32>(0.0), (x >= vec3<f32>(1.0)));
|
||||
}
|
||||
|
||||
fn f() {
|
||||
let r : vec3<f32> = atanh(vec3<f32>(1234));
|
||||
let r : vec3<f32> = tint_atanh(vec3<f32>(0.0f));
|
||||
}
|
||||
)";
|
||||
|
||||
auto got = Run<BuiltinPolyfill>(src, polyfillAcosh(Level::kRangeCheck));
|
||||
auto got = Run<BuiltinPolyfill>(src, polyfillAtanh(Level::kRangeCheck));
|
||||
|
||||
EXPECT_EQ(expect, str(got));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user