diff --git a/src/rt/intrinsics/intrinsics.cpp b/src/rt/intrinsics/intrinsics.cpp index 8806ee45031..504fa083248 100644 --- a/src/rt/intrinsics/intrinsics.cpp +++ b/src/rt/intrinsics/intrinsics.cpp @@ -80,68 +80,3 @@ rust_intrinsic_task_sleep(void **retptr, rust_task_sleep(time_in_us); } - -extern "C" void -rust_intrinsic_2_vec_len(size_t *retptr, - void *env, - type_desc *ty, - rust_vec **vp) -{ - *retptr = (*vp)->fill / ty->size; -} - -extern "C" void -rust_intrinsic_2_ptr_offset(void **retptr, - void *env, - type_desc *ty, - void *ptr, - uintptr_t count) -{ - *retptr = &((uint8_t *)ptr)[ty->size * count]; -} - -extern "C" void -rust_intrinsic_2_cast(void *retptr, - void *env, - type_desc *t1, - type_desc *t2, - void *src) -{ - if (t1->size != t2->size) { - upcall_fail("attempt to cast values of differing sizes", - __FILE__, __LINE__); - return; - } - - memmove(retptr, src, t1->size); -} - -extern "C" void -rust_intrinsic_2_addr_of(void **retptr, - void *env, - type_desc *ty, - void *valptr) { - *retptr = valptr; -} - -extern "C" void -rust_intrinsic_2_recv(void **retptr, - void *env, - type_desc *ty, - rust_port *port) { - port_recv((uintptr_t*)retptr, port); -} - -extern "C" void -rust_intrinsic_2_get_type_desc(void **retptr, - void *env, - type_desc* ty) { - *(type_desc**)retptr = ty; -} - -extern "C" void -rust_intrinsic_2_task_sleep(void **retptr, - void *env, - size_t time_in_us) { - rust_task_sleep(time_in_us); -} diff --git a/src/rt/intrinsics/intrinsics.i386.ll.in b/src/rt/intrinsics/intrinsics.i386.ll.in index acf42dd603e..b85b8e1e101 100644 --- a/src/rt/intrinsics/intrinsics.i386.ll.in +++ b/src/rt/intrinsics/intrinsics.i386.ll.in @@ -130,68 +130,6 @@ define void @rust_intrinsic_task_sleep(i8** nocapture %retptr, i8* nocapture %en declare void @rust_task_sleep(i32) -define void @rust_intrinsic_2_vec_len(i32* nocapture %retptr, i8* nocapture %env, %struct.type_desc* nocapture %ty, %struct.rust_vec** nocapture %vp) nounwind { - %1 = load %struct.rust_vec** %vp, align 4, !tbaa !0 - %2 = getelementptr inbounds %struct.rust_vec* %1, i32 0, i32 0 - %3 = load i32* %2, align 4, !tbaa !3 - %4 = getelementptr inbounds %struct.type_desc* %ty, i32 0, i32 1 - %5 = load i32* %4, align 4, !tbaa !3 - %6 = udiv i32 %3, %5 - store i32 %6, i32* %retptr, align 4, !tbaa !3 - ret void -} - -define void @rust_intrinsic_2_ptr_offset(i8** nocapture %retptr, i8* nocapture %env, %struct.type_desc* nocapture %ty, i8* %ptr, i32 %count) nounwind { - %1 = getelementptr inbounds %struct.type_desc* %ty, i32 0, i32 1 - %2 = load i32* %1, align 4, !tbaa !3 - %3 = mul i32 %2, %count - %4 = getelementptr inbounds i8* %ptr, i32 %3 - store i8* %4, i8** %retptr, align 4, !tbaa !0 - ret void -} - -define void @rust_intrinsic_2_cast(i8* nocapture %retptr, i8* nocapture %env, %struct.type_desc* nocapture %t1, %struct.type_desc* nocapture %t2, i8* nocapture %src) { - %1 = getelementptr inbounds %struct.type_desc* %t1, i32 0, i32 1 - %2 = load i32* %1, align 4, !tbaa !3 - %3 = getelementptr inbounds %struct.type_desc* %t2, i32 0, i32 1 - %4 = load i32* %3, align 4, !tbaa !3 - %5 = icmp eq i32 %2, %4 - br i1 %5, label %7, label %6 - -;