20010226-1.c 682 B

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