ltd.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* Software floating-point emulation.
  2. Return 1 iff a < b, 0 otherwise.
  3. Copyright (C) 1997-2022 Free Software Foundation, Inc.
  4. Contributed by Richard Henderson (rth@cygnus.com) and
  5. Jakub Jelinek (jj@ultra.linux.cz).
  6. This file is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU Lesser General Public
  8. License as published by the Free Software Foundation; either
  9. version 2.1 of the License, or (at your option) any later version.
  10. In addition to the permissions in the GNU Lesser General Public
  11. License, the Free Software Foundation gives you unlimited
  12. permission to link the compiled version of this file into
  13. combinations with other programs, and to distribute those
  14. combinations without any restriction coming from the use of this
  15. file. (The Lesser General Public License restrictions do apply in
  16. other respects; for example, they cover modification of the file,
  17. and distribution when not linked into a combine executable.)
  18. This file is distributed in the hope that it will be useful,
  19. but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  21. Lesser General Public License for more details.
  22. You should have received a copy of the GNU Lesser General Public
  23. License along with GCC; see the file COPYING.LIB. If not see
  24. <http://www.gnu.org/licenses/>. */
  25. #include <soft-fp/soft-fp.h>
  26. #include <soft-fp/double.h>
  27. CMPtype __c6xabi_ltd(DFtype a, DFtype b)
  28. {
  29. FP_DECL_EX;
  30. FP_DECL_D(A); FP_DECL_D(B);
  31. CMPtype r;
  32. FP_UNPACK_RAW_D(A, a);
  33. FP_UNPACK_RAW_D(B, b);
  34. FP_CMP_D(r, A, B, 2, 2);
  35. FP_HANDLE_EXCEPTIONS;
  36. return r < 0;
  37. }