[llvm-commits] [llvm] r120092 - /llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp

Kalle Raiskila kalle.raiskila at nokia.com
Wed Nov 24 04:59:16 PST 2010


Author: kraiskil
Date: Wed Nov 24 06:59:16 2010
New Revision: 120092

URL: http://llvm.org/viewvc/llvm-project?rev=120092&view=rev
Log:
Use i8 as SETCC result type for i1 in SPU.

Modified:
    llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp

Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=120092&r1=120091&r2=120092&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Wed Nov 24 06:59:16 2010
@@ -501,10 +501,20 @@
 //===----------------------------------------------------------------------===//
 
 MVT::SimpleValueType SPUTargetLowering::getSetCCResultType(EVT VT) const {
-  // i16 and i32 are valid SETCC result types
-  return ((VT == MVT::i8 || VT == MVT::i16 || VT == MVT::i32) ?
-    VT.getSimpleVT().SimpleTy :
-    MVT::i32);
+  // i8, i16 and i32 are valid SETCC result types
+  MVT::SimpleValueType retval;
+
+  switch(VT.getSimpleVT().SimpleTy){
+    case MVT::i1:
+    case MVT::i8:
+      retval = MVT::i8; break;
+    case MVT::i16:
+      retval = MVT::i16; break;
+    case MVT::i32:
+    default:
+      retval = MVT::i32;
+  }
+  return retval;
 }
 
 //===----------------------------------------------------------------------===//





More information about the llvm-commits mailing list