Support added for shifts and unpacking MMX instructions.
[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 We should compile 
8
9 #include <mmintrin.h>
10
11 extern __m64 C;
12
13 void baz(__v2si *A, __v2si *B)
14 {
15   *A = __builtin_ia32_psllq(*B, C);
16   _mm_empty();
17 }
18
19 to:
20
21 .globl _baz
22 _baz:
23         call    L3
24 "L00000000001$pb":
25 L3:
26         popl    %ecx
27         subl    $12, %esp
28         movl    20(%esp), %eax
29         movq    (%eax), %mm0
30         movl    L_C$non_lazy_ptr-"L00000000001$pb"(%ecx), %eax
31         movq    (%eax), %mm1
32         movl    16(%esp), %eax
33         psllq   %mm1, %mm0
34         movq    %mm0, (%eax)
35         emms
36         addl    $12, %esp
37         ret
38
39 not:
40
41 _baz:
42         subl $12, %esp
43         call "L1$pb"
44 "L1$pb":
45         popl %eax
46         movl L_C$non_lazy_ptr-"L1$pb"(%eax), %eax
47         movl (%eax), %ecx
48         movl %ecx, (%esp)
49         movl 4(%eax), %eax
50         movl %eax, 4(%esp)
51         movl 20(%esp), %eax
52         movq (%eax), %mm0
53         movq (%esp), %mm1
54         psllq %mm1, %mm0
55         movl 16(%esp), %eax
56         movq %mm0, (%eax)
57         emms
58         addl $12, %esp
59         ret