# HG changeset patch # User Christos Kotselidis # Date 1374265291 -7200 # Node ID d5a8a7054005060975ec345e89c968f661384865 # Parent 2e852e96f97793105b6737e3670d702878be18dd# Parent f8fe0f7ee22a0253d7ba680306db6ac13e8b33ce Merge diff -r 2e852e96f977 -r d5a8a7054005 graal/com.oracle.graal.asm.hsail/src/com/oracle/graal/asm/hsail/AbstractHSAILAssembler.java --- a/graal/com.oracle.graal.asm.hsail/src/com/oracle/graal/asm/hsail/AbstractHSAILAssembler.java Fri Jul 19 22:18:40 2013 +0200 +++ b/graal/com.oracle.graal.asm.hsail/src/com/oracle/graal/asm/hsail/AbstractHSAILAssembler.java Fri Jul 19 22:21:31 2013 +0200 @@ -54,4 +54,9 @@ protected void patchJumpTarget(int branch, int jumpTarget) { // Nothing to do } + + @Override + protected String createLabelName(Label l, int id) { + return "@L" + id; + } } diff -r 2e852e96f977 -r d5a8a7054005 graal/com.oracle.graal.asm.hsail/src/com/oracle/graal/asm/hsail/HSAILAssembler.java --- a/graal/com.oracle.graal.asm.hsail/src/com/oracle/graal/asm/hsail/HSAILAssembler.java Fri Jul 19 22:18:40 2013 +0200 +++ b/graal/com.oracle.graal.asm.hsail/src/com/oracle/graal/asm/hsail/HSAILAssembler.java Fri Jul 19 22:21:31 2013 +0200 @@ -26,6 +26,7 @@ import com.oracle.graal.api.code.*; import static com.oracle.graal.api.code.ValueUtil.*; + import com.oracle.graal.api.meta.*; import com.oracle.graal.hsail.*; import com.oracle.graal.graph.GraalInternalError; @@ -144,12 +145,10 @@ } /** - * The mapping to stack slots is always relative to the beginning - * of the spillseg. HSAIL.getStackOffset returns the positive - * version of the originally negative offset. Then we back up - * from that by the argSize in bytes. This ensures that slots of - * different size do not overlap, even though we have converted - * from negative to positive offsets. + * The mapping to stack slots is always relative to the beginning of the spillseg. + * HSAIL.getStackOffset returns the positive version of the originally negative offset. Then we + * back up from that by the argSize in bytes. This ensures that slots of different size do not + * overlap, even though we have converted from negative to positive offsets. */ public static String mapStackSlot(Value reg, int argSize) { long offset = HSAIL.getStackOffset(reg); @@ -213,8 +212,7 @@ public void emitCompare(Value src0, Value src1, String condition, boolean unordered, boolean isUnsignedCompare) { String prefix = "cmp_" + condition + (unordered ? "u" : "") + "_b1_" + (isUnsignedCompare ? getArgTypeForceUnsigned(src1) : getArgType(src1)); - String comment = (isConstant(src1) && (src1.getKind() == Kind.Object) - && (asConstant(src1).asObject() == null) ? " // null test " : ""); + String comment = (isConstant(src1) && (src1.getKind() == Kind.Object) && (asConstant(src1).asObject() == null) ? " // null test " : ""); emitString(prefix + " $c0, " + mapRegOrConstToString(src0) + ", " + mapRegOrConstToString(src1) + ";" + comment); } @@ -269,7 +267,6 @@ emit(mnemonic + "_" + prefix, dest, "", src0, src1); } - private void emit(String instr, Value dest, String controlRegString, Value src0, Value src1) { assert (!isConstant(dest)); emitString(String.format("%s %s, %s%s, %s;", instr, HSAIL.mapRegister(dest), controlRegString, mapRegOrConstToString(src0), mapRegOrConstToString(src1))); @@ -277,17 +274,14 @@ private void emit(String instr, Value dest, Value src0, Value src1, Value src2) { assert (!isConstant(dest)); - emitString(String.format("%s %s, %s, %s, %s;", instr, HSAIL.mapRegister(dest), mapRegOrConstToString(src0), - mapRegOrConstToString(src1), mapRegOrConstToString(src2))); + emitString(String.format("%s %s, %s, %s, %s;", instr, HSAIL.mapRegister(dest), mapRegOrConstToString(src0), mapRegOrConstToString(src1), mapRegOrConstToString(src2))); } - public final void cmovCommon(Value dest, Value trueReg, Value falseReg, int width) { String instr = (width == 32 ? "cmov_b32" : "cmov_b64"); emit(instr, dest, "$c0, ", trueReg, falseReg); } - /** * Emit code to build a 64-bit pointer from a compressed-oop and the associated base and shift. * We only emit this if base and shift are not both zero. @@ -309,9 +303,8 @@ } /** - * Emit code to build a 32-bit compressed pointer from a full - * 64-bit pointer using the associated base and shift. We only - * emit this if base and shift are not both zero. + * Emit code to build a 32-bit compressed pointer from a full 64-bit pointer using the + * associated base and shift. We only emit this if base and shift are not both zero. */ public void emitCompressedOopEncode(Value result, long narrowOopBase, int narrowOopShift) { if (narrowOopBase != 0) { diff -r 2e852e96f977 -r d5a8a7054005 graal/com.oracle.graal.asm/src/com/oracle/graal/asm/AbstractAssembler.java --- a/graal/com.oracle.graal.asm/src/com/oracle/graal/asm/AbstractAssembler.java Fri Jul 19 22:18:40 2013 +0200 +++ b/graal/com.oracle.graal.asm/src/com/oracle/graal/asm/AbstractAssembler.java Fri Jul 19 22:21:31 2013 +0200 @@ -64,9 +64,10 @@ * * @param l the label for which a name is being created * @param id a label identifier that is unique with the scope of this assembler + * @return a label name in the form of "L123" */ protected String createLabelName(Label l, int id) { - return "@L" + id; + return "L" + id; } /**