Use i8 as SETCC result type for i1 in SPU.
authorKalle Raiskila <kalle.raiskila@nokia.com>
Wed, 24 Nov 2010 12:59:16 +0000 (12:59 +0000)
committerKalle Raiskila <kalle.raiskila@nokia.com>
Wed, 24 Nov 2010 12:59:16 +0000 (12:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120092 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CellSPU/SPUISelLowering.cpp

index 0fa511eade3bca8ee10758e479d0f8205028ccea..8d047f14ae9a7cbd3db81c6e4aedb3e02c64592d 100644 (file)
@@ -501,10 +501,20 @@ unsigned SPUTargetLowering::getFunctionAlignment(const Function *) const {
 //===----------------------------------------------------------------------===//
 
 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;
 }
 
 //===----------------------------------------------------------------------===//