20010226-1.c 685 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (C) 2007
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. /*
  8. * This file is originally a part of the GCC testsuite.
  9. */
  10. #include <common.h>
  11. #include <post.h>
  12. GNU_FPOST_ATTR
  13. #if CONFIG_POST & CONFIG_SYS_POST_FPU
  14. int fpu_post_test_math3 (void)
  15. {
  16. volatile long double dfrom = 1.1;
  17. volatile long double m1;
  18. volatile long double m2;
  19. volatile unsigned long mant_long;
  20. m1 = dfrom / 2.0;
  21. m2 = m1 * 4294967296.0;
  22. mant_long = ((unsigned long) m2) & 0xffffffff;
  23. if (mant_long != 0x8ccccccc) {
  24. post_log ("Error in FPU math3 test\n");
  25. return -1;
  26. }
  27. return 0;
  28. }
  29. #endif /* CONFIG_POST & CONFIG_SYS_POST_FPU */