[svn r180] Fixed complex negation, and tango.math.Math now compiles.

This commit is contained in:
Tomas Lindquist Olsen 2008-05-05 20:28:59 +02:00
parent a0c6cb6673
commit 071bf5a629
5 changed files with 31 additions and 3 deletions

View file

@ -282,6 +282,24 @@ DValue* DtoComplexDiv(Type* type, DValue* lhs, DValue* rhs)
//////////////////////////////////////////////////////////////////////////////////////////
DValue* DtoComplexNeg(Type* type, DValue* val)
{
val = DtoComplex(type, val);
llvm::Value *a, *b, *re, *im;
// values
DtoGetComplexParts(val, a, b);
// sub up
re = gIR->ir->CreateNeg(a, "tmp");
im = gIR->ir->CreateNeg(b, "tmp");
return new DComplexValue(type, re, im);
}
//////////////////////////////////////////////////////////////////////////////////////////
llvm::Value* DtoComplexEquals(TOK op, DValue* lhs, DValue* rhs)
{
Type* type = lhs->getType();