Add matrix tests for pure float->float intrinsics and scalar tests for tan() - #1471
Add matrix tests for pure float->float intrinsics and scalar tests for tan()#1471danbrown-amd wants to merge 2 commits into
Conversation
| @@ -0,0 +1,81 @@ | |||
| #--- source.hlsl | |||
There was a problem hiding this comment.
Maybe we should split the tan tests into a different PR? So we can keep this PR as just matrix tests.
|
|
||
| [numthreads(1,1,1)] | ||
| void main() { | ||
| float3x2 r32 = acos(float3x2(In[0].xy, In[0].zw, In[1].xy)); |
There was a problem hiding this comment.
(For all files)
nit: capitalize variable names
| float2x4 r24 = acos(float2x4(In[1], In[2])); | ||
| float3x1 r31 = acos(float3x1(In[0].x, In[1].x, In[2].x)); | ||
| float4x4 r44 = acos(float4x4(In[0], In[1], In[2], In[3])); | ||
|
|
There was a problem hiding this comment.
(For all files)
There should be a constant folding case.
| - Name: In | ||
| Format: Float32 | ||
| Stride: 16 | ||
| Data: [ -inf, -1.0, 0.0, 0.25, |
There was a problem hiding this comment.
(General comment for all files)
We shouldn't specifically be trying to test inf/nan/denorm values unless it's a core function of the intrinsic.
Also in general, the matrix tests don't need to be very robust in the values they're testing - the scalar/vector tests should cover that.
| Out[0] = float4(r32[0], 0.0, 0.0); | ||
| Out[1] = float4(r32[1], 0.0, 0.0); | ||
| Out[2] = float4(r32[2], 0.0, 0.0); | ||
| Out[3] = r24[0]; | ||
| Out[4] = r24[1]; | ||
| Out[5] = float4(r31[0], 0.0, 0.0, 0.0); | ||
| Out[6] = float4(r31[1], 0.0, 0.0, 0.0); | ||
| Out[7] = float4(r31[2], 0.0, 0.0, 0.0); | ||
| Out[8] = r44[0]; | ||
| Out[9] = r44[1]; | ||
| Out[10] = r44[2]; | ||
| Out[11] = r44[3]; |
There was a problem hiding this comment.
(For all files)
Why not pack Out like this?
Out[0] = float4(r32[0], r32[1]);
Out[1] = float4(r32[2], 0.0, 0.0);
Out[2] = r24[0];
Out[3] = r24[1];
Out[4] = float4(r31[0], r31[1], r31[2], 0.0);
Out[5] = r44[0];
Out[6] = r44[1];
Out[7] = r44[2];
Out[8] = r44[3];
| @@ -0,0 +1,93 @@ | |||
| #--- source.hlsl | |||
There was a problem hiding this comment.
(Check this is true for all the intrinsics before removing anything)
I don't think we need fp16 or fp64 matrix tests for any of these intrinsics. They should all lower to a single op in DXIL/SPIRV that behave the same at every bit size, and the 32-bit matrix tests already exercise them. 16-bit/64-bit coverage is handled in the scalar/vector tests, so I don't think we need matrix ones.
| Data: [ -1.0, -0.86603,-0.70711,-0.5, | ||
| 0.0, 0.5, 0.70711, 0.86603, | ||
| 1.0, -0.5, 0.70711,-0.86603, | ||
| -0.86603, 0.86603, -0.5, -0.70711 ] |
There was a problem hiding this comment.
Lots of weird formatting throughout the files (e.g. here).
| Rule: BufferFloatULP | ||
| ULPT: 0 |
There was a problem hiding this comment.
You can just make this BufferExact.
kmpeng
left a comment
There was a problem hiding this comment.
All your tests are failing - you need to XFAIL: Clang them since the matrix implementations aren't in.
Resolves #107, #787, #790, #791, #797, #800, #801, #802, #804, #805, #806, #807, #808, #809, #812, #813, #814, #819, #820, #821, #822, #823, #824, #825, #826
Assisted-by: Claude Opus 4