Commit Graph

49475 Commits

Author SHA1 Message Date
Sergey Veselkov
b986698bc4 Fix typo in bibliography.md 2016-01-13 09:14:21 +03:00
bors
f1bcfdd8e4 Auto merge of #30639 - rkruppe:dec2flt-fastpath-tables, r=alexcrichton
Add tables of small powers of ten used in the fast path. The tables are redundant: We could also use the big, more accurate table and round the value to the correct type (in fact we did just that before this commit). However, the rounding is extra work and slows down the fast path.

Because only very small exponents enter the fast path, the table and thus the space overhead is negligible. Speed-wise, this is a clear win on a [benchmark] comparing the fast path to a naive, hand-optimized, inaccurate algorithm. Specifically, this change narrows the gap from a roughly 5x difference to a roughly 3.4x difference.

[benchmark]: https://gist.github.com/Veedrac/dbb0c07994bc7882098e
2016-01-13 02:05:02 +00:00
Anton Blanchard
12aec073a8 Simplify some uses of cfg in test cases
While adding PowerPC64 support it was noticed that some testcases should
just use target_pointer_width, and others should select between
x86 and !x86.
2016-01-13 01:39:01 +00:00
Anton Blanchard
7ff64b20f9 Incorrect getrandom() system call for PowerPC Linux
Michael Ellerman pointed out that the system call for getrandom()
on PowerPC Linux is incorrect. This bug was in the powerpc32 port,
and was carried over to the powerpc64 port too.
2016-01-13 01:39:01 +00:00
Anton Blanchard
b372910476 Add powerpc64 and powerpc64le support
This adds support for big endian and little endian PowerPC64.
make check runs clean apart from one big endian backtrace issue.
2016-01-13 01:39:00 +00:00
Jeffrey Seyfried
a8514d3ecc resolve: use arena allocation instead of reference counting for Modules to fix memory leaks from Rc cycles 2016-01-13 00:54:16 +00:00
Niko Matsakis
0254f69d74 use fileline_ and not full span_ for the followon messages 2016-01-12 19:38:12 -05:00
Michael Sproul
c1e527f11d Add an impl for Box<Error> from &str. 2016-01-13 10:38:44 +11:00
bors
49c3827790 Auto merge of #30601 - tamird:delegate-libc, r=alexcrichton
See: http://developer.android.com/ndk/downloads/revision_history.html

Also, use `libc`'s `posix_memalign`.
2016-01-12 22:49:02 +00:00
Niko Matsakis
f9b5463a0d Fix long line in URL 2016-01-12 17:12:32 -05:00
Robin Kruppe
dad1df6c1a Speed up dec2flt fast path with additional tables.
Add tables of small powers of ten used in the fast path. The tables are redundant: We could also use the big, more accurate table and round the value to the correct type (in fact we did just that before this commit). However, the rounding is extra work and slows down the fast path.

Because only very small exponents enter the fast path, the table and thus the space overhead is negligible. Speed-wise, this is a clear win on a [benchmark] comparing the fast path to a naive, hand-optimized, inaccurate algorithm. Specifically, this change narrows the gap from a roughly 5x difference to a roughly 3.4x difference.

[benchmark]: https://gist.github.com/Veedrac/dbb0c07994bc7882098e
2016-01-12 22:25:16 +01:00
Ulrik Sverdrup
11e3de39d9 Add fast path for ASCII in UTF-8 validation
This speeds up the ascii case (and long stretches of ascii in otherwise
mixed UTF-8 data) when checking UTF-8 validity.

Benchmark results suggest that on purely ASCII input, we can improve
throughput (megabytes verified / second) by a factor of 13 to 14!
On xml and mostly english language input (en.wikipedia xml dump),
throughput increases by a factor 7.

On mostly non-ASCII input, performance increases slightly or is the
same.

