Commit Graph

6220 Commits

Author SHA1 Message Date
bors
8e818ffa1b Auto merge of #2029 - RalfJung:simd-bitmask, r=RalfJung
implement simd bitmask intrinsics

Cc https://github.com/rust-lang/miri/issues/1912
2022-03-17 17:18:01 +00:00
Ralf Jung
1b1321a685 fix simd_bitmask shorter than a byte on big-endian 2022-03-17 13:14:16 -04:00
Ralf Jung
b5d3a25b49 detect when unused bits of a SIMD bitmask are non-0 2022-03-17 13:08:01 -04:00
Ralf Jung
bfed3c4f0d implement simd bitmask intrinsics 2022-03-17 13:08:01 -04:00
bors
670dc7d551 Auto merge of #1971 - saethlin:sb-details, r=RalfJung
Add a lot more information to SB fatal errors

In fatal errors, this clarifies the difference between a tag not being present in the borrow stack at all, and the tag being present but granting SRO. It also introduces a little notation for memory ranges so we can mention to the user that the span may point to code that operates on multiple memory locations, but we are reporting an error at a particular offset.

This also gets rid of the unqualified phrase "the borrow stack" in errors, and clarifies that it is the borrow stack _for some location_.

The crate `pdqselect` v0.1.1:
Before:
```
2103 |     unsafe { copy_nonoverlapping(src, dst, count) }
     |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item granting read access to tag <2357> at alloc1029 found in borrow stack.
```
After:
```
2103 |     unsafe { copy_nonoverlapping(src, dst, count) }
     |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |              |
     |              attempting a read access using <2357> at alloc1029[0x0], but that tag does not exist in the borrow stack for this location
     |              this error occurs as part of an access at alloc1029[0x0..0x4]
```

And the crate `half` v1.8.2
Before:
```
131 |     unsafe { &mut *ptr::slice_from_raw_parts_mut(data, len) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to reborrow for Unique at alloc1051, but parent tag <2091> does not have an appropriate item in the borrow stack
```
After:
```
131 |     unsafe { &mut *ptr::slice_from_raw_parts_mut(data, len) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |              |
    |              trying to reborrow <2091> for Unique permission at alloc1051[0x0], but that tag only grants SharedReadOnly permission for this location
    |              this error occurs as part of a reborrow at alloc1051[0x0..0x6]
```
2022-03-17 13:26:29 +00:00
bors
a33f1a682d Auto merge of #2031 - RalfJung:simd, r=RalfJung
implement SIMD sqrt and fma

Cc https://github.com/rust-lang/miri/issues/1912
2022-03-17 02:15:16 +00:00
Ralf Jung
4fd5dca27c implement SIMD sqrt and fma 2022-03-16 22:13:43 -04:00
Ben Kimock
730cd27248 Print more in SB error diagnostics
This tries to clarify exactly why an access is not valid by printing
what memory range the access was over, which in combination with
tag-tracking may help a user figure out the source of the problem.
2022-03-16 20:12:04 -04:00
bors
a9a0d0e5e7 Auto merge of #2028 - RalfJung:simd-round, r=RalfJung
implement SIMD float rounding functions

Cc https://github.com/rust-lang/miri/issues/1912
2022-03-16 23:30:19 +00:00
Ralf Jung
1f237b3b7d implement SIMD float rounding functions 2022-03-16 18:53:36 -04:00
Ralf Jung
202964127b implement fabs using soft floats 2022-03-16 18:33:59 -04:00
bors
39c72db3d3 Auto merge of #2026 - jakevossen5:master, r=RalfJung
missing backtick on miri-isolation warning help

Just ran into this and figured I could fix it real quick 🙂
2022-03-16 17:10:44 +00:00
Jake Vossen
559e495195 missing backtick on miri-isolation warning help 2022-03-16 10:18:51 -06:00
bors
dce1a1b94f Auto merge of #2023 - RalfJung:simd-min-max, r=RalfJung
test integer SIMD min/max

Blocked on portable-simd getting updated in rustc.
2022-03-14 13:54:19 +00:00
Ralf Jung
f338b0229b test integer SIMD min/max 2022-03-14 09:53:49 -04:00
bors
7bc0c98621 Auto merge of #2025 - workingjubilee:fix-nightly-simd, r=RalfJung
Fixup renamed fn for Simd

This fixes rust-lang/rust#94910
2022-03-14 02:07:23 +00:00
Jubilee Young
61bfa8afe8 Fixup renamed fn for Simd 2022-03-13 19:03:08 -07:00
bors
a12a48bf72 Auto merge of #2018 - RalfJung:term, r=oli-obk
exclude TERM env var by default

Fixes https://github.com/rust-lang/miri/issues/1702

r? `@oli-obk`
2022-03-12 19:12:53 +00:00
bors
9029fa4aa9 Auto merge of #2021 - RalfJung:write-fields-refactor, r=RalfJung
add write_int_fields to replace write_packed_immediates

This avoids having to explicitly list the types of all fields -- we derive them from the type of the struct instead.

