about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-08-22 15:15:38 +0200
committerGitHub <noreply@github.com>2019-08-22 15:15:38 +0200
commit30fd79cb6c8d68df10392595231a55e83f217f61 (patch)
tree0be4c696060da9d09bfa9809144d3b4d802e66a8 /src/libstd/sys/unix/stack_overflow.rs
parent07843959123b5d3598d3795891548513acd568bd (diff)
parentf5b16f6212d2d72d505d4d6b1dedc2c9c61dd014 (diff)
downloadrust-30fd79cb6c8d68df10392595231a55e83f217f61.tar.gz
rust-30fd79cb6c8d68df10392595231a55e83f217f61.zip
Rollup merge of #63767 - lzutao:integer-ord-suboptimal, r=nagisa
Use more optimal Ord implementation for integers

Closes #63758
r? @nagisa

### Compare results

([godbolt link](https://godbolt.org/z/dsbczy))

Old assembly:
```asm
example::cmp1:
  mov eax, dword ptr [rdi]
  mov ecx, dword ptr [rsi]
  cmp eax, ecx
  setae dl
  add dl, dl
  add dl, -1
  xor esi, esi
  cmp eax, ecx
  movzx eax, dl
  cmove eax, esi
  ret
```

New assembly:
```asm
example::cmp2:
  mov eax, dword ptr [rdi]
  xor ecx, ecx
  cmp eax, dword ptr [rsi]
  seta cl
  mov eax, 255
  cmovae eax, ecx
  ret
```

Old llvm-mca statistics:
```
Iterations:        100
Instructions:      1100
Total Cycles:      243
Total uOps:        1300

Dispatch Width:    6
uOps Per Cycle:    5.35
IPC:               4.53
Block RThroughput: 2.2
```

New llvm-mca statistics:
```
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
```
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions