[writer/msl]: Implement modf and frexp

And remove the u32 overload of frexp (it's not in the spec).

Brings the number of failing tint end to end tests for MSL down to 19/1098.

The WG still haven't found consensus on reworking these two intrinsics.
It's very likely that their signature will change so that they return a structure instead of returning a value and outputing another as a pointer.

Until the WG makes a decision, let's implement these according to the current spec.
Some overloads are still failing due to MSL missing overloads of the pointer parameter being in the `threadgroup` address space.

I'm holding off fixing these until we know what's happening with these intrinsics.

See also:
https://github.com/gpuweb/gpuweb/issues/1480
https://github.com/gpuweb/gpuweb/issues/1846

Change-Id: Ib6764e6659d840db41bc65fed2b8b283d1056c3d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57421
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
Ben Clayton
2021-07-08 21:21:27 +00:00
committed by Tint LUCI CQ
parent e4fd4a2ecd
commit 03c8393213
146 changed files with 1559 additions and 5209 deletions

View File

@@ -863,8 +863,8 @@ TEST_F(ResolverIntrinsicDataTest, Frexp_Error_FirstParamInt) {
R"(error: no matching call to frexp(i32, ptr<workgroup, i32, read_write>)
2 candidate functions:
frexp(f32, ptr<S, T, A>) -> f32 where: T is i32 or u32, S is function, private or workgroup
frexp(vecN<f32>, ptr<S, vecN<T>, A>) -> vecN<f32> where: T is i32 or u32, S is function, private or workgroup
frexp(f32, ptr<S, i32, A>) -> f32 where: S is function, private or workgroup
frexp(vecN<f32>, ptr<S, vecN<i32>, A>) -> vecN<f32> where: S is function, private or workgroup
)");
}
@@ -880,8 +880,8 @@ TEST_F(ResolverIntrinsicDataTest, Frexp_Error_SecondParamFloatPtr) {
R"(error: no matching call to frexp(f32, ptr<workgroup, f32, read_write>)
2 candidate functions:
frexp(f32, ptr<S, T, A>) -> f32 where: T is i32 or u32, S is function, private or workgroup
frexp(vecN<f32>, ptr<S, vecN<T>, A>) -> vecN<f32> where: T is i32 or u32, S is function, private or workgroup
frexp(f32, ptr<S, i32, A>) -> f32 where: S is function, private or workgroup
frexp(vecN<f32>, ptr<S, vecN<i32>, A>) -> vecN<f32> where: S is function, private or workgroup
)");
}
@@ -894,8 +894,8 @@ TEST_F(ResolverIntrinsicDataTest, Frexp_Error_SecondParamNotAPointer) {
EXPECT_EQ(r()->error(), R"(error: no matching call to frexp(f32, i32)
2 candidate functions:
frexp(f32, ptr<S, T, A>) -> f32 where: T is i32 or u32, S is function, private or workgroup
frexp(vecN<f32>, ptr<S, vecN<T>, A>) -> vecN<f32> where: T is i32 or u32, S is function, private or workgroup
frexp(f32, ptr<S, i32, A>) -> f32 where: S is function, private or workgroup
frexp(vecN<f32>, ptr<S, vecN<i32>, A>) -> vecN<f32> where: S is function, private or workgroup
)");
}
@@ -911,8 +911,8 @@ TEST_F(ResolverIntrinsicDataTest, Frexp_Error_VectorSizesDontMatch) {
R"(error: no matching call to frexp(vec2<f32>, ptr<workgroup, vec4<i32>, read_write>)
2 candidate functions:
frexp(f32, ptr<S, T, A>) -> f32 where: T is i32 or u32, S is function, private or workgroup
frexp(vecN<f32>, ptr<S, vecN<T>, A>) -> vecN<f32> where: T is i32 or u32, S is function, private or workgroup
frexp(vecN<f32>, ptr<S, vecN<i32>, A>) -> vecN<f32> where: S is function, private or workgroup
frexp(f32, ptr<S, i32, A>) -> f32 where: S is function, private or workgroup
)");
}