~mmach/netext73/mesa-ryzen

« back to all changes in this revision

Viewing changes to src/asahi/compiler/test/test-optimizer.cpp

  • Committer: mmach
  • Date: 2023-11-02 21:31:35 UTC
  • Revision ID: netbit73@gmail.com-20231102213135-18d4tzh7tj0uz752
2023-11-02 22:11:57

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
          agx_fadd_to(b, out, agx_neg(wx), wy));
79
79
}
80
80
 
 
81
TEST_F(Optimizer, FloatConversion)
 
82
{
 
83
   CASE32(
 
84
      {
 
85
         agx_index cvt = agx_temp(b->shader, AGX_SIZE_32);
 
86
         agx_fmov_to(b, cvt, hx);
 
87
         agx_fadd_to(b, out, cvt, wy);
 
88
      },
 
89
      { agx_fadd_to(b, out, hx, wy); });
 
90
 
 
91
   CASE16(
 
92
      {
 
93
         agx_index sum = agx_temp(b->shader, AGX_SIZE_32);
 
94
         agx_fadd_to(b, sum, wx, wy);
 
95
         agx_fmov_to(b, out, sum);
 
96
      },
 
97
      { agx_fadd_to(b, out, wx, wy); });
 
98
}
 
99
 
81
100
TEST_F(Optimizer, FusedFABSNEG)
82
101
{
83
102
   CASE32(agx_fadd_to(b, out, agx_fmov(b, agx_abs(wx)), wy),
164
183
      agx_xor_to(b, out, preload, wy);
165
184
   });
166
185
}
 
186
 
 
187
TEST_F(Optimizer, NoConversionsOn16BitALU)
 
188
{
 
189
   NEGCASE16({
 
190
      agx_index cvt = agx_temp(b->shader, AGX_SIZE_16);
 
191
      agx_fmov_to(b, cvt, wx);
 
192
      agx_fadd_to(b, out, cvt, hy);
 
193
   });
 
194
 
 
195
   NEGCASE32(agx_fmov_to(b, out, agx_fadd(b, hx, hy)));
 
196
}