Advertisement
Guest User

ffs.diff

a guest
Aug 12th, 2014
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. diff --git a/firmware/asm/arm/ffs.S b/firmware/asm/arm/ffs.S
  2. index 4e912c5..bebf33f 100644
  3. --- a/firmware/asm/arm/ffs.S
  4. +++ b/firmware/asm/arm/ffs.S
  5. @@ -32,6 +32,10 @@
  6. * 31 - bit 31 is set
  7. * 32 - no bits set
  8. ****************************************************************************/
  9. +#if (ARCH_PROFILE == arch_profile_m)
  10. + .syntax unified
  11. + .thumb
  12. +#endif
  13. .align 2
  14. .global find_first_set_bit
  15. .type find_first_set_bit,%function
  16. @@ -44,6 +48,9 @@ find_first_set_bit:
  17.  
  18. #if ARM_ARCH >= 5
  19. clz r0, r1 @ Get lead 0's count
  20. +# if (ARCH_PROFILE == arch_profile_m)
  21. + it ne
  22. +# endif
  23. rsbne r0, r0, #31 @ lead 0's -> bit index
  24. bx lr @
  25. #else
  26. @@ -73,3 +80,4 @@ L_ffs_table:
  27. .byte 29, 0, 22, 18, 28, 17, 16, 0 @ 56-63
  28. #endif
  29. .size find_first_set_bit, .-find_first_set_bit
  30. +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement