5 #ifndef _MONO_METADATA_ENDIAN_H_
6 #define _MONO_METADATA_ENDIAN_H_ 1
18 unsigned char cval
[8];
21 #if defined(__s390x__)
23 #define read16(x) s390x_read16(*(guint16 *)(x))
24 #define read32(x) s390x_read32(*(guint32 *)(x))
25 #define read64(x) s390x_read64(*(guint64 *)(x))
27 static __inline__ guint16
28 s390x_read16(guint16 x
)
32 __asm__ (" lrvr %0,%1\n"
34 : "=r" (ret
) : "r" (x
));
39 static __inline__ guint32
40 s390x_read32(guint32 x
)
44 __asm__ (" lrvr %0,%1\n"
45 : "=r" (ret
) : "r" (x
));
50 static __inline__ guint64
51 s390x_read64(guint64 x
)
55 __asm__ (" lrvgr %0,%1\n"
56 : "=r" (ret
) : "r" (x
));
63 # if NO_UNALIGNED_ACCESS
65 guint16
mono_read16 (const unsigned char *x
);
66 guint32
mono_read32 (const unsigned char *x
);
67 guint64
mono_read64 (const unsigned char *x
);
69 #define read16(x) (mono_read16 ((const unsigned char *)(x)))
70 #define read32(x) (mono_read32 ((const unsigned char *)(x)))
71 #define read64(x) (mono_read64 ((const unsigned char *)(x)))
75 #define read16(x) GUINT16_FROM_LE (*((const guint16 *) (x)))
76 #define read32(x) GUINT32_FROM_LE (*((const guint32 *) (x)))
77 #define read64(x) GUINT64_FROM_LE (*((const guint64 *) (x)))
83 #define readr4(x,dest) \
86 mf.ival = read32 ((x)); \
90 #define readr8(x,dest) \
93 mf.ival = read64 ((x)); \
97 #endif /* _MONO_METADATA_ENDIAN_H_ */