This improves the spectralnorm shootout benchmark through a few vectors after
looking at the leading C implementation:
* The simd-based f64x2 is now used to parallelize a few computations
* RWLock usage has been removed. A custom `parallel` function was added as a
form of stack-based fork-join parallelism. I found that the contention on the
locks was high as well as hindering other optimizations.
This does, however, introduce one `unsafe` block into the benchmarks, which
previously had none.
In terms of timings, the before and after numbers are:
```
$ time ./shootout-spectralnorm-before
./shootout-spectralnorm-before 2.07s user 0.71s system 324% cpu 0.857 total
$ time ./shootout-spectralnorm-before 5500
./shootout-spectralnorm-before 5500 11.88s user 1.13s system 459% cpu 2.830 total
$ time ./shootout-spectralnorm-after
./shootout-spectralnorm-after 0.58s user 0.01s system 280% cpu 0.210 tota
$ time ./shootout-spectralnorm-after 5500
./shootout-spectralnorm-after 5500 3.55s user 0.01s system 455% cpu 0.783 total
```
AsciiStr::to_lower is now AsciiStr::to_lowercase and AsciiStr::to_upper is AsciiStr::to_uppercase to match Ascii trait.
Part of issue #17790.
This is my first pull request so let me know if anything is incorrect.
Thanks!
[breaking-changes]
Out goes reflection! This means your code will break if you used the `:?` format specifier, anything else from libdebug, or the `visit_tydesc` intrinsic directly.
Closes#18046.
[breaking-change]
Adds an `assume` intrinsic that gets translated to llvm.assume. It is
used on a boolean expression and allows the optimizer to assume that
the expression is true.
This implements #18051.
librustc: Improve method autoderef/deref/index behavior more, and enable IndexMut on mutable vectors.
This fixes a bug whereby the mutability fixups for method behavior were
not kicking in after autoderef failed to happen at any level. It also
adds support for `Index` to the fixer-upper.
Closes#12825.
r? @pnkfelix
LLVM generates wrong code (which may be an instance of compile-time UB) when
faced with types that take lots of memory - bigger than the address space.
Make using such types a trans error. While trans errors are bad, overbig
types are expected to be very rare.
Use the integer sizes LLVM uses, rather than having random projections
laying around. Sizes are u64, Alignments are u32, C_*int is target-dependent
but 64-bit is fine (the int -> C_int conversion is non-precision-losing,
but it can be preceded by `as int` conversions which are, so it is
somewhat ugly. However, being able to suffix a `u` to properly infer
integer types is nice).
The array is the fundamental concept; vectors are growable arrays, and
slices are views into either. Show common array ops up front: length
and iteration. Mention arrays are immutable by default. Highlight
definite initialization and bounds-checking as safety features. Show
that you only need a type suffix on one element of initializers.
Explain that vectors are a value-add library type over arrays, not a
fundamental type; show they have the same "interface." Motivate slices
as efficient views into arrays; explain you can slice vectors, Strings,
&str because they're backed by arrays. Show off new, easy-to-read
[a..b] slice syntax.
Previously it had some uninituitive conditionals due to the interaction
with the Rand construction and Clone reinitialisation to create
sequential identifying numbers. This replaces all that with just
constructing the DropCounters with the appropriate identifiers.