2006-08-22 12:22:46 +00:00
|
|
|
//===---------------------------------------------------------------------===//
|
|
|
|
// Random ideas for the ARM backend.
|
|
|
|
//===---------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
Consider implementing a select with two conditional moves:
|
|
|
|
|
|
|
|
cmp x, y
|
|
|
|
moveq dst, a
|
|
|
|
movne dst, b
|
2006-09-22 11:36:17 +00:00
|
|
|
|
|
|
|
----------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
%tmp1 = shl int %b, ubyte %c
|
|
|
|
%tmp4 = add int %a, %tmp1
|
|
|
|
|
|
|
|
compiles to
|
|
|
|
|
|
|
|
add r0, r0, r1, lsl r2
|
|
|
|
|
|
|
|
but
|
|
|
|
|
|
|
|
%tmp1 = shl int %b, ubyte %c
|
|
|
|
%tmp4 = add int %tmp1, %a
|
|
|
|
|
|
|
|
compiles to
|
|
|
|
mov r1, r1, lsl r2
|
|
|
|
add r0, r1, r0
|
|
|
|
|
|
|
|
----------------------------------------------------------
|
2006-10-03 17:27:58 +00:00
|
|
|
|
2006-10-17 13:36:07 +00:00
|
|
|
add an offset to FLDS/FLDD/FSTD/FSTS addressing mode
|
2006-10-03 17:27:58 +00:00
|
|
|
|
|
|
|
----------------------------------------------------------
|
2006-10-09 14:18:33 +00:00
|
|
|
|
|
|
|
the function
|
|
|
|
|
|
|
|
void %f() {
|
|
|
|
entry:
|
|
|
|
call void %g( int 1, int 2, int 3, int 4, int 5 )
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void %g(int, int, int, int, int)
|
|
|
|
|
|
|
|
Only needs 8 bytes of stack space. We currently allocate 16.
|
|
|
|
|
|
|
|
----------------------------------------------------------
|
2006-10-16 16:33:29 +00:00
|
|
|
|
|
|
|
32 x 32 -> 64 multiplications currently uses two instructions. We
|
|
|
|
should try to declare smull and umull as returning two values.
|
|
|
|
|
|
|
|
----------------------------------------------------------
|
2006-10-16 17:17:22 +00:00
|
|
|
|
|
|
|
Implement addressing modes 2 (ldrb) and 3 (ldrsb)
|
|
|
|
|
|
|
|
----------------------------------------------------------
|