Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
2be0596
Use with_no_trimmed_paths
bjorn3 Oct 27, 2020
4445e46
Add test where diagnostic span points to just the inlined function's …
oli-obk Sep 19, 2020
c8a866e
Show the inline stack of MIR lints that only occur after inlining
oli-obk Sep 19, 2020
888ef24
Address review comment
Oct 27, 2020
4206f9f
Prefer numeric associated constants in example
bstrie Oct 27, 2020
9842954
Merge pull request #1096 from bstrie/patch-1
bjorn3 Oct 27, 2020
5103a25
Rustup to rustc 1.49.0-nightly (07e968b64 2020-10-27)
bjorn3 Oct 28, 2020
4cc6b4f
Fix many clippy warnings
bjorn3 Oct 28, 2020
114be42
Rustup to rustc 1.49.0-nightly (ffe52882e 2020-10-30)
bjorn3 Oct 31, 2020
c067be0
Implement -Zfunction-sections
bjorn3 Oct 31, 2020
34be539
Use Pointer::dangling for ZST's in trans_const_value
bjorn3 Oct 31, 2020
6b1902a
Update Cranelift
bjorn3 Oct 31, 2020
f4e8af2
Update Cranelift
bjorn3 Nov 1, 2020
8063c37
Merge pull request #1099 from bjorn3/fix_rustc_bootstrap
bjorn3 Nov 1, 2020
d27f2f0
Rename trans to codegen
mominul Nov 1, 2020
c1cad03
Merge pull request #1100 from mominul/trans->codegen
bjorn3 Nov 1, 2020
c674c2c
Hide anonymous allocations from linked artifact
bjorn3 Nov 1, 2020
8b9c213
Fix transmutes between vectors and integers
bjorn3 Nov 1, 2020
c93d25b
reverse binding order in matches ...
vn-ki Nov 1, 2020
324e63d
Ensure that sysroot build works with CARGO_TARGET_DIR set
bjorn3 Nov 1, 2020
cb36760
Split the actual tests out into scripts/tests.sh
bjorn3 Nov 1, 2020
1ea618a
Make it easier to use build_sysroot.sh
bjorn3 Nov 1, 2020
9410b58
Update build instructions
bjorn3 Nov 1, 2020
0e2337a
Deny #[deprecated] on trait impl blocks.
m-ou-se Oct 31, 2020
706bc33
Use the right span for errors about #[deprecated] attributes.
m-ou-se Nov 1, 2020
6f1992a
Turn 'useless #[deprecated]' error into a lint.
m-ou-se Nov 1, 2020
9fc991a
Add test for #[deprecated] attribute on trait impl block.
m-ou-se Nov 1, 2020
ace02c4
Corrected suggestion for generic parameters in `function_item_referen…
ayrtonm Nov 2, 2020
5dee38d
update some ui tests and update move ref drop semantics output
vn-ki Nov 2, 2020
9088807
update mir tests
vn-ki Nov 2, 2020
9c647d1
Improve deprecation attribute diagnostic messages.
m-ou-se Nov 2, 2020
6bdce7b
new fix method and update tests
vn-ki Nov 2, 2020
0c34f5a
Refactor the build system
bjorn3 Nov 2, 2020
8315730
Upload prebuilt cg_clif
bjorn3 Nov 2, 2020
520a61f
Merge pull request #1104 from bjorn3/build_system_refactor
bjorn3 Nov 2, 2020
646b00f
Revert unintentional change
bjorn3 Nov 2, 2020
54b1d10
Test bootstrapping of rustc using cg_clif
bjorn3 Nov 1, 2020
03f01bb
Merge pull request #1105 from bjorn3/test_rustc_bootstrapping
bjorn3 Nov 2, 2020
22383b3
Use reparsed `TokenStream` if we captured any inner attributes
Aaron1011 Nov 2, 2020
1aedcd3
Suggest library/std when running all stage 0 tests
jyn514 Nov 2, 2020
f422e81
preserve bindings order for Some
vn-ki Nov 3, 2020
f44f96d
add tests
vn-ki Nov 3, 2020
216c4ae
Merge commit '03f01bbe901d60b71cf2c5ec766aef5e532ab79d' into update_c…
bjorn3 Nov 3, 2020
c32de75
lldb_batchmode: show more error information
emilyalbini Nov 3, 2020
5827fba
review comments
vn-ki Nov 3, 2020
7046855
Rollup merge of #76931 - oli-obk:const_prop_inline_lint_madness, r=we…
Dylan-DPC Nov 3, 2020
da3091b
Rollup merge of #78624 - bjorn3:update_cg_clif-2020-11-01, r=jyn514
Dylan-DPC Nov 3, 2020
d159121
Rollup merge of #78626 - fusion-engineering-forks:deprecated-trait-im…
Dylan-DPC Nov 3, 2020
6a7753e
Rollup merge of #78638 - vn-ki:bindigs-after-at-issue-69971, r=oli-obk
Dylan-DPC Nov 3, 2020
c450d4a
Rollup merge of #78659 - ayrtonm:fn-ref-lint-fix, r=oli-obk
Dylan-DPC Nov 3, 2020
86ef8d6
Rollup merge of #78677 - Aaron1011:fix/capture-inner-attrs, r=petroch…
Dylan-DPC Nov 3, 2020
858ddf2
Rollup merge of #78687 - jyn514:bootstrap-help, r=Mark-Simulacrum
Dylan-DPC Nov 3, 2020
4919b7c
Rollup merge of #78699 - pietroalbini:lldb-error, r=jyn514
Dylan-DPC Nov 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix transmutes between vectors and integers
Fixes #1102
  • Loading branch information
bjorn3 committed Nov 1, 2020
commit 8b9c2135d06ee0255d24b18efba8ef9cf92fb67f
20 changes: 19 additions & 1 deletion src/value_and_place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ impl<'tcx> CPlace<'tcx> {

let stack_slot = fx.bcx.create_stack_slot(StackSlotData {
kind: StackSlotKind::ExplicitSlot,
size: layout.size.bytes() as u32,
size: u32::try_from(layout.size.bytes()).unwrap(),
offset: None,
});
CPlace {
Expand Down Expand Up @@ -530,6 +530,13 @@ impl<'tcx> CPlace<'tcx> {
dst_ty: Type,
) {
let src_ty = fx.bcx.func.dfg.value_type(data);
assert_eq!(
src_ty.bytes(),
dst_ty.bytes(),
"write_cvalue_transmute: {:?} -> {:?}",
src_ty,
dst_ty,
);
let data = match (src_ty, dst_ty) {
(_, _) if src_ty == dst_ty => data,

Expand All @@ -541,6 +548,17 @@ impl<'tcx> CPlace<'tcx> {
_ if src_ty.is_vector() && dst_ty.is_vector() => {
fx.bcx.ins().raw_bitcast(dst_ty, data)
}
_ if src_ty.is_vector() || dst_ty.is_vector() => {
// FIXME do something more efficient for transmutes between vectors and integers.
let stack_slot = fx.bcx.create_stack_slot(StackSlotData {
kind: StackSlotKind::ExplicitSlot,
size: src_ty.bytes(),
offset: None,
});
let ptr = Pointer::stack_slot(stack_slot);
ptr.store(fx, data, MemFlags::trusted());
ptr.load(fx, dst_ty, MemFlags::trusted())
}
_ => unreachable!("write_cvalue_transmute: {:?} -> {:?}", src_ty, dst_ty),
};
fx.bcx
Expand Down