mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 01:28:18 +03:00
Don't use stack_{load,store} for vectors
This commit is contained in:
+11
-8
@@ -126,8 +126,8 @@ pub fn load<'a, 'tcx>(
|
||||
) -> Value {
|
||||
match self.base {
|
||||
PointerBase::Addr(base_addr) => fx.bcx.ins().load(ty, flags, base_addr, self.offset),
|
||||
PointerBase::Stack(stack_slot) => if ty == types::I128 {
|
||||
// WORKAROUND for stack_load.i128 not being implemented
|
||||
PointerBase::Stack(stack_slot) => if ty == types::I128 || ty.is_vector() {
|
||||
// WORKAROUND for stack_load.i128 and stack_load.iXxY not being implemented
|
||||
let base_addr = fx.bcx.ins().stack_addr(fx.pointer_type, stack_slot, 0);
|
||||
fx.bcx.ins().load(ty, flags, base_addr, self.offset)
|
||||
} else {
|
||||
@@ -146,12 +146,15 @@ pub fn store<'a, 'tcx>(
|
||||
PointerBase::Addr(base_addr) => {
|
||||
fx.bcx.ins().store(flags, value, base_addr, self.offset);
|
||||
}
|
||||
PointerBase::Stack(stack_slot) => if fx.bcx.func.dfg.value_type(value) == types::I128 {
|
||||
// WORKAROUND for stack_load.i128 not being implemented
|
||||
let base_addr = fx.bcx.ins().stack_addr(fx.pointer_type, stack_slot, 0);
|
||||
fx.bcx.ins().store(flags, value, base_addr, self.offset);
|
||||
} else {
|
||||
fx.bcx.ins().stack_store(value, stack_slot, self.offset);
|
||||
PointerBase::Stack(stack_slot) => {
|
||||
let val_ty = fx.bcx.func.dfg.value_type(value);
|
||||
if val_ty == types::I128 || val_ty.is_vector() {
|
||||
// WORKAROUND for stack_store.i128 and stack_store.iXxY not being implemented
|
||||
let base_addr = fx.bcx.ins().stack_addr(fx.pointer_type, stack_slot, 0);
|
||||
fx.bcx.ins().store(flags, value, base_addr, self.offset);
|
||||
} else {
|
||||
fx.bcx.ins().stack_store(value, stack_slot, self.offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user