Fix load.i64 and store legalization
This commit is contained in:
@@ -588,9 +588,12 @@ fn narrow_load(
|
||||
_ => panic!("Expected load: {}", pos.func.dfg.display_inst(inst, None)),
|
||||
};
|
||||
|
||||
let al = pos.ins().load(ir::types::I64, flags, ptr, offset);
|
||||
let res_ty = pos.func.dfg.ctrl_typevar(inst);
|
||||
let small_ty = res_ty.half_width().expect("Can't narrow load");
|
||||
|
||||
let al = pos.ins().load(small_ty, flags, ptr, offset);
|
||||
let ah = pos.ins().load(
|
||||
ir::types::I64,
|
||||
small_ty,
|
||||
flags,
|
||||
ptr,
|
||||
offset.try_add_i64(8).expect("load offset overflow"),
|
||||
@@ -618,7 +621,7 @@ fn narrow_store(
|
||||
_ => panic!("Expected store: {}", pos.func.dfg.display_inst(inst, None)),
|
||||
};
|
||||
|
||||
let (al, ah) = pos.func.dfg.replace(inst).isplit(val);
|
||||
let (al, ah) = pos.ins().isplit(val);
|
||||
pos.ins().store(flags, al, ptr, offset);
|
||||
pos.ins().store(
|
||||
flags,
|
||||
@@ -626,4 +629,5 @@ fn narrow_store(
|
||||
ptr,
|
||||
offset.try_add_i64(8).expect("store offset overflow"),
|
||||
);
|
||||
pos.remove_inst();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user