lshrdi3.S 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
  2. Free Software Foundation, Inc.
  3. This file is free software; you can redistribute it and/or modify it
  4. under the terms of the GNU General Public License as published by the
  5. Free Software Foundation; either version 2, or (at your option) any
  6. later version.
  7. In addition to the permissions in the GNU General Public License, the
  8. Free Software Foundation gives you unlimited permission to link the
  9. compiled version of this file into combinations with other programs,
  10. and to distribute those combinations without any restriction coming
  11. from the use of this file. (The General Public License restrictions
  12. do apply in other respects; for example, they cover modification of
  13. the file, and distribution when not linked into a combine
  14. executable.)
  15. This file is distributed in the hope that it will be useful, but
  16. WITHOUT ANY WARRANTY; without even the implied warranty of
  17. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. General Public License for more details.
  19. You should have received a copy of the GNU General Public License
  20. along with this program; see the file COPYING. If not, write to
  21. the Free Software Foundation, 51 Franklin Street, Fifth Floor,
  22. Boston, MA 02110-1301, USA. */
  23. #include <linux/linkage.h>
  24. #include <asm/assembler.h>
  25. #ifdef __ARMEB__
  26. #define al r1
  27. #define ah r0
  28. #else
  29. #define al r0
  30. #define ah r1
  31. #endif
  32. ENTRY(__lshrdi3)
  33. ENTRY(__aeabi_llsr)
  34. subs r3, r2, #32
  35. rsb ip, r2, #32
  36. movmi al, al, lsr r2
  37. movpl al, ah, lsr r3
  38. ARM( orrmi al, al, ah, lsl ip )
  39. THUMB( lslmi r3, ah, ip )
  40. THUMB( orrmi al, al, r3 )
  41. mov ah, ah, lsr r2
  42. ret lr
  43. ENDPROC(__lshrdi3)
  44. ENDPROC(__aeabi_llsr)