Also add write_int_fields_named, to give the fields by name instead of ordered by index.
2022-03-12 17:18:24 +00:00
Ralf Jung
47f8218d0d add write_int_fields to replace write_packed_immediates
for stat, lookup fields by name
2022-03-12 12:17:23 -05:00
Ralf Jung
4bd6bc9098 use dirent64_layout and field projections for writing dirent info 2022-03-12 12:03:33 -05:00
bors
9e4165072b Auto merge of #2019 - RalfJung:align, r=RalfJung
add README section on randomized alignment testing

also accept odd number of hex digits

`@saethlin` you mentioned that you liked this snippet, do you think it'd make sense to put it in the README?
2022-03-12 16:52:55 +00:00
bors
f7f34f270a Auto merge of #2017 - RalfJung:rustup, r=RalfJung
rustup

Cc https://github.com/rust-lang/rust/issues/94871
2022-03-12 15:14:25 +00:00
Ralf Jung
3c5cb89f63 exclude TERM by default 2022-03-12 10:14:07 -05:00
Ralf Jung
9a6450af95 also accept odd number of hex digits; add README section on randomized alignment testing 2022-03-12 10:09:15 -05:00
Ralf Jung
27d5b846ee rustup 2022-03-12 09:46:10 -05:00
bors
c58298ce22 Auto merge of #2014 - RalfJung:ptr-offset-from, r=RalfJung
add ptr_offset_from OOB test, and update test errors

The Miri side of https://github.com/rust-lang/rust/pull/94827.
2022-03-12 03:12:37 +00:00
Ralf Jung
21ff2f9fca rustup 2022-03-11 22:07:43 -05:00
Ralf Jung
bae720c75b add ptr_offset_from OOB test, and update test errors 2022-03-10 18:56:19 -05:00
bors
a35877b5f1 Auto merge of #2013 - RalfJung:simd, r=RalfJung
implement simd_{shuffle,gather,scatter}

This makes portable-simd doctests pass. :)

Cc https://github.com/rust-lang/miri/issues/1912
2022-03-10 00:30:07 +00:00
Ralf Jung
41ffce1145 implement simd_scatter 2022-03-09 19:29:05 -05:00
Ralf Jung
576e2bbed5 implement gather 2022-03-09 19:29:05 -05:00
Ralf Jung
3eba7fcf73 implement simd_shuffle 2022-03-09 19:29:05 -05:00
bors
5aeff5d9ef Auto merge of #2006 - RalfJung:readme-ci, r=RalfJung
update recommended CI snippet, add GHA example

If this snippet works as expected in https://github.com/rust-lang/portable-simd/pull/255 (which we can test tomorrow), then this adjusts our README to that nicer script.
2022-03-08 12:54:18 +00:00
bors
722475ccc1 Auto merge of #2009 - RalfJung:rustup, r=RalfJung
rustup
2022-03-08 01:08:11 +00:00
Ralf Jung
d54c5fb668 rustup 2022-03-07 20:07:44 -05:00
bors
acb58ffaaf Auto merge of #2008 - RalfJung:notempty, r=RalfJung
fs: add and test for DirectoryNotEmpty error variant
2022-03-07 23:31:10 +00:00
Ralf Jung
6d3506adef fs: add and test for DirectoryNotEmpty error variant 2022-03-07 18:30:12 -05:00
bors
fc15f96651 Auto merge of #1981 - tavianator:readdir, r=RalfJung
Implement a readdir64() shim for Linux

Partial fix for #1966.
2022-03-07 22:53:54 +00:00
Tavian Barnes
0886419524 Implement a readdir64() shim for Linux
Partial fix for #1966.
2022-03-07 16:19:03 -05:00
Tavian Barnes
0088715411 Rename MiriMemoryKind::Env to Runtime
In preparation to use it for other runtime-internal allocations.
2022-03-07 16:19:03 -05:00
bors
ccaf7206e1 Auto merge of #2007 - RalfJung:simd_saturating, r=RalfJung
implement simd_saturating intrinsics
2022-03-07 19:13:41 +00:00
Ralf Jung
735bee2736 implement simd_saturating intrinsics 2022-03-07 14:12:59 -05:00
Ralf Jung
c03575275a update recommended CI snippet, add GHA example 2022-03-07 12:03:51 -05:00
bors
64b086a8e2 Auto merge of #2004 - RalfJung:simd, r=RalfJung
implement more SIMD intrinsics

Requires https://github.com/rust-lang/rust/pull/94681

With this, the cast, i32_ops, and f32_ops test suites of portable-simd pass. :)

Cc https://github.com/rust-lang/miri/issues/1912
2022-03-07 14:58:30 +00:00
Ralf Jung
b87a9c90e1 fix handling of NaNs in simd max/min 2022-03-07 09:49:35 -05:00
Ralf Jung
2f97eb68a0 implement simd_fmax/fmin 2022-03-07 09:40:23 -05:00
Ralf Jung
9851b743c1 implement simd_reduce_min/max 2022-03-07 09:40:23 -05:00
Ralf Jung
db06d4998f implement simd_cast, simd_as 2022-03-07 09:40:23 -05:00
bors
dd42a47f0a Auto merge of #2005 - RalfJung:rustup, r=RalfJung
rustup
2022-03-07 14:40:07 +00:00