Changeset d04e891 in rtems


Ignore:
Timestamp:
Nov 4, 2005, 12:29:17 PM (15 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
47b5568
Parents:
0a708729
Message:

Remove arch_swap (Unused).

File:
1 edited

Legend:

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

    r0a708729 rd04e891  
    4848}
    4949
    50 /* alas, egcs sounds like it has a bug in this code that doesn't use the
    51    inline asm correctly, and can cause file corruption. Until I hear that
    52    it's fixed, I can live without the extra speed. I hope. */
    53 #if !(__GNUC__ >= 2 && __GNUC_MINOR__ >= 90)
    54 #if 0
    55 #  define __arch_swab16(x) ld_le16(&x)
    56 #  define __arch_swab32(x) ld_le32(&x)
    57 #else
    58 static __inline__ __const__ unsigned short ___arch__swab16(unsigned short value)
    59 {
    60         unsigned int tmp;
    61 
    62         __asm__("rlwimi %0,%0,8,0xff0000"
    63             : "=r" (tmp)
    64             : "0" (value));
    65         return (tmp&0x00ffff00)>>8;
    66 }
    67 
    68 static __inline__ __const__ unsigned int ___arch__swab32(unsigned int value)
    69 {
    70         unsigned int result;
    71 
    72         __asm__("rotlwi %0,%1,24\n\t"
    73             "rlwimi %0,%1,8,0xff\n\t"
    74             "rlwimi %0,%1,8,0xff0000"
    75             : "=&r" (result)
    76             : "r" (value));
    77         return result;
    78 }
    79 #define __arch__swab32(x) ___arch__swab32(x)
    80 #define __arch__swab16(x) ___arch__swab16(x)
    81 #endif /* 0 */
    82 
    83 #endif
    84 
    85 /* The same, but returns converted value from the location pointer by addr. */
    86 #define __arch__swab16p(addr) ld_le16(addr)
    87 #define __arch__swab32p(addr) ld_le32(addr)
    88 
    89 /* The same, but do the conversion in situ, ie. put the value back to addr. */
    90 #define __arch__swab16s(addr) st_le16(addr,*addr)
    91 #define __arch__swab32s(addr) st_le32(addr,*addr)
    92 
    9350#endif /* __GNUC__ */
    9451
Note: See TracChangeset for help on using the changeset viewer.