[llvm-commits] [PATCH] SPARC backend - Passing arguments

Chris Lattner clattner at apple.com
Tue Dec 28 17:39:35 PST 2010


On Dec 28, 2010, at 2:18 PM, Venkatraman Govindaraju wrote:

> Hello,
> 
>  This patch makes the SPARC backend to generate correct assembly for
> the code below. Before the changes, the seventh parameter (double
> %arg1) passed through stack using "std  %f0, [%sp+92]" (store-double)
> instruction. Since %sp+92 is not aligned to double word, the
> instruction causes a "Bus Error".
> 
> Please let me know whether it is okay to commit.

Looks good to me.  You seem to have a good handle on the SPARC backend, please feel free to commit without pre-review with nice testcases like this.  I'll review the patches after the fact.  Thanks Venkatraman!

-Chris

> 
> Thanks,
> Venkatraman
> 
> 
> ; ModuleID = 'arg7.c'
> target datalayout =
> "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-f128:64:64-n32"
> target triple = "sparc-sun-solaris2.11"
> 
> @d = global double 0x40934CEFDB09A672
> 
> define i32 @test1(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e, i32 %f,
> double %arg1) nounwind readnone noinline {
> entry:
>  ret i32 0
> }
> 
> define i32 @main() nounwind readonly {
> entry:
>  %0 = load double* @d, align 8
>  %1 = tail call i32 @test1(i32 1, i32 2, i32 3, i32 4, i32 5, i32 10,
> double %0) nounwind noinline
>  ret i32 %1
> }
> <sparc-arg6.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list