1 ; RUN: llc < %s -mtriple=i686-pc-elfiamcu | FileCheck %s
3 %struct.st12_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
5 ; CHECK-LABEL: test_ints:
6 ; CHECK: addl %edx, %eax
7 ; CHECK-NEXT: imull %ecx, %eax
8 ; CHECK-NEXT: addl 4(%esp), %eax
10 define i32 @test_ints(i32 %a, i32 %b, i32 %c, i32 %d) #0 {
18 ; CHECK-LABEL: test_floats:
19 ; CHECK: addl %edx, %eax
20 ; CHECK-NEXT: imull %ecx, %eax
21 ; CHECK-NEXT: addl 4(%esp), %eax
23 define i32 @test_floats(i32 %a, i32 %b, float %c, float %d) #0 {
25 %ci = bitcast float %c to i32
26 %di = bitcast float %d to i32
28 %r2 = mul i32 %ci, %r1
29 %r3 = add i32 %di, %r2
33 ; CHECK-LABEL: test_doubles:
34 ; CHECK: addl 4(%esp), %eax
35 ; CHECK-NEXT: adcl 8(%esp), %edx
37 define double @test_doubles(double %d1, double %d2) #0 {
39 %d1i = bitcast double %d1 to i64
40 %d2i = bitcast double %d2 to i64
41 %r = add i64 %d1i, %d2i
42 %rd = bitcast i64 %r to double
46 ; CHECK-LABEL: test_mixed_doubles:
47 ; CHECK: addl %ecx, %eax
48 ; CHECK-NEXT: adcl $0, %edx
50 define double @test_mixed_doubles(double %d2, i32 %i) #0 {
52 %iext = zext i32 %i to i64
53 %d2i = bitcast double %d2 to i64
54 %r = add i64 %iext, %d2i
55 %rd = bitcast i64 %r to double
59 ; CHECK-LABEL: ret_large_struct:
61 ; CHECK-NEXT: movl %eax, %esi
62 ; CHECK-NEXT: leal 8(%esp), %edx
63 ; CHECK-NEXT: movl $48, %ecx
64 ; CHECK-NEXT: calll memcpy
65 ; CHECK-NEXT: movl %esi, %eax
66 ; CHECK-NEXT: popl %esi
69 define void @ret_large_struct(%struct.st12_t* noalias nocapture sret %agg.result, %struct.st12_t* byval nocapture readonly align 4 %r) #0 {
71 %0 = bitcast %struct.st12_t* %agg.result to i8*
72 %1 = bitcast %struct.st12_t* %r to i8*
73 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %0, i8* %1, i32 48, i32 1, i1 false)
77 ; CHECK-LABEL: var_args:
78 ; CHECK: movl 4(%esp), %eax
80 define i32 @var_args(i32 %i1, ...) #0 {
85 ; CHECK-LABEL: test_lib_args:
86 ; CHECK: movl %edx, %eax
87 ; CHECK: calll __fixsfsi
88 define i32 @test_lib_args(float %a, float %b) #0 {
89 %ret = fptosi float %b to i32
93 ; CHECK-LABEL: test_fp128:
94 ; CHECK: movl (%eax), %e[[CX:..]]
95 ; CHECK-NEXT: movl 4(%eax), %e[[DX:..]]
96 ; CHECK-NEXT: movl 8(%eax), %e[[SI:..]]
97 ; CHECK-NEXT: movl 12(%eax), %e[[AX:..]]
98 ; CHECK-NEXT: movl %e[[AX]], 12(%esp)
99 ; CHECK-NEXT: movl %e[[SI]], 8(%esp)
100 ; CHECK-NEXT: movl %e[[DX]], 4(%esp)
101 ; CHECK-NEXT: movl %e[[CX]], (%esp)
102 ; CHECK-NEXT: calll __fixtfsi
103 define i32 @test_fp128(fp128* %ptr) #0 {
104 %v = load fp128, fp128* %ptr
105 %ret = fptosi fp128 %v to i32
109 declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i32, i1) #1
111 attributes #0 = { nounwind "use-soft-float"="true"}
112 attributes #1 = { nounwind argmemonly }