[artiq] WIP

This commit is contained in:
David Mak 2024-08-15 13:44:31 +08:00
parent c00f6939e9
commit fa88c255f8
1 changed files with 8 additions and 24 deletions

View File

@ -647,36 +647,21 @@ fn format_rpc_ret<'ctx>(
.unwrap()) .unwrap())
}, },
|generator, ctx| { |generator, ctx| {
// let data_addr = ctx let phi = phi.as_basic_value().into_pointer_value();
// .builder let pbuffer_data_begin =
// .build_load( unsafe { ctx.builder.build_in_bounds_gep(phi, &[llvm_usize.const_zero()], "") }
// ctx.builder .unwrap();
// .build_bitcast(data_addr, llvm_ppi8, "")
// .map(BasicValueEnum::into_pointer_value)
// .unwrap(),
// "",
// )
// .map(BasicValueEnum::into_pointer_value)
// .unwrap();
//
// call_memcpy_generic(
// ctx,
// ndarray.ptr_to_data(ctx),
// data_addr,
// llvm_pdata_sizeof,
// llvm_i1.const_zero(),
// );
call_memcpy_generic( call_memcpy_generic(
ctx, ctx,
ndarray.ptr_to_data(ctx), ndarray.ptr_to_data(ctx),
buffer.base_ptr(ctx, generator), phi,
llvm_pdata_sizeof, llvm_pdata_sizeof,
llvm_i1.const_zero(), llvm_i1.const_zero(),
); );
let pbuffer_dims_begin = unsafe { let pbuffer_dims_begin =
buffer.ptr_offset_unchecked(ctx, generator, &llvm_pdata_sizeof, None) unsafe { ctx.builder.build_in_bounds_gep(phi, &[llvm_pdata_sizeof], "") }
}; .unwrap();
call_memcpy_generic( call_memcpy_generic(
ctx, ctx,
ndarray.dim_sizes().base_ptr(ctx, generator), ndarray.dim_sizes().base_ptr(ctx, generator),
@ -760,7 +745,6 @@ fn format_rpc_ret<'ctx>(
ctx.builder.build_unconditional_branch(head_bb).unwrap(); ctx.builder.build_unconditional_branch(head_bb).unwrap();
ctx.builder.position_at_end(tail_bb); ctx.builder.position_at_end(tail_bb);
ctx.builder.build_load(slot, "rpc.result").unwrap() ctx.builder.build_load(slot, "rpc.result").unwrap()
} }
}; };