Commit bc455ce
authored
Rollup merge of rust-lang#114382 - scottmcm:compare-bytes-intrinsic, r=cjgillot
Add a new `compare_bytes` intrinsic instead of calling `memcmp` directly
As discussed in rust-lang#113435, this lets the backends be the place that can have the "don't call the function if n == 0" logic, if it's needed for the target. (I didn't actually *add* those checks, though, since as I understood it we didn't actually need them on known targets?)
Doing this also let me make it `const` (unstable), which I don't think `extern "C" fn memcmp` can be.
cc `@RalfJung` `@Amanieu`2 files changed
+40
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2385 | 2385 | | |
2386 | 2386 | | |
2387 | 2387 | | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
2388 | 2407 | | |
2389 | 2408 | | |
2390 | 2409 | | |
| |||
2825 | 2844 | | |
2826 | 2845 | | |
2827 | 2846 | | |
| 2847 | + | |
| 2848 | + | |
| 2849 | + | |
| 2850 | + | |
| 2851 | + | |
| 2852 | + | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
| 2856 | + | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | 10 | | |
21 | 11 | | |
22 | 12 | | |
| |||
74 | 64 | | |
75 | 65 | | |
76 | 66 | | |
77 | | - | |
| 67 | + | |
| 68 | + | |
78 | 69 | | |
79 | 70 | | |
80 | 71 | | |
| |||
88 | 79 | | |
89 | 80 | | |
90 | 81 | | |
91 | | - | |
| 82 | + | |
92 | 83 | | |
93 | 84 | | |
94 | 85 | | |
| |||
183 | 174 | | |
184 | 175 | | |
185 | 176 | | |
186 | | - | |
| 177 | + | |
187 | 178 | | |
188 | 179 | | |
189 | 180 | | |
| |||
195 | 186 | | |
196 | 187 | | |
197 | 188 | | |
198 | | - | |
| 189 | + | |
199 | 190 | | |
200 | 191 | | |
201 | 192 | | |
| |||
0 commit comments