llshru.S 613 B

1234567891011121314151617181920212223242526
  1. ;; SPDX-License-Identifier: GPL-2.0-or-later
  2. ;; Copyright (C) 2010 Texas Instruments Incorporated
  3. ;; Contributed by Mark Salter <msalter@redhat.com>.
  4. ;;
  5. ;; uint64_t __c6xabi_llshru(uint64_t val, uint shift)
  6. #include <linux/linkage.h>
  7. .text
  8. ENTRY(__c6xabi_llshru)
  9. mv .l1x B4,A1
  10. [!A1] b .s2 B3 ; return if zero shift count
  11. mvk .s1 32,A0
  12. sub .d1 A0,A1,A0
  13. cmplt .l1 0,A0,A2
  14. [A2] shl .s1 A5,A0,A0
  15. nop
  16. [!A2] neg .l1 A0,A4
  17. || [A2] shru .s1 A4,A1,A4
  18. [!A2] shru .s1 A5,A4,A4
  19. || [A2] or .d1 A4,A0,A4
  20. || [!A2] mvk .l1 0,A5
  21. [A2] shru .s1 A5,A1,A5
  22. bnop .s2 B3,5
  23. ENDPROC(__c6xabi_llshru)