comparison graal/GraalCompiler/src/com/sun/c1x/target/amd64/AMD64LIRGenerator.java @ 2862:45422967cbcf

Rename Materialize => NormalizeCompare
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Tue, 07 Jun 2011 16:32:35 +0200
parents a97605b0489b
children fc75fd3fa5e4
comparison
equal deleted inserted replaced
2861:29d33aac5ae3 2862:45422967cbcf
415 private void trySwap(Binary x) { 415 private void trySwap(Binary x) {
416 // (tw) TODO: Check what this is for? 416 // (tw) TODO: Check what this is for?
417 } 417 }
418 418
419 @Override 419 @Override
420 public void visitMaterialize(Materialize x) { 420 public void visitMaterialize(NormalizeCompare x) {
421 LIRItem left = new LIRItem(x.x(), this); 421 LIRItem left = new LIRItem(x.x(), this);
422 LIRItem right = new LIRItem(x.y(), this); 422 LIRItem right = new LIRItem(x.y(), this);
423 if (!x.kind.isVoid() && x.x().kind.isLong()) { 423 if (!x.kind.isVoid() && x.x().kind.isLong()) {
424 left.setDestroysRegister(); 424 left.setDestroysRegister();
425 } 425 }
470 // nothing to do for now 470 // nothing to do for now
471 } 471 }
472 472
473 @Override 473 @Override
474 public void visitIf(If x) { 474 public void visitIf(If x) {
475 CiKind kind = x.x().kind; 475 CiKind kind = x.compare().x().kind;
476 476
477 Condition cond = x.condition(); 477 Condition cond = x.compare().condition();
478 478
479 LIRItem xitem = new LIRItem(x.x(), this); 479 LIRItem xitem = new LIRItem(x.compare().x(), this);
480 LIRItem yitem = new LIRItem(x.y(), this); 480 LIRItem yitem = new LIRItem(x.compare().y(), this);
481 LIRItem xin = xitem; 481 LIRItem xin = xitem;
482 LIRItem yin = yitem; 482 LIRItem yin = yitem;
483 483
484 if (kind.isLong()) { 484 if (kind.isLong()) {
485 // for longs, only conditions "eql", "neq", "lss", "geq" are valid; 485 // for longs, only conditions "eql", "neq", "lss", "geq" are valid;
502 setNoResult(x); 502 setNoResult(x);
503 503
504 CiValue left = xin.result(); 504 CiValue left = xin.result();
505 CiValue right = yin.result(); 505 CiValue right = yin.result();
506 lir.cmp(cond, left, right); 506 lir.cmp(cond, left, right);
507 if (x.x().kind.isFloat() || x.x().kind.isDouble()) { 507 if (x.compare().x().kind.isFloat() || x.compare().x().kind.isDouble()) {
508 lir.branch(cond, right.kind, getLIRBlock(x.trueSuccessor()), getLIRBlock(x.unorderedSuccessor())); 508 Instruction unorderedSucc = x.falseSuccessor();
509 if (x.compare().unorderedIsTrue()) {
510 unorderedSucc = x.trueSuccessor();
511 }
512 lir.branch(cond, right.kind, getLIRBlock(x.trueSuccessor()), getLIRBlock(unorderedSucc));
509 } else { 513 } else {
510 lir.branch(cond, right.kind, getLIRBlock(x.trueSuccessor())); 514 lir.branch(cond, right.kind, getLIRBlock(x.trueSuccessor()));
511 } 515 }
512 assert x.defaultSuccessor() == x.falseSuccessor() : "wrong destination above"; 516 assert x.defaultSuccessor() == x.falseSuccessor() : "wrong destination above";
513 lir.jump(getLIRBlock(x.defaultSuccessor())); 517 lir.jump(getLIRBlock(x.defaultSuccessor()));