// big endian config

#define SWAP16(x) _byteswap_ushort(x)
#define SWAP32(x) _byteswap_ulong(x)

#define HOST2LE32(x) SWAP32(x)
#define HOST2BE32(x) (x)
#define LE2HOST32(x) SWAP32(x)
#define BE2HOST32(x) (x)

#define HOST2LE16(x) SWAP16(x)
#define HOST2BE16(x) (x)
#define LE2HOST16(x) SWAP16(x)
#define BE2HOST16(x) (x)

#define GETLE32(X) __loadwordbytereverse((int)X,0)
#define GETLE16(X) __loadshortbytereverse((int)X,0)
#define  PUTLE16(X,Y) __storeshortbytereverse(Y,(int)X,0);
#define  PUTLE32(X,Y) __storewordbytereverse(Y,(int)X,0);

#define GETLEs16(X) ((int16_t)GETLE16((uint16_t *)X))
#define GETLEs32(X) ((int16_t)GETLE32((uint16_t *)X))