Author: asl
Date: Thu Nov 15 19:37:13 2007
New Revision: 44184

URL: http://llvm.org/viewvc/llvm-project?rev=44184&view=rev
Log:
Lower __builtin_flt_rounds into LLVM intrinsic

Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=44184&r1=44183&r2=44184&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Thu Nov 15 19:37:13 2007
@@ -3911,7 +3911,15 @@
   }
   
   switch (DECL_FUNCTION_CODE(fndecl)) {
-  default: return false;
+  default:
+#ifndef NDEBUG
+    std::cerr << "Unhandled builtin!\n"
+              << "DECL_FUNCTION_CODE: " << DECL_FUNCTION_CODE(fndecl) << "\n";
+    debug_tree(fndecl);
+    abort();
+#else
+    return false;
+#endif
   // Varargs builtins.
   case BUILT_IN_VA_START:
   case BUILT_IN_STDARG_START:   return EmitBuiltinVAStart(exp);
@@ -4028,7 +4036,13 @@
                                   Result, "tmp");
     return true;
   }
-
+  case BUILT_IN_FLT_ROUNDS: {
+    Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule,
+                                                          
Intrinsic::flt_rounds),
+                                "tmp");
+    Result = BitCastToType(Result, ConvertType(TREE_TYPE(exp)));
+    return true;
+  }
 #if 1  // FIXME: Should handle these GCC extensions eventually.
     case BUILT_IN_APPLY_ARGS:
     case BUILT_IN_APPLY:


_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to