mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 23:50:43 +03:00
[svn r180] Fixed complex negation, and tango.math.Math now compiles.
This commit is contained in:
parent
a0c6cb6673
commit
071bf5a629
5 changed files with 31 additions and 3 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue