add note
[oota-llvm.git] / lib / Target / ARM / README.txt
1 //===---------------------------------------------------------------------===//
2 // Random ideas for the ARM backend.
3 //===---------------------------------------------------------------------===//
4
5 Consider implementing a select with two conditional moves:
6
7 cmp x, y
8 moveq dst, a
9 movne dst, b
10
11 ----------------------------------------------------------
12
13
14 %tmp1 = shl int %b, ubyte %c
15 %tmp4 = add int %a, %tmp1
16
17 compiles to
18
19 add r0, r0, r1, lsl r2
20
21 but
22
23 %tmp1 = shl int %b, ubyte %c
24 %tmp4 = add int %tmp1, %a
25
26 compiles to
27 mov r1, r1, lsl r2
28 add r0, r1, r0
29
30 ---------------------------------------------------------
31 %tmp1 = shl int %b, ubyte 4
32 %tmp2 = add int %a, %tmp1
33
34 compiles to
35
36 mov r2, #4
37 add r0, r0, r1, lsl r2
38
39 should be
40
41 add r0, r0, r1, lsl #4
42
43 ----------------------------------------------------------
44
45 add an offset to FLDS/FLDD/FSTD/FSTS addressing mode
46
47 ----------------------------------------------------------
48
49 the function
50
51 void %f() {
52 entry:
53         call void %g( int 1, int 2, int 3, int 4, int 5 )
54         ret void
55 }
56
57 declare void %g(int, int, int, int, int)
58
59 Only needs 8 bytes of stack space. We currently allocate 16.
60
61 ----------------------------------------------------------
62
63 32 x 32 -> 64 multiplications currently uses two instructions. We
64 should try to declare smull and umull as returning two values.
65
66 ----------------------------------------------------------
67
68 Implement addressing modes 2 (ldrb) and 3 (ldrsb)
69
70 ----------------------------------------------------------