18 #ifndef __CORE_COMPATIABLE_H__
19 #define __CORE_COMPATIABLE_H__
42 #define __ISB() __RWMB()
45 #define __DSB() __RWMB()
48 #define __DMB() __RWMB()
51 #define __LDRBT(ptr) __LB((ptr))
53 #define __LDRHT(ptr) __LH((ptr))
55 #define __LDRT(ptr) __LW((ptr))
58 #define __STRBT(val, ptr) __SB((ptr), (val))
60 #define __STRHT(val, ptr) __SH((ptr), (val))
62 #define __STRT(val, ptr) __SW((ptr), (val))
74 if ((sat >= 1U) && (sat <= 32U)) {
75 const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U);
76 const int32_t min = -1 - max ;
79 }
else if (val < min) {
96 const uint32_t max = ((1U << sat) - 1U);
97 if (val > (int32_t)max) {
103 return (uint32_t)val;
118 result = ((value & 0xff000000) >> 24)
119 | ((value & 0x00ff0000) >> 8 )
120 | ((value & 0x0000ff00) << 8 )
121 | ((value & 0x000000ff) << 24);
135 result = ((value & 0xff000000) >> 8)
136 | ((value & 0x00ff00000) << 8 )
137 | ((value & 0x0000ff00) >> 8 )
138 | ((value & 0x000000ff) << 8) ;
154 result = ((value & 0xff00) >> 8) | ((value & 0x00ff) << 8);
172 return (op1 >> op2) | (op1 << (32U - op2));
184 uint32_t s = (4U * 8U) - 1U;
187 for (value >>= 1U; value != 0U; value >>= 1U) {
189 result |= value & 1U;
205 uint32_t temp = ~data;
206 while (temp & 0x80000000) {
215 #define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \
216 ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) )
218 #define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \
219 ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) )