Commit 0ce0c4a6 authored by Isaac Oscar Gariano's avatar Isaac Oscar Gariano

Fixed ALLOCA bug and prioritised caller saved FPRs

parent 5ee0ca24
......@@ -2756,12 +2756,14 @@ impl <'a> InstructionSelection {
// The stack pointer has to be 16 bytes aligned
let size = round_up(size, 16) as u64;
if size <= 64 {
// Note: this is the same threshold clang -O3 uses to decide whether to call memset
// Allocate 'size' bytes on the stack
emit_sub_u64(self.backend.as_mut(), &SP, &SP, size);
// Note: this is the same threshold clang -O3 uses to decide whether to call memset
// Just push pairs of the zero register to the stack
for i in 0..size/2 {
// TODO: Optimise for the case where we don't need to zero initilise a multiple of 16-bytes
for i in 0..size/16 {
// Push pairs of 0's on the stack
let dest = make_value_base_offset(&SP, (16*i) as i64, &UINT128_TYPE, vm);
let dest = emit_mem(self.backend.as_mut(), &dest, get_type_alignment(&UINT128_TYPE, vm), f_context, vm);
......
......@@ -703,15 +703,6 @@ lazy_static! {
//X29.clone(), // Frame Pointer
//X30.clone(), // Link Register
D8.clone(),
D9.clone(),
D10.clone(),
D11.clone(),
D12.clone(),
D13.clone(),
D14.clone(),
D15.clone(),
D0.clone(),
D1.clone(),
D2.clone(),
......@@ -736,7 +727,16 @@ lazy_static! {
D28.clone(),
D29.clone(),
D30.clone(),
D31.clone()
D31.clone(),
D8.clone(),
D9.clone(),
D10.clone(),
D11.clone(),
D12.clone(),
D13.clone(),
D14.clone(),
D15.clone(),
];
}
......@@ -1952,13 +1952,8 @@ pub fn emit_ireg_value(backend: &mut CodeGenerator, pv: &P<Value>, f_context: &m
&Constant::FuncRef(func_id) => {
let tmp = make_temporary(f_context, pv.ty.clone(), vm);
<<<<<<< HEAD
let mem = make_value_symbolic(vm.get_func_name(func_id), true, &ADDRESS_TYPE, vm);
emit_calculate_address(backend, &tmp, &mem, vm);
=======
let mem = make_value_symbolic(vm.get_name_for_func(func_id), true, &ADDRESS_TYPE, vm);
emit_calculate_address(backend, &tmp, &mem, f_context, vm);
>>>>>>> 5aad05d054e79db08724c0bcba77d78d71174f08
emit_calculate_address(backend, &tmp, &mem, vm);
tmp
},
&Constant::NullRef => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment