Mercurial > hg > truffle
diff graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64CompareOpcode.java @ 4183:9e0c1b4cfef5
Move all isXxx and asXxx out of CiValue and into their own util class.
author | Christian Wimmer <Christian.Wimmer@Oracle.com> |
---|---|
date | Mon, 02 Jan 2012 17:39:20 -0800 |
parents | bc8527f3071c |
children | aaac4894175c |
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64CompareOpcode.java Mon Jan 02 14:38:17 2012 -0800 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64CompareOpcode.java Mon Jan 02 17:39:20 2012 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,6 +22,8 @@ */ package com.oracle.max.graal.compiler.target.amd64; +import static com.sun.cri.ci.CiValueUtil.*; + import com.oracle.max.asm.target.amd64.*; import com.oracle.max.graal.compiler.asm.*; import com.oracle.max.graal.compiler.lir.*; @@ -54,9 +56,9 @@ } protected void emit(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue left, CiValue right) { - CiRegister lreg = tasm.asRegister(left); - if (right.isRegister()) { - CiRegister rreg = tasm.asRegister(right); + CiRegister lreg = asRegister(left); + if (isRegister(right)) { + CiRegister rreg = asRegister(right); switch (this) { case ICMP: masm.cmpl(lreg, rreg); break; case LCMP: masm.cmpq(lreg, rreg); break; @@ -65,7 +67,7 @@ case DCMP: masm.ucomisd(lreg, rreg); break; default: throw Util.shouldNotReachHere(); } - } else if (right.isConstant()) { + } else if (isConstant(right)) { switch (this) { case ICMP: masm.cmpl(lreg, tasm.asIntConst(right)); break; case LCMP: masm.cmpq(lreg, tasm.asIntConst(right)); break;