aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-10-28 00:20:45 +0000
committerChris Lattner <sabre@nondot.org>2005-10-28 00:20:45 +0000
commit01959105583ee04bd9c131db7174b6108177caf3 (patch)
tree263e22b6ecc4f57641f42f24d59d0c187b5e42b1 /lib
parent0d841e05677bdc55d003720e85e12d28dfe31862 (diff)
downloadexternal_llvm-01959105583ee04bd9c131db7174b6108177caf3.zip
external_llvm-01959105583ee04bd9c131db7174b6108177caf3.tar.gz
external_llvm-01959105583ee04bd9c131db7174b6108177caf3.tar.bz2
a bad case for bitfield insert
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24051 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/PowerPC/README.txt34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/README.txt b/lib/Target/PowerPC/README.txt
index a1f28b1..abd9157 100644
--- a/lib/Target/PowerPC/README.txt
+++ b/lib/Target/PowerPC/README.txt
@@ -185,3 +185,37 @@ doesn't get folded into the rlwimi instruction. We should ideally see through
things like this, rather than forcing llvm to generate the equivalent
(shl (add bitfield, C2), C1) with some kind of mask.
+
+===-------------------------------------------------------------------------===
+
+Compile this (standard bitfield insert of a constant):
+void %test(uint* %tmp1) {
+ %tmp2 = load uint* %tmp1 ; <uint> [#uses=1]
+ %tmp5 = or uint %tmp2, 257949696 ; <uint> [#uses=1]
+ %tmp6 = and uint %tmp5, 4018143231 ; <uint> [#uses=1]
+ store uint %tmp6, uint* %tmp1
+ ret void
+}
+
+to:
+
+_test:
+ lwz r0,0(r3)
+ li r2,123
+ rlwimi r0,r2,21,3,10
+ stw r0,0(r3)
+ blr
+
+instead of:
+
+_test:
+ lis r2, -4225
+ lwz r4, 0(r3)
+ ori r2, r2, 65535
+ oris r4, r4, 3936
+ and r2, r4, r2
+ stw r2, 0(r3)
+ blr
+
+
+