Update.
[oota-llvm.git] / lib / Target / X86 / README-MMX.txt
1 //===---------------------------------------------------------------------===//
2 // Random ideas for the X86 backend: MMX-specific stuff.
3 //===---------------------------------------------------------------------===//
4
5 //===---------------------------------------------------------------------===//
6
7 This:
8
9 #include <mmintrin.h>
10
11 __v2si qux(int A) {
12   return (__v2si){ 0, A };
13 }
14
15 is compiled into:
16
17 _qux:
18         subl $28, %esp
19         movl 32(%esp), %eax
20         movd %eax, %mm0
21         movq %mm0, (%esp)
22         movl (%esp), %eax
23         movl %eax, 20(%esp)
24         movq %mm0, 8(%esp)
25         movl 12(%esp), %eax
26         movl %eax, 16(%esp)
27         movq 16(%esp), %mm0
28         addl $28, %esp
29         ret
30
31 Yuck!
32
33 GCC gives us:
34
35 _qux:
36         subl    $12, %esp
37         movl    16(%esp), %eax
38         movl    20(%esp), %edx
39         movl    $0, (%eax)
40         movl    %edx, 4(%eax)
41         addl    $12, %esp
42         ret     $4