summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-02 19:30:55 +0000
committerChris Lattner <sabre@nondot.org>2005-08-02 19:30:55 +0000
commit989d8bbda9cf54636a36d4e231018a39c1156520 (patch)
treea2223dcbfbee2852158af5b8f442e810f4209697 /llvm/lib/Target/PowerPC
parent6667bdbacad033f7090304fb559889a1ba08eab1 (diff)
downloadbcm5719-llvm-989d8bbda9cf54636a36d4e231018a39c1156520.tar.gz
bcm5719-llvm-989d8bbda9cf54636a36d4e231018a39c1156520.zip
This hunk accidentally got dropped. Patch by Jim Laskey
llvm-svn: 22595
Diffstat (limited to 'llvm/lib/Target/PowerPC')
-rw-r--r--llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp67
1 files changed, 0 insertions, 67 deletions
diff --git a/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp b/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
index 0e36b0ff76c..f6f794ed564 100644
--- a/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
+++ b/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
@@ -601,73 +601,6 @@ public:
}
};
-/// ExactLog2 - This function solves for (Val == 1 << (N-1)) and returns N. It
-/// returns zero when the input is not exactly a power of two.
-static unsigned ExactLog2(unsigned Val) {
- if (Val == 0 || (Val & (Val-1))) return 0;
- unsigned Count = 0;
- while (Val != 1) {
- Val >>= 1;
- ++Count;
- }
- return Count;
-}
-
-// IsRunOfOnes - returns true if Val consists of one contiguous run of 1's with
-// any number of 0's on either side. the 1's are allowed to wrap from LSB to
-// MSB. so 0x000FFF0, 0x0000FFFF, and 0xFF0000FF are all runs. 0x0F0F0000 is
-// not, since all 1's are not contiguous.
-static bool IsRunOfOnes(unsigned Val, unsigned &MB, unsigned &ME) {
- bool isRun = true;
- MB = 0;
- ME = 0;
-
- // look for first set bit
- int i = 0;
- for (; i < 32; i++) {
- if ((Val & (1 << (31 - i))) != 0) {
- MB = i;
- ME = i;
- break;
- }
- }
-
- // look for last set bit
- for (; i < 32; i++) {
- if ((Val & (1 << (31 - i))) == 0)
- break;
- ME = i;
- }
-
- // look for next set bit
- for (; i < 32; i++) {
- if ((Val & (1 << (31 - i))) != 0)
- break;
- }
-
- // if we exhausted all the bits, we found a match at this point for 0*1*0*
- if (i == 32)
- return true;
-
- // since we just encountered more 1's, if it doesn't wrap around to the
- // most significant bit of the word, then we did not find a match to 1*0*1* so
- // exit.
- if (MB != 0)
- return false;
-
- // look for last set bit
- for (MB = i; i < 32; i++) {
- if ((Val & (1 << (31 - i))) == 0)
- break;
- }
-
- // if we exhausted all the bits, then we found a match for 1*0*1*, otherwise,
- // the value is not a run of ones.
- if (i == 32)
- return true;
- return false;
-}
-
/// getImmediateForOpcode - This method returns a value indicating whether
/// the ConstantSDNode N can be used as an immediate to Opcode. The return
/// values are either 0, 1 or 2. 0 indicates that either N is not a
OpenPOWER on IntegriCloud