21 #ifndef AVUTIL_AVR32_INTREADWRITE_H 22 #define AVUTIL_AVR32_INTREADWRITE_H 42 #define AV_RL16 AV_RL16 46 __asm__ (
"ld.ub %0, %1 \n\t" 47 "ldins.b %0:l, %2 \n\t" 53 #define AV_RB16 AV_RB16 57 __asm__ (
"ld.ub %0, %2 \n\t" 58 "ldins.b %0:l, %1 \n\t" 64 #define AV_RB24 AV_RB24 68 __asm__ (
"ld.ub %0, %3 \n\t" 69 "ldins.b %0:l, %2 \n\t" 70 "ldins.b %0:u, %1 \n\t" 73 "RKs12"(*((
const uint8_t*)p+1)),
78 #define AV_RL24 AV_RL24 82 __asm__ (
"ld.ub %0, %1 \n\t" 83 "ldins.b %0:l, %2 \n\t" 84 "ldins.b %0:u, %3 \n\t" 87 "RKs12"(*((
const uint8_t*)p+1)),
88 "RKs12"(*((
const uint8_t*)p+2)));
94 #define AV_RB32 AV_RB32 98 __asm__ (
"ld.w %0, %1" :
"=r"(v) :
"m"(*(
const uint32_t*)p));
102 #define AV_WB32 AV_WB32 105 __asm__ (
"st.w %0, %1" :
"=m"(*(uint32_t*)p) :
"r"(v));
109 #define AV_RL32(p) av_bswap32(AV_RB32(p)) 110 #define AV_WL32(p, v) AV_WB32(p, av_bswap32(v)) 112 #define AV_WB64 AV_WB64 115 union { uint64_t v; uint32_t hl[2]; } vv = { v };
117 AV_WB32((uint32_t*)p+1, vv.hl[1]);
120 #define AV_WL64 AV_WL64 123 union { uint64_t v; uint32_t hl[2]; } vv = { v };
125 AV_WL32((uint32_t*)p+1, vv.hl[0]);
130 #define AV_RB32 AV_RB32 134 __asm__ (
"ld.ub %0, %4 \n\t" 135 "ldins.b %0:l, %3 \n\t" 136 "ldins.b %0:u, %2 \n\t" 137 "ldins.b %0:t, %1 \n\t" 139 :
"RKs12"(* (
const uint8_t*)p),
140 "RKs12"(*((
const uint8_t*)p+1)),
141 "RKs12"(*((
const uint8_t*)p+2)),
146 #define AV_RL32 AV_RL32 150 __asm__ (
"ld.ub %0, %1 \n\t" 151 "ldins.b %0:l, %2 \n\t" 152 "ldins.b %0:u, %3 \n\t" 153 "ldins.b %0:t, %4 \n\t" 156 "RKs12"(*((
const uint8_t*)p+1)),
157 "RKs12"(*((
const uint8_t*)p+2)),
158 "RKs12"(*((
const uint8_t*)p+3)));
164 #define AV_RB64 AV_RB64 167 union { uint64_t v; uint32_t hl[2]; } v;
169 v.hl[1] =
AV_RB32((
const uint32_t*)p+1);
173 #define AV_RL64 AV_RL64 176 union { uint64_t v; uint32_t hl[2]; } v;
178 v.hl[0] =
AV_RL32((
const uint32_t*)p+1);