rust/src/test
Alex Crichton 41ee6df261 rollup merge of #24846: dotdash/fast_cttz8
Currently, LLVM lowers a cttz8 on x86_64 to these instructions:

```asm
    movzbl      %dil, %eax
    bsfl        %eax, %eax
    movl        $32, %ecx
    cmovnel     %eax, %ecx
    cmpl        $32, %ecx
    movl        $8, %eax
    cmovnel     %ecx, %eax
```

To improve the codegen, we can zero extend the 8 bit integer, then set
bit 8 and perform a cttz operation on the extended value. That way
there's no conditional operation involved at all.

This was discovered by  this benchmark: https://github.com/Kimundi/long_strings_without_repeats

Timings on my box with the current nightly:
```
running 4 tests
test bench_cpp_naive_big     ... bench:   5479222 ns/iter (+/- 254222)
test bench_noop_big          ... bench:    571405 ns/iter (+/- 111950)
test bench_rust_naive_big    ... bench:   7798102 ns/iter (+/- 148841)
test bench_rust_unsafe_big   ... bench:   6606488 ns/iter (+/- 67529)
```

Timings with the patch applied:
```
running 4 tests
test bench_cpp_naive_big     ... bench:   5470944 ns/iter (+/- 7109)
test bench_noop_big          ... bench:    568944 ns/iter (+/- 6895)
test bench_rust_naive_big    ... bench:   6795901 ns/iter (+/- 43806)
test bench_rust_unsafe_big   ... bench:   5584879 ns/iter (+/- 5291)
```
2015-04-29 15:45:37 -07:00
..
auxiliary Auto merge of #24932 - pnkfelix:fix-issue-24687, r=huonw 2015-04-29 10:40:03 +00:00
bench Auto merge of #24681 - tamird:unignore-android, r=alexcrichton 2015-04-29 04:09:45 +00:00
codegen Mass rename uint/int to usize/isize 2015-03-26 12:10:22 -07:00
compile-fail Register new snapshots 2015-04-28 17:23:45 -07:00
compile-fail-fulldeps Remove FakeExtCtxt from qquote tests. 2015-04-26 01:09:36 -04:00
debuginfo #10381: Warnings 2015-04-28 17:51:43 -07:00
parse-fail Auto merge of #23606 - quantheory:associated_const, r=nikomatsakis 2015-04-27 16:45:21 +00:00
pretty std: Bring back f32::from_str_radix as an unstable API 2015-04-21 15:23:54 -07:00
run-fail Move qquote.rs from run-fail to run-fail-fulldeps 2015-04-26 06:05:39 -07:00
run-fail-fulldeps Move qquote.rs from run-fail to run-fail-fulldeps 2015-04-26 06:05:39 -07:00
run-make Remove remaining tests for hygiene-encoded identifiers. 2015-04-25 21:42:10 -04:00
run-pass rollup merge of #24846: dotdash/fast_cttz8 2015-04-29 15:45:37 -07:00
run-pass-fulldeps test: Fix some tests to run with musl 2015-04-28 09:35:22 -07:00
run-pass-valgrind test: Fix fallout in run-pass tests 2015-04-14 10:14:19 -07:00
rustdoc Replace ignore-android with ignore-cross-compile in rustdoc tests 2015-04-22 20:32:14 -07:00