~mmach/netext73/mesa-ryzen

« back to all changes in this revision

Viewing changes to src/gallium/drivers/llvmpipe/lp_test_arit.c

  • 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:
412
412
/*
413
413
 * Test one LLVM unary arithmetic builder function.
414
414
 */
415
 
static boolean
 
415
static bool
416
416
test_unary(unsigned verbose, FILE *fp, const struct unary_test_t *test, unsigned length)
417
417
{
418
418
   char test_name[128];
421
421
   struct gallivm_state *gallivm;
422
422
   LLVMValueRef test_func;
423
423
   unary_func_t test_func_jit;
424
 
   boolean success = TRUE;
 
424
   bool success = true;
425
425
   int i, j;
426
426
   float *in, *out;
427
427
 
459
459
      for (i = 0; i < num_vals; ++i) {
460
460
         float testval, ref;
461
461
         double error, precision;
462
 
         boolean expected_pass = TRUE;
 
462
         bool expected_pass = true;
463
463
         bool pass;
464
464
 
465
465
         testval = flush_denorm_to_zero(in[i]);
485
485
            /* FIXME: The generic (non SSE) path in lp_build_iround, which is
486
486
             * always taken for length==2 regardless of native round support,
487
487
             * does not round to even. */
488
 
            expected_pass = FALSE;
 
488
            expected_pass = false;
489
489
         }
490
490
 
491
491
         if (test->ref == &expf && util_inf_sign(testval) == -1) {
506
506
         }
507
507
 
508
508
         if (pass != expected_pass) {
509
 
            success = FALSE;
 
509
            success = false;
510
510
         }
511
511
      }
512
512
   }
521
521
}
522
522
 
523
523
 
524
 
boolean
 
524
bool
525
525
test_all(unsigned verbose, FILE *fp)
526
526
{
527
 
   boolean success = TRUE;
 
527
   bool success = true;
528
528
   int i;
529
529
 
530
530
   for (i = 0; i < ARRAY_SIZE(unary_tests); ++i) {
532
532
      unsigned length;
533
533
      for (length = 1; length <= max_length; length *= 2) {
534
534
         if (!test_unary(verbose, fp, &unary_tests[i], length)) {
535
 
            success = FALSE;
 
535
            success = false;
536
536
         }
537
537
      }
538
538
   }
541
541
}
542
542
 
543
543
 
544
 
boolean
 
544
bool
545
545
test_some(unsigned verbose, FILE *fp,
546
546
          unsigned long n)
547
547
{
553
553
}
554
554
 
555
555
 
556
 
boolean
 
556
bool
557
557
test_single(unsigned verbose, FILE *fp)
558
558
{
559
 
   return TRUE;
 
559
   return true;
560
560
}