9 #define ui12_i 0x01234567
10 #define ui7f_i 0x7f7ff7f7
11 #define ui80_i 0x80800808
12 #define uiff_i 0xffffffff
13 #define ul12_i 0x0123456789abcdef
14 #define ul7f_i 0x7f7f7f7ff7f7f7f7
15 #define ul80_i 0x8080808008080808
16 #define ulff_i 0xffffffffffffffff
19 # define xus12_i 0xffff1234
20 # define xus7f_i 0x10107ff7
21 # define xus80_i 0x81188008
22 # define xusff_i 0xeaaeffff
24 # define xus12_i 0xffffffffffff1234
25 # define xus7f_i 0x1010100101017ff7
26 # define xus80_i 0x8181811818818008
27 # define xusff_i 0xeaeaeaaeaeaeffff
28 # define xui12_i 0xffffffff01234567
29 # define xui7f_i 0x101001017f7ff7f7
30 # define xui80_i 0x8181181880800808
31 # define xuiff_i 0xeaeaaeaeffffffff
34 #if __BYTE_ORDER == __LITTLE_ENDIAN
35 # define us12_o 0x3412
36 # define us7f_o 0xf77f
37 # define us80_o 0x0880
38 # define usff_o 0xffff
39 # define ui12_o 0x67452301
40 # define ui7f_o 0xf7f77f7f
41 # define ui80_o 0x08088080
42 # define uiff_o 0xffffffff
43 # define ul12_o 0xefcdab8967452301
44 # define ul7f_o 0xf7f7f7f77f7f7f7f
45 # define ul80_o 0x0808080880808080
46 # define ulff_o 0xffffffffffffffff
48 # define us12_o us12_i
49 # define us7f_o us7f_i
50 # define us80_o us80_i
51 # define usff_o usff_i
52 # define ui12_o ui12_i
53 # define ui7f_o ui7f_i
54 # define ui80_o ui80_i
55 # define uiff_o uiff_i
56 # define ul12_o ul12_i
57 # define ul7f_o ul7f_i
58 # define ul80_o ul80_i
59 # define ulff_o ulff_i
62 #define HTON4(I, O, T, R0, R1) \
65 beqi T##R0##R1##I %R1 O \
69 #define HTON3(T, R0, R1) \
70 HTON4(T##12_i, T##12_o, T, R0, R1) \
71 HTON4(x##T##12_i, T##12_o, T, R0, R1) \
72 HTON4(T##7f_i, T##7f_o, T, R0, R1) \
73 HTON4(x##T##7f_i, T##7f_o, T, R0, R1) \
74 HTON4(T##80_i, T##80_o, T, R0, R1) \
75 HTON4(x##T##80_i, T##80_o, T, R0, R1) \
76 HTON4(T##ff_i, T##ff_o, T, R0, R1) \
77 HTON4(x##T##ff_i, T##ff_o, T, R0, R1)
79 #define HTON3x(T, R0, R1) \
80 HTON4(T##12_i, T##12_o, T, R0, R1) \
81 HTON4(T##7f_i, T##7f_o, T, R0, R1) \
82 HTON4(T##80_i, T##80_o, T, R0, R1) \
83 HTON4(T##ff_i, T##ff_o, T, R0, R1)
85 #define HTON2(T, V0, V1, V2, R0, R1, R2) \
93 #define HTON2x(T, V0, V1, V2, R0, R1, R2) \
101 #define HTON1(T, V0, V1, V2, R0, R1, R2) \
102 HTON2(T, V0, V1, V2, R0, R1, R2) \
103 HTON2(T, V1, V2, R0, R1, R2, V0) \
104 HTON2(T, V2, R0, R1, R2, V0, V1) \
105 HTON2(T, R0, R1, R2, V0, V1, V2) \
106 HTON2(T, R1, R2, V0, V1, V2, R0) \
107 HTON2(T, R2, V0, V1, V2, R0, R1)
109 #define HTON1x(T, V0, V1, V2, R0, R1, R2) \
110 HTON2x(T, V0, V1, V2, R0, R1, R2) \
111 HTON2x(T, V1, V2, R0, R1, R2, V0) \
112 HTON2x(T, V2, R0, R1, R2, V0, V1) \
113 HTON2x(T, R0, R1, R2, V0, V1, V2) \
114 HTON2x(T, R1, R2, V0, V1, V2, R0) \
115 HTON2x(T, R2, V0, V1, V2, R0, R1)
118 # define HTON(V0, V1, V2, R0, R1, R2) \
119 HTON1(us, V0, V1, V2, R0, R1, R2) \
120 HTON1x(ui, V0, V1, V2, R0, R1, R2)
122 # define HTON(V0, V1, V2, R0, R1, R2) \
123 HTON1(us, V0, V1, V2, R0, R1, R2) \
124 HTON1(ui, V0, V1, V2, R0, R1, R2) \
125 HTON1x(ul, V0, V1, V2, R0, R1, R2)
130 /* simple sequence for easier disassembly reading and encoding check */
160 HTON(v0, v1, v2, r0, r1, r2)
162 // just to know did not abort