aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vppinfra/byte_order.h44
1 files changed, 3 insertions, 41 deletions
diff --git a/src/vppinfra/byte_order.h b/src/vppinfra/byte_order.h
index 87918f14e5c..9beb4470634 100644
--- a/src/vppinfra/byte_order.h
+++ b/src/vppinfra/byte_order.h
@@ -56,14 +56,7 @@
always_inline u16
clib_byte_swap_u16 (u16 x)
{
-#if defined (__aarch64__)
- if (!__builtin_constant_p (x))
- {
- __asm__ ("rev16 %w0, %w0":"+r" (x));
- return x;
- }
-#endif
- return (x >> 8) | (x << 8);
+ return __builtin_bswap16 (x);
}
always_inline i16
@@ -75,20 +68,7 @@ clib_byte_swap_i16 (i16 x)
always_inline u32
clib_byte_swap_u32 (u32 x)
{
-#if defined (i386) || defined (__x86_64__)
- if (!__builtin_constant_p (x))
- {
- asm volatile ("bswap %0":"=r" (x):"0" (x));
- return x;
- }
-#elif defined (__aarch64__)
- if (!__builtin_constant_p (x))
- {
- __asm__ ("rev %w0, %w0":"+r" (x));
- return x;
- }
-#endif
- return ((x << 24) | ((x & 0xff00) << 8) | ((x >> 8) & 0xff00) | (x >> 24));
+ return __builtin_bswap32 (x);
}
always_inline i32
@@ -100,25 +80,7 @@ clib_byte_swap_i32 (i32 x)
always_inline u64
clib_byte_swap_u64 (u64 x)
{
-#if defined (__x86_64__)
- if (!__builtin_constant_p (x))
- {
- asm volatile ("bswapq %0":"=r" (x):"0" (x));
- return x;
- }
-#elif defined (__aarch64__)
- if (!__builtin_constant_p (x))
- {
- __asm__ ("rev %0, %0":"+r" (x));
- return x;
- }
-#endif
-#define _(x,n,i) \
- ((((x) >> (8*(i))) & 0xff) << (8*((n)-(i)-1)))
- return (_(x, 8, 0) | _(x, 8, 1)
- | _(x, 8, 2) | _(x, 8, 3)
- | _(x, 8, 4) | _(x, 8, 5) | _(x, 8, 6) | _(x, 8, 7));
-#undef _
+ return __builtin_bswap64 (x);
}
always_inline i64
id=46ff7172bfd32f96c45bd8c6f4a937c941d058b7'>treecommitdiffstats
path: root/tests/vpp/perf/ip4/2n1l-10ge2p1x710-ethip4udp-ip4base-oacl50sf-10kflows-ndrpdr.robot
blob: 100e1cd23320fe10791f2098fa07eb137717660c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152