Mercurial > projects > ldc
comparison gen/complex.cpp @ 164:a64becf2a702 trunk
[svn r180] Fixed complex negation, and tango.math.Math now compiles.
author | lindquist |
---|---|
date | Mon, 05 May 2008 20:28:59 +0200 |
parents | 44a95ac7368a |
children | 9d44ec83acd1 |
comparison
equal
deleted
inserted
replaced
163:a8cd9bc1021a | 164:a64becf2a702 |
---|---|
280 return new DComplexValue(type, re, im); | 280 return new DComplexValue(type, re, im); |
281 } | 281 } |
282 | 282 |
283 ////////////////////////////////////////////////////////////////////////////////////////// | 283 ////////////////////////////////////////////////////////////////////////////////////////// |
284 | 284 |
285 DValue* DtoComplexNeg(Type* type, DValue* val) | |
286 { | |
287 val = DtoComplex(type, val); | |
288 | |
289 llvm::Value *a, *b, *re, *im; | |
290 | |
291 // values | |
292 DtoGetComplexParts(val, a, b); | |
293 | |
294 // sub up | |
295 re = gIR->ir->CreateNeg(a, "tmp"); | |
296 im = gIR->ir->CreateNeg(b, "tmp"); | |
297 | |
298 return new DComplexValue(type, re, im); | |
299 } | |
300 | |
301 ////////////////////////////////////////////////////////////////////////////////////////// | |
302 | |
285 llvm::Value* DtoComplexEquals(TOK op, DValue* lhs, DValue* rhs) | 303 llvm::Value* DtoComplexEquals(TOK op, DValue* lhs, DValue* rhs) |
286 { | 304 { |
287 Type* type = lhs->getType(); | 305 Type* type = lhs->getType(); |
288 | 306 |
289 lhs = DtoComplex(type, lhs); | 307 lhs = DtoComplex(type, lhs); |