diff gen/complex.cpp @ 364:8014dbd24605 trunk

[svn r385] Fix lvalue cast problems with -= and friends. Fix complex DtoBoolean.
author ChristianK
date Mon, 14 Jul 2008 22:48:03 +0200
parents 926f65e39246
children 0e6b4d65d3f8
line wrap: on
line diff
--- a/gen/complex.cpp	Mon Jul 14 21:49:54 2008 +0200
+++ b/gen/complex.cpp	Mon Jul 14 22:48:03 2008 +0200
@@ -320,10 +320,14 @@
     else
         cmpop = llvm::FCmpInst::FCMP_UNE;
 
-    // (l.re==r.re && l.im==r.im)
+    // (l.re==r.re && l.im==r.im) or (l.re!=r.re || l.im!=r.im)
     LLValue* b1 = new llvm::FCmpInst(cmpop, a, c, "tmp", gIR->scopebb());
     LLValue* b2 = new llvm::FCmpInst(cmpop, b, d, "tmp", gIR->scopebb());
-    return gIR->ir->CreateAnd(b1,b2,"tmp");
+
+    if (op == TOKequal)
+        return gIR->ir->CreateAnd(b1,b2,"tmp");
+    else
+        return gIR->ir->CreateOr(b1,b2,"tmp");
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////