lib2divSI.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* SI mode divide routines for libgcc for PRU
  2. Copyright (C) 2014-2022 Free Software Foundation, Inc.
  3. Based on lib2divSI.c from MSP430 port.
  4. This file is part of GCC.
  5. GCC is free software; you can redistribute it and/or modify it
  6. under the terms of the GNU General Public License as published
  7. by the Free Software Foundation; either version 3, or (at your
  8. option) any later version.
  9. GCC is distributed in the hope that it will be useful, but WITHOUT
  10. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  11. or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  12. 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. typedef int sint32_type __attribute__ ((mode (SI)));
  21. typedef unsigned int uint32_type __attribute__ ((mode (SI)));
  22. typedef int sint16_type __attribute__ ((mode (HI)));
  23. typedef unsigned int uint16_type __attribute__ ((mode (HI)));
  24. typedef int sint08_type __attribute__ ((mode (QI)));
  25. typedef unsigned int uint08_type __attribute__ ((mode (QI)));
  26. typedef int word_type __attribute__ ((mode (__word__)));
  27. #define C3B(a,b,c) a##b##c
  28. #define C3(a,b,c) C3B(a,b,c)
  29. /* PRU ABI dictates the library function names. */
  30. #define __gnu_divsi3 __pruabi_divi
  31. #define __gnu_modsi3 __pruabi_remi
  32. #define __gnu_udivsi3 __pruabi_divu
  33. #define __gnu_umodsi3 __pruabi_remu
  34. #define UINT_TYPE uint32_type
  35. #define SINT_TYPE sint32_type
  36. #define BITS_MINUS_1 31
  37. #define NAME_MODE si
  38. #include "pru-divmod.h"