# HG changeset patch # User Josef Eisl # Date 1395941755 -3600 # Node ID 4f5c312d676e0060977f84d2ece6b5cf13e1d19d # Parent 2372488fd33f28ddff0191ffdae3f4f6b6954105 Fix merge regressions. diff -r 2372488fd33f -r 4f5c312d676e graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java --- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java Thu Mar 27 17:47:55 2014 +0100 +++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java Thu Mar 27 18:35:55 2014 +0100 @@ -60,12 +60,13 @@ import com.oracle.graal.lir.amd64.AMD64ControlFlow.ReturnOp; import com.oracle.graal.lir.amd64.AMD64ControlFlow.StrategySwitchOp; import com.oracle.graal.lir.amd64.AMD64ControlFlow.TableSwitchOp; +import com.oracle.graal.lir.amd64.AMD64Move.LeaDataOp; import com.oracle.graal.lir.amd64.AMD64Move.LeaOp; -import com.oracle.graal.lir.amd64.AMD64Move.LoadOp; import com.oracle.graal.lir.amd64.AMD64Move.MembarOp; import com.oracle.graal.lir.amd64.AMD64Move.MoveFromRegOp; import com.oracle.graal.lir.amd64.AMD64Move.MoveToRegOp; import com.oracle.graal.lir.amd64.AMD64Move.StackLeaOp; +import com.oracle.graal.lir.amd64.AMD64Move.ZeroExtendLoadOp; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.calc.FloatConvertNode.FloatConvert; @@ -157,6 +158,10 @@ append(createMove(dst, src)); } + public void emitData(AllocatableValue dst, byte[] data) { + append(new LeaDataOp(dst, data)); + } + @Override public AMD64AddressValue emitAddress(Value base, long displacement, Value index, int scale) { AllocatableValue baseRegister; @@ -545,11 +550,10 @@ } protected Value emitZeroExtendMemory(Kind memoryKind, int resultBits, AMD64AddressValue address, LIRFrameState state) { - assert memoryKind.isUnsigned(); // Issue a zero extending load of the proper bit size and set the result to // the proper kind. Variable result = newVariable(resultBits == 32 ? Kind.Int : Kind.Long); - append(new LoadOp(memoryKind, result, address, state)); + append(new ZeroExtendLoadOp(memoryKind, result, address, state)); return result; } diff -r 2372488fd33f -r 4f5c312d676e graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILLIRGenerator.java --- a/graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILLIRGenerator.java Thu Mar 27 17:47:55 2014 +0100 +++ b/graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILLIRGenerator.java Thu Mar 27 18:35:55 2014 +0100 @@ -251,7 +251,7 @@ /** * Generates the LIR instruction for a negation operation. - * + * * @param input the value that is being negated * @return Variable that represents the result of the negation */ @@ -282,7 +282,7 @@ /** * Generates the LIR instruction for a bitwise NOT operation. - * + * * @param input the source operand * @return Variable that represents the result of the operation */ @@ -518,7 +518,7 @@ /** * Generates the LIR instruction for a shift left operation. - * + * * @param a The value that is being shifted * @param b The shift amount * @return Variable that represents the result of the operation @@ -543,7 +543,7 @@ /** * Generates the LIR instruction for a shift right operation. - * + * * @param a The value that is being shifted * @param b The shift amount * @return Variable that represents the result of the operation @@ -568,7 +568,7 @@ /** * Generates the LIR instruction for an unsigned shift right operation. - * + * * @param a The value that is being shifted * @param b The shift amount * @return Variable that represents the result of the operation @@ -713,7 +713,7 @@ /** * Emits the LIR code for the {@link HSAILArithmetic#ABS} operation. - * + * * @param input the source operand * @return Value representing the result of the operation */ @@ -726,7 +726,7 @@ /** * Emits the LIR code for the {@link HSAILArithmetic#CEIL} operation. - * + * * @param input the source operand * @return Value representing the result of the operation */ @@ -738,7 +738,7 @@ /** * Emits the LIR code for the {@link HSAILArithmetic#FLOOR} operation. - * + * * @param input the source operand * @return Value representing the result of the operation */ @@ -750,7 +750,7 @@ /** * Emits the LIR code for the {@link HSAILArithmetic#RINT} operation. - * + * * @param input the source operand * @return Value representing the result of the operation */ @@ -762,7 +762,7 @@ /** * Emits the LIR code for the {@link HSAILArithmetic#SQRT} operation. - * + * * @param input the source operand * @return value representing the result of the operation */ @@ -812,14 +812,14 @@ /** * This routine handles the LIR code generation for switch nodes by calling * emitSequentialSwitch. - * + * * This routine overrides LIRGenerator.emitSwitch( ) which calls emitSequentialSwitch or * emitTableSwitch based on a heuristic. - * + * * The recommended approach in HSAIL for generating performant code for switch statements is to * emit a series of cascading compare and branches. Thus this routines always calls * emitSequentialSwitch, which implements this approach. - * + * * Note: Only IntegerSwitchNodes are currently supported. The IntegerSwitchNode is the node that * Graal generates for any switch construct appearing in Java bytecode. */ @@ -832,17 +832,17 @@ * Generates the LIR instruction for a switch construct that is meant to be assembled into a * series of cascading compare and branch instructions. This is currently the recommended way of * generating performant HSAIL code for switch constructs. - * + * * In Java bytecode the keys for switch statements are always ints. - * + * * The x86 backend also adds support for handling keys of type long or Object but these two * special cases are for handling the TypeSwitchNode, which is a node that the JVM produces for * handling operations related to method dispatch. We haven't yet added support for the * TypeSwitchNode, so for the time being we have added a check to ensure that the keys are of * type int. This also allows us to flag any test cases/execution paths that may trigger the * creation of a TypeSwitchNode which we don't support yet. - * - * + * + * * @param strategy the strategy used for this switch. * @param keyTargets array of branch targets for each of the cases. * @param defaultTarget the branch target for the default case. diff -r 2372488fd33f -r 4f5c312d676e graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRGenerator.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRGenerator.java Thu Mar 27 17:47:55 2014 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRGenerator.java Thu Mar 27 18:35:55 2014 +0100 @@ -300,6 +300,8 @@ return null; } + private static final Object LOG_OUTPUT_LOCK = new Object(); + /** * Try to find a sequence of Nodes which can be passed to the backend to look for optimized * instruction sequences using memory. Currently this basically is a read with a single @@ -342,7 +344,7 @@ } } if (Debug.isLogEnabled()) { - synchronized ("lock") { // Hack to ensure the output is grouped. + synchronized (LOG_OUTPUT_LOCK) { // Hack to ensure the output is grouped. try (Indent indent = Debug.logAndIndent("checking operations")) { int start = nodes.indexOf(access); int end = nodes.indexOf(operation); diff -r 2372488fd33f -r 4f5c312d676e graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Thu Mar 27 17:47:55 2014 +0100 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Thu Mar 27 18:35:55 2014 +0100 @@ -90,7 +90,7 @@ /** * Replaces this operation with the appropriate move for saving rbp. - * + * * @param useStack specifies if rbp must be saved to the stack */ public AllocatableValue finalize(boolean useStack) { @@ -153,6 +153,7 @@ return ((AMD64HotSpotLIRGenerationResult) res).getStub() != null; } + @Override public void emitData(AllocatableValue dst, byte[] data) { append(new LeaDataOp(dst, data)); }