diff options
author | Chris Lattner <sabre@nondot.org> | 2006-04-17 05:25:16 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-04-17 05:25:16 +0000 |
commit | e2e2cc5b2840bfb999203e116328a89bdbeed695 (patch) | |
tree | 407a37bd5d0870076112da2c43062e02d8c6d967 /llvm/utils/PerfectShuffle | |
parent | aac2a200cdb55bd954b47b10df53b85d792f5754 (diff) | |
download | bcm5719-llvm-e2e2cc5b2840bfb999203e116328a89bdbeed695.tar.gz bcm5719-llvm-e2e2cc5b2840bfb999203e116328a89bdbeed695.zip |
Encode a cost of zero as a cost of 1.
llvm-svn: 27745
Diffstat (limited to 'llvm/utils/PerfectShuffle')
-rw-r--r-- | llvm/utils/PerfectShuffle/PerfectShuffle.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/utils/PerfectShuffle/PerfectShuffle.cpp b/llvm/utils/PerfectShuffle/PerfectShuffle.cpp index c2abe9b6116..b19dd0d39ac 100644 --- a/llvm/utils/PerfectShuffle/PerfectShuffle.cpp +++ b/llvm/utils/PerfectShuffle/PerfectShuffle.cpp @@ -381,7 +381,9 @@ int main() { // CostSat - The cost of this operation saturated to two bits. unsigned CostSat = ShufTab[i].Cost; - if (CostSat > 3) CostSat = 3; + if (CostSat > 4) CostSat = 4; + if (CostSat == 0) CostSat = 1; + --CostSat; // Cost is now between 0-3. unsigned OpNum = ShufTab[i].Op ? ShufTab[i].Op->OpNum : 0; assert(OpNum < 16 && "Too few bits to encode operation!"); |