blob: 768a2e6f3e4537374ff51d17740ca31dc342b1fc [file] [log] [blame]
Rafael Espindolaf4d40052006-08-22 12:22:46 +00001//===---------------------------------------------------------------------===//
2// Random ideas for the ARM backend.
3//===---------------------------------------------------------------------===//
4
5Consider implementing a select with two conditional moves:
6
7cmp x, y
8moveq dst, a
9movne dst, b
Rafael Espindola75645492006-09-22 11:36:17 +000010
11----------------------------------------------------------
12
13
14%tmp1 = shl int %b, ubyte %c
15%tmp4 = add int %a, %tmp1
16
17compiles to
18
19add r0, r0, r1, lsl r2
20
21but
22
23%tmp1 = shl int %b, ubyte %c
24%tmp4 = add int %tmp1, %a
25
26compiles to
27mov r1, r1, lsl r2
28add r0, r1, r0
29
30----------------------------------------------------------
Rafael Espindolacd71da52006-10-03 17:27:58 +000031
Rafael Espindola5aca9272006-10-07 14:03:39 +000032add an offset to FLDS/FLDD addressing mode
Rafael Espindolacd71da52006-10-03 17:27:58 +000033
34----------------------------------------------------------
Rafael Espindola5af3a682006-10-09 14:18:33 +000035
36the function
37
38void %f() {
39entry:
40 call void %g( int 1, int 2, int 3, int 4, int 5 )
41 ret void
42}
43
44declare void %g(int, int, int, int, int)
45
46Only needs 8 bytes of stack space. We currently allocate 16.
47
48----------------------------------------------------------
Rafael Espindolabec2e382006-10-16 16:33:29 +000049
5032 x 32 -> 64 multiplications currently uses two instructions. We
51should try to declare smull and umull as returning two values.
52
53----------------------------------------------------------