The UTF-8 validation is rewritten to use indexed access; since all
access is preceded by a (mandatory for validation) length check, they
are statically elided by llvm and this formulation is in fact the best
for performance. A previous version had losses due to slice to iterator
conversions.

A large credit to Björn Steinbrink who improved this patch immensely,
writing this second version.

Benchmark results on x86-64 (Sandy Bridge) compiled with -C opt-level=3.

Old code is `regular`, this PR is called `fast`.

Datasets:

- `ascii` is just ascii (2.5 kB)
- `cyr` is cyrillic script with ascii spaces (5 kB)
- `dewik10` is 10MB of a de.wikipedia xml dump
- `enwik10` is 100MB of an en.wikipedia xml dump
- `jawik10` is 10MB of a ja.wikipedia xml dump

```
test from_utf8_ascii_fast        ... bench:         140 ns/iter (+/- 4) = 18221 MB/s
test from_utf8_ascii_regular     ... bench:       1,932 ns/iter (+/- 19) = 1320 MB/s
test from_utf8_cyr_fast          ... bench:      10,025 ns/iter (+/- 245) = 511 MB/s
test from_utf8_cyr_regular       ... bench:      12,250 ns/iter (+/- 437) = 418 MB/s
test from_utf8_dewik10_fast      ... bench:   6,017,909 ns/iter (+/- 105,755) = 1740 MB/s
test from_utf8_dewik10_regular   ... bench:  11,669,493 ns/iter (+/- 264,045) = 891 MB/s
test from_utf8_enwik8_fast       ... bench:  14,085,692 ns/iter (+/- 1,643,316) = 7000 MB/s
test from_utf8_enwik8_regular    ... bench:  93,657,410 ns/iter (+/- 5,353,353) = 1000 MB/s
test from_utf8_jawik10_fast      ... bench:  29,154,073 ns/iter (+/- 4,659,534) = 340 MB/s
test from_utf8_jawik10_regular   ... bench:  29,112,917 ns/iter (+/- 2,475,123) = 340 MB/s
```

Co-authored-by: Björn Steinbrink <bsteinbr@gmail.com>
2016-01-12 21:57:04 +01:00
Tamir Duberstein
5657eefcd8 android has posix_memalign for API 16+ since NDK r10d
See: http://developer.android.com/ndk/downloads/revision_history.html

Also, use `libc`'s `posix_memalign`.
2016-01-12 15:04:59 -05:00
Simonas Kazlauskas
20618d0e42 [MIR] Avoid some code generation for stores of ZST
Fixes #30831
2016-01-12 21:35:10 +02:00
Steve Klabnik
b6cc0995b0 Add some examples to std::string
Fixes #30345
2016-01-12 14:12:31 -05:00
Tshepang Lekhonkhobe
aa3b4c668e re-instate comment that was mysteriously disappeared 2016-01-12 21:00:09 +02:00
Niko Matsakis
7098cfda2e Fix test cases accordingly 2016-01-12 13:49:43 -05:00
Niko Matsakis
259379426c Revamp the "future incompatible" section to clarify the situation
better
2016-01-12 12:53:55 -05:00
Andrea Canciani
fb82398b2a Remove dead InternalBufWriter implementation
In 8d90d3f368 `BufStream`, the only
consumer of `InternalBufWriter`, was removed. As implied by the name,
this type is private, hence it is currently dead code.
2016-01-12 18:10:43 +01:00
Jonas Schievink
e3abc3cfe7 Don't use dropflag hints when the type is dropless 2016-01-12 18:04:21 +01:00
Simon Sapin
8e2b4b2911 Update wording of Instant and SystemTime docs
… per aturon’s proposal.
2016-01-12 17:52:29 +01:00
bors
cf8b1ce250 Auto merge of #30719 - pyfisch:fix30657, r=alexcrichton 2016-01-12 16:30:20 +00:00
Felix S. Klock II
cec7280bf3 debug instrumentation (can remove) 2016-01-12 15:24:52 +01:00
Felix S. Klock II
965b0bfefe Issue 30530: initialize allocas for Datum::to_lvalue_datum_in_scope.
In particular, bring back the `zero` flag for `lvalue_scratch_datum`,
which controls whether the alloca's created immediately at function
start are uninitialized at that point or have their embedded
drop-flags initialized to "dropped".

