interpret: simplify SIMD type handling#130215
Conversation
|
The Miri subtree was changed cc @rust-lang/miri Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri |
| self.ptr_with_meta_to_mplace(ptr, MemPlaceMeta::None, layout, /*unaligned*/ false) | ||
| } | ||
|
|
||
| pub fn ptr_to_mplace_unaligned( |
There was a problem hiding this comment.
@tiif this method should also come handy in rust-lang/miri#3852 to deal with the alignment problem in eventfd
| this.mem_copy(value.ptr(), ptr, value.layout.size, /*nonoverlapping*/ true)?; | ||
| // Deref the pointer *unaligned*, and do the copy. | ||
| let dest = this.ptr_to_mplace_unaligned(ptr, value.layout); | ||
| this.copy_op(&value, &dest)?; |
There was a problem hiding this comment.
I had to adjust the logic a bit here because operand_to_simd used to return an MPlace but project_to_simd preserves the original type.
32143a6 to
d1e93ca
Compare
|
r? @saethlin |
| ecx.machine.static_root_ids = Some((alloc_id, static_def_id)); | ||
| assert!(ecx.memory.alloc_map.insert(alloc_id, (MemoryKind::Stack, alloc)).is_none()); | ||
| Ok(ecx.ptr_with_meta_to_mplace(Pointer::from(alloc_id).into(), MemPlaceMeta::None, layout)) | ||
| Ok(ecx.ptr_to_mplace(Pointer::from(alloc_id).into(), layout)) |
There was a problem hiding this comment.
does this change have anything to do w the pr? it seems unrelated lol
There was a problem hiding this comment.
oh, i see you changed the privacy of that fn.
There was a problem hiding this comment.
Yeah, I had to add ptr_to_mplace_unaligned for this PR and so I had to make the lower-level ptr_with_meta_to_mplace more flexible and didn't want to expose this somewhat "dangerous" operation too far so I checked if I could make it private, and turns out yes I could.
compiler-errors
left a comment
There was a problem hiding this comment.
r=me unless you want specifically a review from saethlin
src/tools/miri/src/shims/x86/mod.rs
Outdated
| let value = this.project_index(&value, i)?; | ||
|
|
||
| if this.read_scalar(&mask)?.to_uint(mask_item_size)? >> high_bit_offset != 0 { | ||
| // *Bon-inbounds* pointer arithmetic to compute the destination. |
d1e93ca to
d4a9657
Compare
d4a9657 to
e2bc16c
Compare
|
I had to rebase as there was a conflict (a semantic conflict -- things merged fine but then they would fail to build). Seems fine to take this off saethlin's plate. |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (0307e40): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResults (secondary 15.0%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 757.647s -> 756.444s (-0.16%) |
This is possible as a follow-up to #129403