[cfe-commits] r44745 - /cfe/trunk/CodeGen/CGBuiltin.cpp

Anders Carlsson andersca at mac.com
Sun Dec 9 13:51:19 PST 2007


Author: andersca
Date: Sun Dec  9 15:51:19 2007
New Revision: 44745

URL: http://llvm.org/viewvc/llvm-project?rev=44745&view=rev
Log:
Implement __builtin_ia32_mulps.

Modified:
    cfe/trunk/CodeGen/CGBuiltin.cpp

Modified: cfe/trunk/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGBuiltin.cpp?rev=44745&r1=44744&r2=44745&view=diff

==============================================================================
--- cfe/trunk/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/CodeGen/CGBuiltin.cpp Sun Dec  9 15:51:19 2007
@@ -80,6 +80,15 @@
       return RValue::get(V);
     }
     
+    if (strcmp(TargetPrefix, "x86") == 0) {
+      if (strcmp(BuiltinName, "__builtin_ia32_mulps") == 0) {
+        llvm::Value *V = Builder.CreateMul(EmitScalarExpr(E->getArg(0)),
+                                           EmitScalarExpr(E->getArg(1)),
+                                           "result");
+        return RValue::get(V);
+      }
+    }
+      
     WarnUnsupported(E, "builtin function");
 
     // Unknown builtin, for now just dump it out and return undef.
@@ -179,6 +188,7 @@
     llvm::Value *V = llvm::ConstantFP::get(llvm::Type::DoubleTy, f);
     return RValue::get(V);
   }
+    
   }
   
   return RValue::get(0);





More information about the cfe-commits mailing list