From f1bc9307d82b7ff55ea6fa0eebec2999e5bd8f8a Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 25 Oct 2011 13:13:55 -0700 Subject: get things checking on ia32 --- src/rt/arch/i386/_context.S | 56 +++++++++++++++---------------- src/rt/intrinsics/intrinsics.i386.ll.in | 23 ++++++++----- src/rt/intrinsics/intrinsics.x86_64.ll.in | 23 ++++++++----- src/rt/rust_log.cpp | 2 +- 4 files changed, 57 insertions(+), 47 deletions(-) (limited to 'src/rt') diff --git a/src/rt/arch/i386/_context.S b/src/rt/arch/i386/_context.S index faee99284a5..b892342ee31 100644 --- a/src/rt/arch/i386/_context.S +++ b/src/rt/arch/i386/_context.S @@ -20,19 +20,19 @@ The registers_t variable is in (%esp) swap_registers: // save the old context movl 4(%esp), %eax - //movl %eax, 0(%eax) - movl %ebx, 4(%eax) - //movl %ecx, 8(%eax) - //movl %edx, 12(%eax) - movl %ebp, 16(%eax) - movl %esi, 20(%eax) - movl %edi, 24(%eax) - //movl %cs, 32(%eax) - //movl %ds, 34(%eax) - //movl %ss, 36(%eax) - //movl %es, 38(%eax) - //movl %fs, 40(%eax) - //movl %gs, 42(%eax) + //movl %eax, 0(%eax) + movl %ebx, 4(%eax) + //movl %ecx, 8(%eax) + //movl %edx, 12(%eax) + movl %ebp, 16(%eax) + movl %esi, 20(%eax) + movl %edi, 24(%eax) + //movl %cs, 32(%eax) + //movl %ds, 34(%eax) + //movl %ss, 36(%eax) + //movl %es, 38(%eax) + //movl %fs, 40(%eax) + //movl %gs, 42(%eax) // save the flags pushf @@ -48,20 +48,20 @@ swap_registers: // restore the new context movl 4(%esp), %eax - movl 4(%eax), %ebx - // save ecx for later... - //movl 12(%eax), %edx - movl 16(%eax), %ebp - movl 20(%eax), %esi - movl 24(%eax), %edi - movl 28(%eax), %esp - // We can't actually change this... - //movl 32(%eax), %cs - //movl 34(%eax), %ds - //movl 36(%eax), %ss - //movl 38(%eax), %es - //movl 40(%eax), %fs - //movl 42(%eax), %gs + movl 4(%eax), %ebx + // save ecx for later... + //movl 12(%eax), %edx + movl 16(%eax), %ebp + movl 20(%eax), %esi + movl 24(%eax), %edi + movl 28(%eax), %esp + // We can't actually change this... + //movl 32(%eax), %cs + //movl 34(%eax), %ds + //movl 36(%eax), %ss + //movl 38(%eax), %es + //movl 40(%eax), %fs + //movl 42(%eax), %gs // restore the flags movl 44(%eax), %ecx @@ -70,7 +70,7 @@ swap_registers: // ok, now we can restore ecx //movl 8(%eax), %ecx - + // Return! jmp *48(%eax) diff --git a/src/rt/intrinsics/intrinsics.i386.ll.in b/src/rt/intrinsics/intrinsics.i386.ll.in index 93cc32fe995..971314dba56 100644 --- a/src/rt/intrinsics/intrinsics.i386.ll.in +++ b/src/rt/intrinsics/intrinsics.i386.ll.in @@ -53,7 +53,7 @@ target triple = "@CFG_TARGET_TRIPLE@" %struct.rust_vec = type { i32, i32, [0 x i8] } %"struct.std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::_Rb_tree_impl" = type { %struct.rust_cond, %"struct.std::_Rb_tree_node_base", i32 } %"struct.std::_Rb_tree_node_base" = type { i32, %"struct.std::_Rb_tree_node_base"*, %"struct.std::_Rb_tree_node_base"*, %"struct.std::_Rb_tree_node_base"* } -%struct.type_desc = type { %struct.type_desc**, i32, i32, void (i8*, %struct.rust_task*, i8*, %struct.type_desc**, i8*)*, void (i8*, %struct.rust_task*, i8*, %struct.type_desc**, i8*)*, void (i8*, %struct.rust_task*, i8*, %struct.type_desc**, i8*)*, i8*, void (i8*, %struct.rust_task*, i8*, %struct.type_desc**, i8*)*, void (i8*, %struct.rust_task*, i8*, %struct.type_desc**, i8*)*, i32, void (i8*, %struct.rust_task*, i8*, %struct.type_desc**, i8*, i8*, i8)*, i8*, %struct.rust_shape_tables*, i32, i32, %struct.UT_hash_handle, i32, [0 x %struct.type_desc*] } +%struct.type_desc = type { %struct.type_desc**, i32, i32, void (i8*, i8*, %struct.type_desc**, i8*)*, void (i8*, i8*, %struct.type_desc**, i8*)*, void (i8*, i8*, %struct.type_desc**, i8*)*, i8*, void (i8*, i8*, %struct.type_desc**, i8*)*, void (i8*, i8*, %struct.type_desc**, i8*)*, i32, void (i8*, i8*, %struct.type_desc**, i8*, i8*, i8)*, i8*, %struct.rust_shape_tables*, i32, i32, %struct.UT_hash_handle, i32, [0 x %struct.type_desc*] } @.str = private unnamed_addr constant [42 x i8] c"attempt to cast values of differing sizes\00" @.str1 = private unnamed_addr constant [33 x i8] c"src/rt/intrinsics/intrinsics.cpp\00" @@ -78,7 +78,7 @@ define void @rust_intrinsic_ptr_offset(%struct.rust_task* nocapture %task, i8** ret void } -define void @rust_intrinsic_cast(%struct.rust_task* %task, i8* nocapture %retptr, %struct.type_desc* nocapture %t1, %struct.type_desc* nocapture %t2, i8* nocapture %src) { +define void @rust_intrinsic_cast(%struct.rust_task* nocapture %task, i8* nocapture %retptr, %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 %3 = getelementptr inbounds %struct.type_desc* %t2, i32 0, i32 1 @@ -87,7 +87,7 @@ define void @rust_intrinsic_cast(%struct.rust_task* %task, i8* nocapture %retptr br i1 %5, label %7, label %6 ;