Kernel math emulation bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following testcase fails when compiled with -march=2.0:

/* Test front-end conversions, optimizer conversions, and run-time
   conversions between different arithmetic types.

   Constants are specified in a non-obvious way to make them work for
   any word size.  Their value on a 32-bit machine is indicated in the
   comments.

   Note that this code is NOT intended for testing of accuracy of fp
   conversions.  */

unsigned long long int
f2ull(float f)
{
  return (unsigned long long int) f;
}

test_float_to_longlong_integer()
{
  if (f2ull((float) ((~0ULL) >> 1)) != (~0ULL) >> 1 &&	/* 0x7fffffff */
      f2ull((float) ((~0ULL) >> 1)) != ((~0ULL) >> 1) + 1)
    abort();
}

main()
{
  test_float_to_longlong_integer();
  exit(0);
}

The problem is the fcnv,t,sgl,udw instruction. It appears it isn't emulated
correctly.  Test doesn't fail on hpux.

Dave
-- 
J. David Anglin                                  dave.anglin@xxxxxxxxxxxxxx
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux