fpu-generic.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* Fallback FPU-related code (for systems not otherwise supported).
  2. Copyright (C) 2005-2015 Free Software Foundation, Inc.
  3. Contributed by Francois-Xavier Coudert <coudert@clipper.ens.fr>
  4. This file is part of the GNU Fortran runtime library (libgfortran).
  5. Libgfortran is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public
  7. License as published by the Free Software Foundation; either
  8. version 3 of the License, or (at your option) any later version.
  9. Libgfortran is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. Under Section 7 of GPL version 3, you are granted additional
  14. permissions described in the GCC Runtime Library Exception, version
  15. 3.1, as published by the Free Software Foundation.
  16. You should have received a copy of the GNU General Public License and
  17. a copy of the GCC Runtime Library Exception along with this program;
  18. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  19. <http://www.gnu.org/licenses/>. */
  20. /* Fallback FPU-related code for systems not otherwise supported. This
  21. is mainly telling the user that we will not be able to do what he
  22. requested. */
  23. void
  24. set_fpu (void)
  25. {
  26. if (options.fpe & GFC_FPE_INVALID)
  27. estr_write ("Fortran runtime warning: IEEE 'invalid operation' "
  28. "exception not supported.\n");
  29. if (options.fpe & GFC_FPE_DENORMAL)
  30. estr_write ("Fortran runtime warning: Floating point 'denormal operand' "
  31. "exception not supported.\n");
  32. if (options.fpe & GFC_FPE_ZERO)
  33. estr_write ("Fortran runtime warning: IEEE 'division by zero' "
  34. "exception not supported.\n");
  35. if (options.fpe & GFC_FPE_OVERFLOW)
  36. estr_write ("Fortran runtime warning: IEEE 'overflow' "
  37. "exception not supported.\n");
  38. if (options.fpe & GFC_FPE_UNDERFLOW)
  39. estr_write ("Fortran runtime warning: IEEE 'underflow' "
  40. "exception not supported.\n");
  41. if (options.fpe & GFC_FPE_INEXACT)
  42. estr_write ("Fortran runtime warning: IEEE 'inexact' "
  43. "exception not supported.\n");
  44. }
  45. void
  46. set_fpu_trap_exceptions (int trap __attribute__((unused)),
  47. int notrap __attribute__((unused)))
  48. {
  49. }
  50. int
  51. get_fpu_except_flags (void)
  52. {
  53. return 0;
  54. }
  55. int
  56. get_fpu_rounding_mode (void)
  57. {
  58. return 0;
  59. }
  60. void
  61. set_fpu_rounding_mode (int round __attribute__((unused)))
  62. {
  63. }
  64. int
  65. support_fpu_underflow_control (int kind __attribute__((unused)))
  66. {
  67. return 0;
  68. }
  69. int
  70. get_fpu_underflow_mode (void)
  71. {
  72. return 0;
  73. }
  74. void
  75. set_fpu_underflow_mode (int gradual __attribute__((unused)))
  76. {
  77. }