From 55c63257f31e2fa0b4a606f15d809cf615bc960c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 5 May 2006 05:36:15 +0000 Subject: [PATCH] New note, Nate, please check to see if I'm full of it :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28118 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PowerPC/README.txt | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/lib/Target/PowerPC/README.txt b/lib/Target/PowerPC/README.txt index 6b3988dfb9a..bbe311cb38b 100644 --- a/lib/Target/PowerPC/README.txt +++ b/lib/Target/PowerPC/README.txt @@ -559,3 +559,36 @@ transformation, good for PI. See PPCISelLowering.cpp, this comment: // need to flag these together so that the value isn't live across a call. //setOperationAction(ISD::SINT_TO_FP, MVT::i32, Custom); +===-------------------------------------------------------------------------=== + +Another missed rlwimi case: + +void %foo(uint *%tmp) { + %tmp = load uint* %tmp ; [#uses=3] + %tmp1 = shr uint %tmp, ubyte 31 ; [#uses=1] + %tmp1 = cast uint %tmp1 to ubyte ; [#uses=1] + %tmp4.mask = shr uint %tmp, ubyte 30 ; [#uses=1] + %tmp4.mask = cast uint %tmp4.mask to ubyte ; [#uses=1] + %tmp = or ubyte %tmp4.mask, %tmp1 ; [#uses=1] + %tmp10 = cast ubyte %tmp to uint ; [#uses=1] + %tmp11 = shl uint %tmp10, ubyte 31 ; [#uses=1] + %tmp12 = and uint %tmp, 2147483647 ; [#uses=1] + %tmp13 = or uint %tmp11, %tmp12 ; [#uses=1] + store uint %tmp13, uint* %tmp + ret void +} + +We emit: + +_foo: + lwz r2, 0(r3) + srwi r4, r2, 30 + srwi r5, r2, 31 + or r4, r4, r5 + slwi r4, r4, 31 + rlwimi r4, r2, 0, 1, 31 + stw r4, 0(r3) + blr + +I *think* that could use another rlwimi. + -- 2.34.1