Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mb_endian.h « microblaze « machine « libc « newlib - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fb217ec85d5e7a2439fcfdffeb51720fb4d08352 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#ifndef _MB_ENDIAN_H
#define _MB_ENDIAN_H

/* Convenience macros for loading and store 4 bytes in a byte invariant way with
 * a singe instruction. Endianess affects this and we rely on MicroBlaze
 * load/store reverse instructions to do the trick on little-endian systems.
 */
#ifdef __LITTLE_ENDIAN__
#define LOAD4BYTES(rD,rA,rB)   "\tlwr\t" rD ", " rA ", " rB "\n"
#define STORE4BYTES(rD,rA,rB)  "\tswr\t" rD ", " rA ", " rB "\n"
#else
#define LOAD4BYTES(rD,rA,rB)   "\tlw\t" rD ", " rA ", " rB "\n"
#define STORE4BYTES(rD,rA,rB)  "\tsw\t" rD ", " rA ", " rB "\n"
#endif
#endif