24
24
#define mi_sint1korr(A) ((int8_t)(*A))
25
25
#define mi_uint1korr(A) ((uint8_t)(*A))
27
#define mi_sint2korr(A) ((int16_t) (((int16_t) (((uchar*) (A))[1])) +\
28
((int16_t) ((int16_t) ((char*) (A))[0]) << 8)))
29
#define mi_sint3korr(A) ((int32_t) (((((uchar*) (A))[0]) & 128) ? \
27
#define mi_sint2korr(A) ((int16_t) (((int16_t) (((const uchar*) (A))[1])) +\
28
((int16_t) ((int16_t) ((const char*) (A))[0]) << 8)))
29
#define mi_sint3korr(A) ((int32_t) (((((const uchar*) (A))[0]) & 128) ? \
30
30
(((uint32_t) 255L << 24) | \
31
(((uint32_t) ((uchar*) (A))[0]) << 16) |\
32
(((uint32_t) ((uchar*) (A))[1]) << 8) | \
33
((uint32_t) ((uchar*) (A))[2])) : \
34
(((uint32_t) ((uchar*) (A))[0]) << 16) |\
35
(((uint32_t) ((uchar*) (A))[1]) << 8) | \
36
((uint32_t) ((uchar*) (A))[2])))
37
#define mi_sint4korr(A) ((int32_t) (((int32_t) (((uchar*) (A))[3])) +\
38
((int32_t) (((uchar*) (A))[2]) << 8) +\
39
((int32_t) (((uchar*) (A))[1]) << 16) +\
40
((int32_t) ((int16_t) ((char*) (A))[0]) << 24)))
31
(((uint32_t) ((const uchar*) (A))[0]) << 16) |\
32
(((uint32_t) ((const uchar*) (A))[1]) << 8) | \
33
((uint32_t) ((const uchar*) (A))[2])) : \
34
(((uint32_t) ((const uchar*) (A))[0]) << 16) |\
35
(((uint32_t) ((const uchar*) (A))[1]) << 8) | \
36
((uint32_t) ((const uchar*) (A))[2])))
37
#define mi_sint4korr(A) ((int32_t) (((int32_t) (((const uchar*) (A))[3])) +\
38
((int32_t) (((const uchar*) (A))[2]) << 8) +\
39
((int32_t) (((const uchar*) (A))[1]) << 16) +\
40
((int32_t) ((int16_t) ((const char*) (A))[0]) << 24)))
41
41
#define mi_sint8korr(A) ((int64_t) mi_uint8korr(A))
42
#define mi_uint2korr(A) ((uint16_t) (((uint16_t) (((uchar*) (A))[1])) +\
43
((uint16_t) (((uchar*) (A))[0]) << 8)))
44
#define mi_uint3korr(A) ((uint32_t) (((uint32_t) (((uchar*) (A))[2])) +\
45
(((uint32_t) (((uchar*) (A))[1])) << 8) +\
46
(((uint32_t) (((uchar*) (A))[0])) << 16)))
47
#define mi_uint4korr(A) ((uint32_t) (((uint32_t) (((uchar*) (A))[3])) +\
48
(((uint32_t) (((uchar*) (A))[2])) << 8) +\
49
(((uint32_t) (((uchar*) (A))[1])) << 16) +\
50
(((uint32_t) (((uchar*) (A))[0])) << 24)))
51
#define mi_uint5korr(A) ((uint64_t)(((uint32_t) (((uchar*) (A))[4])) +\
52
(((uint32_t) (((uchar*) (A))[3])) << 8) +\
53
(((uint32_t) (((uchar*) (A))[2])) << 16) +\
54
(((uint32_t) (((uchar*) (A))[1])) << 24)) +\
55
(((uint64_t) (((uchar*) (A))[0])) << 32))
56
#define mi_uint6korr(A) ((uint64_t)(((uint32_t) (((uchar*) (A))[5])) +\
57
(((uint32_t) (((uchar*) (A))[4])) << 8) +\
58
(((uint32_t) (((uchar*) (A))[3])) << 16) +\
59
(((uint32_t) (((uchar*) (A))[2])) << 24)) +\
60
(((uint64_t) (((uint32_t) (((uchar*) (A))[1])) +\
61
(((uint32_t) (((uchar*) (A))[0]) << 8)))) <<\
63
#define mi_uint7korr(A) ((uint64_t)(((uint32_t) (((uchar*) (A))[6])) +\
64
(((uint32_t) (((uchar*) (A))[5])) << 8) +\
65
(((uint32_t) (((uchar*) (A))[4])) << 16) +\
66
(((uint32_t) (((uchar*) (A))[3])) << 24)) +\
67
(((uint64_t) (((uint32_t) (((uchar*) (A))[2])) +\
68
(((uint32_t) (((uchar*) (A))[1])) << 8) +\
69
(((uint32_t) (((uchar*) (A))[0])) << 16))) <<\
71
#define mi_uint8korr(A) ((uint64_t)(((uint32_t) (((uchar*) (A))[7])) +\
72
(((uint32_t) (((uchar*) (A))[6])) << 8) +\
73
(((uint32_t) (((uchar*) (A))[5])) << 16) +\
74
(((uint32_t) (((uchar*) (A))[4])) << 24)) +\
75
(((uint64_t) (((uint32_t) (((uchar*) (A))[3])) +\
76
(((uint32_t) (((uchar*) (A))[2])) << 8) +\
77
(((uint32_t) (((uchar*) (A))[1])) << 16) +\
78
(((uint32_t) (((uchar*) (A))[0])) << 24))) <<\
42
#define mi_uint2korr(A) ((uint16_t) (((uint16_t) (((const uchar*) (A))[1])) +\
43
((uint16_t) (((const uchar*) (A))[0]) << 8)))
44
#define mi_uint3korr(A) ((uint32_t) (((uint32_t) (((const uchar*) (A))[2])) +\
45
(((uint32_t) (((const uchar*) (A))[1])) << 8) +\
46
(((uint32_t) (((const uchar*) (A))[0])) << 16)))
47
#define mi_uint4korr(A) ((uint32_t) (((uint32_t) (((const uchar*) (A))[3])) +\
48
(((uint32_t) (((const uchar*) (A))[2])) << 8) +\
49
(((uint32_t) (((const uchar*) (A))[1])) << 16) +\
50
(((uint32_t) (((const uchar*) (A))[0])) << 24)))
51
#define mi_uint5korr(A) ((uint64_t)(((uint32_t) (((const uchar*) (A))[4])) +\
52
(((uint32_t) (((const uchar*) (A))[3])) << 8) +\
53
(((uint32_t) (((const uchar*) (A))[2])) << 16) +\
54
(((uint32_t) (((const uchar*) (A))[1])) << 24)) +\
55
(((uint64_t) (((const uchar*) (A))[0])) << 32))
56
#define mi_uint6korr(A) ((uint64_t)(((uint32_t) (((const uchar*) (A))[5])) +\
57
(((uint32_t) (((const uchar*) (A))[4])) << 8) +\
58
(((uint32_t) (((const uchar*) (A))[3])) << 16) +\
59
(((uint32_t) (((const uchar*) (A))[2])) << 24)) +\
60
(((uint64_t) (((uint32_t) (((const uchar*) (A))[1])) +\
61
(((uint32_t) (((const uchar*) (A))[0]) << 8)))) <<\
63
#define mi_uint7korr(A) ((uint64_t)(((uint32_t) (((const uchar*) (A))[6])) +\
64
(((uint32_t) (((const uchar*) (A))[5])) << 8) +\
65
(((uint32_t) (((const uchar*) (A))[4])) << 16) +\
66
(((uint32_t) (((const uchar*) (A))[3])) << 24)) +\
67
(((uint64_t) (((uint32_t) (((const uchar*) (A))[2])) +\
68
(((uint32_t) (((const uchar*) (A))[1])) << 8) +\
69
(((uint32_t) (((const uchar*) (A))[0])) << 16))) <<\
71
#define mi_uint8korr(A) ((uint64_t)(((uint32_t) (((const uchar*) (A))[7])) +\
72
(((uint32_t) (((const uchar*) (A))[6])) << 8) +\
73
(((uint32_t) (((const uchar*) (A))[5])) << 16) +\
74
(((uint32_t) (((const uchar*) (A))[4])) << 24)) +\
75
(((uint64_t) (((uint32_t) (((const uchar*) (A))[3])) +\
76
(((uint32_t) (((const uchar*) (A))[2])) << 8) +\
77
(((uint32_t) (((const uchar*) (A))[1])) << 16) +\
78
(((uint32_t) (((const uchar*) (A))[0])) << 24))) <<\
81
81
/* This one is for uniformity */
127
127
#ifdef WORDS_BIGENDIAN
129
#define mi_float4store(T,A) { ((uchar*) (T))[0]= ((uchar*) &A)[0];\
130
((uchar*) (T))[1]= ((uchar*) &A)[1];\
131
((uchar*) (T))[2]= ((uchar*) &A)[2];\
132
((uchar*) (T))[3]= ((uchar*) &A)[3]; }
129
#define mi_float4store(T,A) { ((uchar*) (T))[0]= ((const uchar*) &A)[0];\
130
((uchar*) (T))[1]= ((const uchar*) &A)[1];\
131
((uchar*) (T))[2]= ((const uchar*) &A)[2];\
132
((uchar*) (T))[3]= ((const uchar*) &A)[3]; }
134
134
#define mi_float4get(V,M) { float def_temp;\
135
((uchar*) &def_temp)[0]= ((uchar*) (M))[0];\
136
((uchar*) &def_temp)[1]= ((uchar*) (M))[1];\
137
((uchar*) &def_temp)[2]= ((uchar*) (M))[2];\
138
((uchar*) &def_temp)[3]= ((uchar*) (M))[3];\
135
((uchar*) &def_temp)[0]= ((const uchar*) (M))[0];\
136
((uchar*) &def_temp)[1]= ((const uchar*) (M))[1];\
137
((uchar*) &def_temp)[2]= ((const uchar*) (M))[2];\
138
((uchar*) &def_temp)[3]= ((const uchar*) (M))[3];\
141
141
#define mi_float8store(T,V) { ((uchar*) (T))[0]= ((uchar*) &V)[0];\