mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-25 00:33:15 +00:00
47857812e2
Three changes: 1. Convert signed integer types to signless versions. 2. Implement the @sext and @zext parameter attributes. Previously the type of an function parameter was used to determine whether it should be sign extended or zero extended before the call. This information is now communicated via the function type's parameter attributes. 3. The interface to LowerCallTo had to be changed in order to accommodate the parameter attribute information. Although it would have been convenient to pass in the FunctionType itself, there isn't always one present in the caller. Consequently, a signedness indication for the result type and for each parameter was provided for in the interface to this method. All implementations were changed to make the adjustment necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32788 91177308-0d34-0410-b5e6-96231b3b80d8
//===---------------------------------------------------------------------===// // Random ideas for the ARM backend. //===---------------------------------------------------------------------===// Consider implementing a select with two conditional moves: cmp x, y moveq dst, a movne dst, b ---------------------------------------------------------- %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 --------------------------------------------------------- %tmp1 = shl int %b, ubyte 4 %tmp2 = add int %a, %tmp1 compiles to mov r2, #4 add r0, r0, r1, lsl r2 should be add r0, r0, r1, lsl #4 ---------------------------------------------------------- add an offset to FLDS/FLDD/FSTD/FSTS addressing mode ---------------------------------------------------------- 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. ---------------------------------------------------------- 32 x 32 -> 64 multiplications currently uses two instructions. We should try to declare smull and umull as returning two values. ---------------------------------------------------------- Implement addressing modes 2 (ldrb) and 3 (ldrsb) ----------------------------------------------------------