Nate Begeman | b64af91 | 2004-08-10 20:42:36 +0000 | [diff] [blame] | 1 | TODO: |
Nate Begeman | ef9531e | 2005-04-11 20:48:57 +0000 | [diff] [blame] | 2 | * gpr0 allocation |
Nate Begeman | 4a0de07 | 2004-10-26 04:10:53 +0000 | [diff] [blame] | 3 | * implement do-loop -> bdnz transform |
Nate Begeman | ca068e8 | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 4 | * implement powerpc-64 for darwin |
Nate Begeman | d332fd5 | 2004-08-29 22:02:43 +0000 | [diff] [blame] | 5 | * use stfiwx in float->int |
Nate Begeman | 4ad870d | 2005-07-26 18:59:06 +0000 | [diff] [blame] | 6 | * be able to combine sequences like the following into 2 instructions: |
| 7 | lis r2, ha16(l2__ZTV4Cell) |
| 8 | la r2, lo16(l2__ZTV4Cell)(r2) |
| 9 | addi r2, r2, 8 |
Chris Lattner | b65975a | 2005-07-26 19:07:51 +0000 | [diff] [blame] | 10 | |
Nate Begeman | 5a01481 | 2005-08-14 01:17:16 +0000 | [diff] [blame] | 11 | * Teach LLVM how to codegen this: |
| 12 | unsigned short foo(float a) { return a; } |
| 13 | as: |
| 14 | _foo: |
| 15 | fctiwz f0,f1 |
| 16 | stfd f0,-8(r1) |
| 17 | lhz r3,-2(r1) |
| 18 | blr |
| 19 | not: |
| 20 | _foo: |
| 21 | fctiwz f0, f1 |
| 22 | stfd f0, -8(r1) |
| 23 | lwz r2, -4(r1) |
| 24 | rlwinm r3, r2, 0, 16, 31 |
| 25 | blr |
| 26 | |
| 27 | |
Chris Lattner | 6281ae4 | 2005-08-05 19:18:32 +0000 | [diff] [blame] | 28 | * Support 'update' load/store instructions. These are cracked on the G5, but |
| 29 | are still a codesize win. |
| 30 | |
Chris Lattner | c7e18a1 | 2005-08-09 22:30:57 +0000 | [diff] [blame] | 31 | * Add a custom legalizer for the GlobalAddress node, to move the funky darwin |
| 32 | stub stuff from the instruction selector to the legalizer (exposing low-level |
| 33 | operations to the dag for optzn. For example, we want to codegen this: |
| 34 | |
| 35 | int A = 0; |
| 36 | void B() { A++; } |
| 37 | as: |
| 38 | lis r9,ha16(_A) |
| 39 | lwz r2,lo16(_A)(r9) |
| 40 | addi r2,r2,1 |
| 41 | stw r2,lo16(_A)(r9) |
| 42 | not: |
| 43 | lis r2, ha16(_A) |
| 44 | lwz r2, lo16(_A)(r2) |
| 45 | addi r2, r2, 1 |
| 46 | lis r3, ha16(_A) |
| 47 | stw r2, lo16(_A)(r3) |
| 48 | |
Misha Brukman | 4ce5ce2 | 2004-07-27 18:43:04 +0000 | [diff] [blame] | 49 | * should hint to the branch select pass that it doesn't need to print the |
| 50 | second unconditional branch, so we don't end up with things like: |
Misha Brukman | 4ce5ce2 | 2004-07-27 18:43:04 +0000 | [diff] [blame] | 51 | b .LBBl42__2E_expand_function_8_674 ; loopentry.24 |
| 52 | b .LBBl42__2E_expand_function_8_42 ; NewDefault |
| 53 | b .LBBl42__2E_expand_function_8_42 ; NewDefault |
Chris Lattner | 424dcbd | 2005-08-23 06:27:59 +0000 | [diff] [blame] | 54 | |
Chris Lattner | a3c4454 | 2005-08-24 18:15:24 +0000 | [diff] [blame] | 55 | ===-------------------------------------------------------------------------=== |
| 56 | |
Chris Lattner | 424dcbd | 2005-08-23 06:27:59 +0000 | [diff] [blame] | 57 | * Codegen this: |
| 58 | |
| 59 | void test2(int X) { |
| 60 | if (X == 0x12345678) bar(); |
| 61 | } |
| 62 | |
| 63 | as: |
| 64 | |
| 65 | xoris r0,r3,0x1234 |
| 66 | cmpwi cr0,r0,0x5678 |
| 67 | beq cr0,L6 |
| 68 | |
| 69 | not: |
| 70 | |
| 71 | lis r2, 4660 |
| 72 | ori r2, r2, 22136 |
| 73 | cmpw cr0, r3, r2 |
| 74 | bne .LBB_test2_2 |
| 75 | |
Chris Lattner | a3c4454 | 2005-08-24 18:15:24 +0000 | [diff] [blame] | 76 | ===-------------------------------------------------------------------------=== |
| 77 | |
| 78 | Lump the constant pool for each function into ONE pic object, and reference |
| 79 | pieces of it as offsets from the start. For functions like this (contrived |
| 80 | to have lots of constants obviously): |
| 81 | |
| 82 | double X(double Y) { return (Y*1.23 + 4.512)*2.34 + 14.38; } |
| 83 | |
| 84 | We generate: |
| 85 | |
| 86 | _X: |
| 87 | lis r2, ha16(.CPI_X_0) |
| 88 | lfd f0, lo16(.CPI_X_0)(r2) |
| 89 | lis r2, ha16(.CPI_X_1) |
| 90 | lfd f2, lo16(.CPI_X_1)(r2) |
| 91 | fmadd f0, f1, f0, f2 |
| 92 | lis r2, ha16(.CPI_X_2) |
| 93 | lfd f1, lo16(.CPI_X_2)(r2) |
| 94 | lis r2, ha16(.CPI_X_3) |
| 95 | lfd f2, lo16(.CPI_X_3)(r2) |
| 96 | fmadd f1, f0, f1, f2 |
| 97 | blr |
| 98 | |
| 99 | It would be better to materialize .CPI_X into a register, then use immediates |
| 100 | off of the register to avoid the lis's. This is even more important in PIC |
| 101 | mode. |
| 102 | |
| 103 | ===-------------------------------------------------------------------------=== |
Nate Begeman | 92cce90 | 2005-09-06 15:30:48 +0000 | [diff] [blame^] | 104 | |
| 105 | Implement Newton-Rhapson method for improving estimate instructions to the |
| 106 | correct accuracy, and implementing divide as multiply by reciprocal when it has |
| 107 | more than one use. Itanium will want this too. |