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 # define us12_o 0x3412
35 # define us7f_o 0xf77f
36 # define us80_o 0x0880
37 # define usff_o 0xffff
38 # define ui12_o 0x67452301
39 # define ui7f_o 0xf7f77f7f
40 # define ui80_o 0x08088080
41 # define uiff_o 0xffffffff
42 # define ul12_o 0xefcdab8967452301
43 # define ul7f_o 0xf7f7f7f77f7f7f7f
44 # define ul80_o 0x0808080880808080
45 # define ulff_o 0xffffffffffffffff
47 #define BSWAP4(I, O, T, R0, R1) \
50 beqi T##R0##R1##I %R1 O \
54 #define BSWAP3(T, R0, R1) \
55 BSWAP4(T##12_i, T##12_o, T, R0, R1) \
56 BSWAP4(x##T##12_i, T##12_o, T, R0, R1) \
57 BSWAP4(T##7f_i, T##7f_o, T, R0, R1) \
58 BSWAP4(x##T##7f_i, T##7f_o, T, R0, R1) \
59 BSWAP4(T##80_i, T##80_o, T, R0, R1) \
60 BSWAP4(x##T##80_i, T##80_o, T, R0, R1) \
61 BSWAP4(T##ff_i, T##ff_o, T, R0, R1) \
62 BSWAP4(x##T##ff_i, T##ff_o, T, R0, R1)
64 #define BSWAP3x(T, R0, R1) \
65 BSWAP4(T##12_i, T##12_o, T, R0, R1) \
66 BSWAP4(T##7f_i, T##7f_o, T, R0, R1) \
67 BSWAP4(T##80_i, T##80_o, T, R0, R1) \
68 BSWAP4(T##ff_i, T##ff_o, T, R0, R1)
70 #define BSWAP2(T, V0, V1, V2, R0, R1, R2) \
78 #define BSWAP2x(T, V0, V1, V2, R0, R1, R2) \
86 #define BSWAP1(T, V0, V1, V2, R0, R1, R2) \
87 BSWAP2(T, V0, V1, V2, R0, R1, R2) \
88 BSWAP2(T, V1, V2, R0, R1, R2, V0) \
89 BSWAP2(T, V2, R0, R1, R2, V0, V1) \
90 BSWAP2(T, R0, R1, R2, V0, V1, V2) \
91 BSWAP2(T, R1, R2, V0, V1, V2, R0) \
92 BSWAP2(T, R2, V0, V1, V2, R0, R1)
94 #define BSWAP1x(T, V0, V1, V2, R0, R1, R2) \
95 BSWAP2x(T, V0, V1, V2, R0, R1, R2) \
96 BSWAP2x(T, V1, V2, R0, R1, R2, V0) \
97 BSWAP2x(T, V2, R0, R1, R2, V0, V1) \
98 BSWAP2x(T, R0, R1, R2, V0, V1, V2) \
99 BSWAP2x(T, R1, R2, V0, V1, V2, R0) \
100 BSWAP2x(T, R2, V0, V1, V2, R0, R1)
103 # define BSWAP(V0, V1, V2, R0, R1, R2) \
104 BSWAP1(us, V0, V1, V2, R0, R1, R2) \
105 BSWAP1x(ui, V0, V1, V2, R0, R1, R2)
107 # define BSWAP(V0, V1, V2, R0, R1, R2) \
108 BSWAP1(us, V0, V1, V2, R0, R1, R2) \
109 BSWAP1(ui, V0, V1, V2, R0, R1, R2) \
110 BSWAP1x(ul, V0, V1, V2, R0, R1, R2)
115 /* simple sequence for easier disassembly reading and encoding check */
145 BSWAP(v0, v1, v2, r0, r1, r2)
147 // just to know did not abort