diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-01-16 06:39:48 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-01-16 06:39:48 +0000 |
| commit | 89e5813312f7c5aae9f576025b09c8f0deaa45d2 (patch) | |
| tree | 43d0a7eb90bc7db56aa33d98970b7a253f0c0502 /llvm/lib | |
| parent | 4dc44892864cfe19d6e56f01d5a261eb59d92910 (diff) | |
| download | bcm5719-llvm-89e5813312f7c5aae9f576025b09c8f0deaa45d2.tar.gz bcm5719-llvm-89e5813312f7c5aae9f576025b09c8f0deaa45d2.zip | |
add a note: we need whole-function selectiondags :)
llvm-svn: 33252
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/README.txt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/llvm/lib/Target/README.txt b/llvm/lib/Target/README.txt index 9ea0a91daf5..2f6ecfacd12 100644 --- a/llvm/lib/Target/README.txt +++ b/llvm/lib/Target/README.txt @@ -387,3 +387,31 @@ void good(unsigned x) to enable further optimizations. //===---------------------------------------------------------------------===// + +Consider: + +typedef unsigned U32; +typedef unsigned long long U64; +int test (U32 *inst, U64 *regs) { + U64 effective_addr2; + U32 temp = *inst; + int r1 = (temp >> 20) & 0xf; + int b2 = (temp >> 16) & 0xf; + effective_addr2 = temp & 0xfff; + if (b2) effective_addr2 += regs[b2]; + b2 = (temp >> 12) & 0xf; + if (b2) effective_addr2 += regs[b2]; + effective_addr2 &= regs[4]; + if ((effective_addr2 & 3) == 0) + return 1; + return 0; +} + +Note that only the low 2 bits of effective_addr2 are used. On 32-bit systems, +we don't eliminate the computation of the top half of effective_addr2 because +we don't have whole-function selection dags. On x86, this means we use one +extra register for the function when effective_addr2 is declared as U64 than +when it is declared U32. + +//===---------------------------------------------------------------------===// + |

