diff options
author | Chris Lattner <sabre@nondot.org> | 2005-08-24 18:15:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-08-24 18:15:24 +0000 |
commit | a3c4454c5fb70ab94c7de4faf2600ed729fffda0 (patch) | |
tree | 69e86caade654d549f423f944c37d8698395beb8 | |
parent | ac83b0301ea5ce0e1092fad8f294fe7f046832ff (diff) |
add an idea
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23020 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/PowerPC/README.txt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/README.txt b/lib/Target/PowerPC/README.txt index 649986e950..ffc4d0b4bc 100644 --- a/lib/Target/PowerPC/README.txt +++ b/lib/Target/PowerPC/README.txt @@ -52,6 +52,8 @@ _foo: b .LBBl42__2E_expand_function_8_42 ; NewDefault b .LBBl42__2E_expand_function_8_42 ; NewDefault +===-------------------------------------------------------------------------=== + * Codegen this: void test2(int X) { @@ -71,3 +73,31 @@ _foo: cmpw cr0, r3, r2 bne .LBB_test2_2 +===-------------------------------------------------------------------------=== + +Lump the constant pool for each function into ONE pic object, and reference +pieces of it as offsets from the start. For functions like this (contrived +to have lots of constants obviously): + +double X(double Y) { return (Y*1.23 + 4.512)*2.34 + 14.38; } + +We generate: + +_X: + lis r2, ha16(.CPI_X_0) + lfd f0, lo16(.CPI_X_0)(r2) + lis r2, ha16(.CPI_X_1) + lfd f2, lo16(.CPI_X_1)(r2) + fmadd f0, f1, f0, f2 + lis r2, ha16(.CPI_X_2) + lfd f1, lo16(.CPI_X_2)(r2) + lis r2, ha16(.CPI_X_3) + lfd f2, lo16(.CPI_X_3)(r2) + fmadd f1, f0, f1, f2 + blr + +It would be better to materialize .CPI_X into a register, then use immediates +off of the register to avoid the lis's. This is even more important in PIC +mode. + +===-------------------------------------------------------------------------=== |