Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 95511cb

Browse files
committed
Add unaligned_volatile_{load,store} intrinsics
1 parent 3f2589a commit 95511cb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/intrinsics/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,17 +823,19 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
823823
}
824824
};
825825

826-
volatile_load, (c ptr) {
826+
volatile_load | unaligned_volatile_load, (c ptr) {
827827
// Cranelift treats loads as volatile by default
828828
// FIXME ignore during stack2reg optimization
829+
// FIXME correctly handle unaligned_volatile_load
829830
let inner_layout =
830831
fx.layout_of(ptr.layout().ty.builtin_deref(true).unwrap().ty);
831832
let val = CValue::by_ref(Pointer::new(ptr.load_scalar(fx)), inner_layout);
832833
ret.write_cvalue(fx, val);
833834
};
834-
volatile_store, (v ptr, c val) {
835+
volatile_store | unaligned_volatile_store, (v ptr, c val) {
835836
// Cranelift treats stores as volatile by default
836837
// FIXME ignore during stack2reg optimization
838+
// FIXME correctly handle unaligned_volatile_store
837839
let dest = CPlace::for_ptr(Pointer::new(ptr), val.layout());
838840
dest.write_cvalue(fx, val);
839841
};

0 commit comments

Comments
 (0)