Then made `to_lvalue_datum_in_scope` pass "dropped" as `zero` flag.
2016-01-12 15:24:52 +01:00
Pierre Krieger
59df1d80f2 Fix the Debug impl of PhantomData requiring Sized on T 2016-01-12 11:23:18 +01:00
bors
7cffc9b195 Auto merge of #30695 - ranma42:cleanup-unicode, r=alexcrichton
and the associated update of tables.rs

The last commit is related to my comment to #29734.
2016-01-12 10:18:53 +00:00
bors
3246eaec90 Auto merge of #30678 - Amanieu:no_elf_tls, r=alexcrichton
I also re-enabled the use of `#[thread_local]` on AArch64. It was originally disabled in the PR that introduced AArch64 (#19790), but the reasons for this were not explained. `#[thread_local]` seems to work fine in my tests on AArch64, so I don't think this should be an issue.

cc @alexcrichton @akiss77
2016-01-12 08:30:56 +00:00
Sébastien Marie
667ee8a57b openbsd has dirent d_namlen field now 2016-01-12 08:43:53 +01:00
Sébastien Marie
a545eac593 make siginfo_si_addr() returns a usize
`siginfo_si_addr()` function is used once, and the returned value is
casted to `usize`. So make the function returns a `usize`.

it simplifies OpenBSD case, where the return type wouldn't be a `*mut
libc::c_void` but a `*mut libc::c_char`.
2016-01-12 08:43:52 +01:00
Sébastien Marie
468959580a HW_AVAILCPU is unavailable under openbsd
define `num_cpus()` function for openbsd that use `HW_NCPU` for grabbing
the current number of cpus that could be used.
2016-01-12 08:43:52 +01:00
Sébastien Marie
cb3999cd83 switch from syscall(2) to getentropy(2)
use the `getentropy()` function instead of `syscall()` and
syscall-numbers.
2016-01-12 08:43:51 +01:00
Alex Crichton
7eb7699593 std: Move overflowing ops to inherent methods
This commit migrates all of the methods on `num::wrapping::OverflowingOps` onto
inherent methods of the integer types. This also fills out some missing gaps in
the saturating and checked departments such as:

* `saturating_mul`
* `checked_{neg,rem,shl,shr}`

This is done in preparation for stabilization,

cc #27755
2016-01-11 21:40:08 -08:00
bors
d6cb2791ce Auto merge of #30635 - nagisa:mir-rid-unit-temp, r=nikomatsakis
Get rid of that nasty unit_ty temporary variable created just because it might be handy to have one around, when in reality it isn’t really that useful at all.

r? @nikomatsakis

Fixes https://github.com/rust-lang/rust/issues/30637
2016-01-12 05:20:23 +00:00
Matt Kraai
5fb15d0237 Replace --show-span with -Z show-span 2016-01-11 20:44:24 -08:00
bors
dedaebd5a1 Auto merge of #30599 - brson:extra, r=alexcrichton
This mixes in additional information into the hash that is
passed to -C extra-filename. It can be used to further distinguish
the standard libraries if they must be installed next to each
other.

Closes #29559

Frankly, I'm not sure if this solves a real problem. It's meant to help with side-by-side and overlapping installations where there are two sets of libs in /usr, but there are other potential issues there as well, including that some of our artifacts don't use this extra-filename munging, and it's not something our installers can support at all.

cc @jauhien Do you still think this helps the Gentoo case?
2016-01-12 03:00:00 +00:00
Amanieu d'Antras
757f57bb1e Add set_oom_handler and use it print a message when out of memory 2016-01-12 01:55:45 +00:00
bors
4405944b94 Auto merge of #30826 - nagisa:rollup, r=nagisa
- Successful merges: #30538, #30687, #30694, #30737, #30761, #30768, #30774, #30798, #30808, #30812, #30814
- Failed merges:
2016-01-11 20:59:15 +00:00
Shmuale Mark
30779d455d rustdoc: remove dead link from issue-less unstable entries. 2016-01-11 14:38:40 -05:00
Steve Klabnik
eb2343f25b Be a bit more correct about segfault causality
Fixes #30819
2016-01-11 14:19:51 -05:00
Simonas Kazlauskas
8dd7eabad7 Rollup merge of #30814 - brson:docidx, r=steveklabnik
These are the same descriptions as on the website.

re https://www.reddit.com/r/rust/comments/409nlo/i_just_noticed_the_docs_nightly_all_docs_got_more/cytc4ab

r? @steveklabnik
2016-01-11 21:17:54 +02:00
Simonas Kazlauskas
0b8370c397 Rollup merge of #30812 - D101101:patch-2, r=steveklabnik
r? @steveklabnik
2016-01-11 21:17:53 +02:00
Simonas Kazlauskas
b3749b7ceb Rollup merge of #30808 - GuillaumeGomez:remove_lang_iter, r=alexcrichton
Fixes #30803

r? @nagisa
2016-01-11 21:17:53 +02:00
Simonas Kazlauskas
584e145e43 Rollup merge of #30798 - erickt:fix-doc, r=apasel422 2016-01-11 21:17:53 +02:00
Simonas Kazlauskas
6aaa6068c5 Rollup merge of #30774 - nagisa:mir-fix-constval-adts, r=arielb1
Fixes #30772

We used to have a untested special case which didn’t really work anyway, because of lacking casts. This PR removes the case in question.
2016-01-11 21:17:53 +02:00
Simonas Kazlauskas
19820c4488 Rollup merge of #30768 - steveklabnik:gh28953, r=alexcrichton
Fixes #28953
2016-01-11 21:17:53 +02:00
Simonas Kazlauskas
04906061d8 Rollup merge of #30761 - nagisa:mir-fix-destination, r=michaelwoerister
Previously it was returning a clone, mostly for the two reasons:

* Cloning Lvalue is very cheap most of the time (i.e. when Lvalue is not a Projection);
* There’s users who want &mut lvalue and there’s users who want &lvalue. Returning a value allows
  to make either one easier when pattern matching (i.e. Some(ref dest) or Some(ref mut dest)).

However, I’m now convinced this is an invalid approach. Namely the users which want a mutable
reference may modify the Lvalue in-place, but the changes won’t be reflected in the final MIR,
since the Lvalue modified is merely a clone.

Instead, we have two accessors `destination` and `destination_mut` which return a reference to the
destination in desired mode.

r? @nikomatsakis
2016-01-11 21:17:52 +02:00
Simonas Kazlauskas
caf6095fcf Rollup merge of #30737 - Ms2ger:MutateMode, r=sanxiyn 2016-01-11 21:17:52 +02:00
Simonas Kazlauskas
6d6e831c33 Rollup merge of #30694 - pnkfelix:issue-25658-real-first-follow, r=nrc
Proper first and follow sets for macro_rules future proofing

implements first stage of RFC amendment 1384; see #30450
2016-01-11 21:17:52 +02:00
Simonas Kazlauskas
6cc2e37135 Rollup merge of #30687 - mmcco:lbt, r=eddyb
These should probably be submitted upstream. They're inevitably going to
complicate merges, and because they're non-functional changes this just
isn't worth our time.
2016-01-11 21:17:52 +02:00
Simonas Kazlauskas
dd6aa056fc Rollup merge of #30538 - oli-obk:kill_unsigned_unary_negation, r=pnkfelix
fixes  #29645
2016-01-11 21:17:52 +02:00