Changeset 4fe3ad2 in rtems


Ignore:
Timestamp:
Jul 9, 2013, 2:37:32 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
296b60d7
Parents:
6886a485
git-author:
Sebastian Huber <sebastian.huber@…> (07/09/13 14:37:32)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/09/13 14:42:00)
Message:

bsps/powerpc: Add ppc_count_leading_zeros()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libcpu/powerpc/shared/include/powerpc-utility.h

    r6886a485 r4fe3ad2  
    406406
    407407  RTEMS_COMPILER_MEMORY_BARRIER();
     408}
     409
     410static inline uint32_t ppc_count_leading_zeros(uint32_t value)
     411{
     412  uint32_t count;
     413
     414  __asm__ (
     415    "cntlzw %0, %1;"
     416    : "=r" (count)
     417    : "r" (value)
     418  );
     419
     420  return count;
    408421}
    409422
Note: See TracChangeset for help on using the changeset viewer.