Mercurial > hg > graal-jvmci-8
diff graal/GraalCompiler/src/com/sun/c1x/target/amd64/AMD64LIRGenerator.java @ 2519:f6125fb5bfbc
Removed intrinsics.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 27 Apr 2011 16:25:32 +0200 |
parents | 4fdef1464592 |
children | 2f271a85d104 |
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/target/amd64/AMD64LIRGenerator.java Wed Apr 27 15:49:27 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/target/amd64/AMD64LIRGenerator.java Wed Apr 27 16:25:32 2011 +0200 @@ -449,92 +449,6 @@ } @Override - protected void genCompareAndSwap(Intrinsic x, CiKind kind) { - assert x.numberOfArguments() == 5 : "wrong number of arguments: " + x.numberOfArguments(); - // Argument 0 is the receiver. - LIRItem obj = new LIRItem(x.argumentAt(1), this); // object - LIRItem offset = new LIRItem(x.argumentAt(2), this); // offset of field - LIRItem val = new LIRItem(x.argumentAt(4), this); // replace field with val if matches cmp - - assert obj.instruction.kind.isObject() : "invalid type"; - - assert val.instruction.kind == kind : "invalid type"; - - // get address of field - obj.loadItem(); - offset.loadNonconstant(); - CiAddress addr; - if (offset.result().isConstant()) { - addr = new CiAddress(kind, obj.result(), (int) ((CiConstant) offset.result()).asLong()); - } else { - addr = new CiAddress(kind, obj.result(), offset.result()); - } - - // Compare operand needs to be in RAX. - CiValue cmp = force(x.argumentAt(3), AMD64.rax.asValue(kind)); - val.loadItem(); - - CiValue pointer = newVariable(CiKind.Word); - lir.lea(addr, pointer); - - if (kind.isObject()) { // Write-barrier needed for Object fields. - // Do the pre-write barrier : if any. - preGCWriteBarrier(pointer, false, null); - } - - if (kind.isObject()) { - lir.casObj(pointer, cmp, val.result()); - } else if (kind.isInt()) { - lir.casInt(pointer, cmp, val.result()); - } else if (kind.isLong()) { - lir.casLong(pointer, cmp, val.result()); - } else { - Util.shouldNotReachHere(); - } - - // generate conditional move of boolean result - CiValue result = createResultVariable(x); - lir.cmove(Condition.EQ, CiConstant.INT_1, CiConstant.INT_0, result); - if (kind.isObject()) { // Write-barrier needed for Object fields. - // Seems to be precise - postGCWriteBarrier(pointer, val.result()); - } - } - - @Override - protected void genMathIntrinsic(Intrinsic x) { - assert x.numberOfArguments() == 1 : "wrong type"; - - CiValue calcInput = load(x.argumentAt(0)); - - switch (x.intrinsic()) { - case java_lang_Math$abs: - lir.abs(calcInput, createResultVariable(x), ILLEGAL); - break; - case java_lang_Math$sqrt: - lir.sqrt(calcInput, createResultVariable(x), ILLEGAL); - break; - case java_lang_Math$sin: - setResult(x, callRuntimeWithResult(CiRuntimeCall.ArithmeticSin, null, calcInput)); - break; - case java_lang_Math$cos: - setResult(x, callRuntimeWithResult(CiRuntimeCall.ArithmeticCos, null, calcInput)); - break; - case java_lang_Math$tan: - setResult(x, callRuntimeWithResult(CiRuntimeCall.ArithmeticTan, null, calcInput)); - break; - case java_lang_Math$log: - setResult(x, callRuntimeWithResult(CiRuntimeCall.ArithmeticLog, null, calcInput)); - break; - case java_lang_Math$log10: - setResult(x, callRuntimeWithResult(CiRuntimeCall.ArithmeticLog10, null, calcInput)); - break; - default: - Util.shouldNotReachHere("Unknown math intrinsic"); - } - } - - @Override public void visitConvert(Convert x) { CiValue input = load(x.value()); CiVariable result = newVariable(x.kind);