Commit c985765
authored
Rollup merge of rust-lang#63992 - lzutao:integer-ord, r=nagisa
Small improvement for Ord implementation of integers
Godbolt link: https://godbolt.org/z/tuTDOg
### Before
**asm**
```asm
example::cmp:
mov eax, dword ptr [rdi]
xor ecx, ecx
cmp eax, dword ptr [rsi]
seta cl
mov eax, 255
cmovae eax, ecx
ret
```
**llvm-mca**
```
Iterations: 100
Instructions: 700
Total Cycles: 217
Total uOps: 1100
Dispatch Width: 6
uOps Per Cycle: 5.07
IPC: 3.23
Block RThroughput: 1.8
```
### After
**asm**
```asm
example::cmp:
mov eax, dword ptr [rdi]
xor ecx, ecx
cmp eax, dword ptr [rsi]
setne cl
mov eax, 255
cmovae eax, ecx
ret
```
**llvm-mca**
```
Iterations: 100
Instructions: 700
Total Cycles: 209
Total uOps: 1000
Dispatch Width: 6
uOps Per Cycle: 4.78
IPC: 3.35
Block RThroughput: 1.7
```
r? @nagisa2 files changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1015 | 1015 | | |
1016 | 1016 | | |
1017 | 1017 | | |
1018 | | - | |
1019 | | - | |
| 1018 | + | |
| 1019 | + | |
1020 | 1020 | | |
1021 | 1021 | | |
1022 | 1022 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
0 commit comments