src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRGenerator.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRGenerator.java	Mon Mar 20 17:37:17 2017
--- new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRGenerator.java	Mon Mar 20 17:37:16 2017

*** 192,202 **** --- 192,202 ---- } @Override public void emitCompareBranch(PlatformKind cmpKind, Value x, Value y, Condition cond, boolean unorderedIsTrue, LabelRef trueDestination, LabelRef falseDestination, double trueDestinationProbability) { ! AllocatableValue left; Value right; Condition actualCondition; if (isJavaConstant(x)) { left = load(y); right = loadNonConst(x);
*** 232,244 **** --- 232,244 ---- } private void emitIntegerTest(Value a, Value b) { assert ((SPARCKind) a.getPlatformKind()).isInteger(); if (LIRValueUtil.isVariable(b)) { ! append(SPARCOP3Op.newBinaryVoid(Op3s.Andcc, load(b), loadNonConst(a))); ! append(SPARCOP3Op.newBinaryVoid(Op3s.Andcc, load(b), loadSimm13(a))); } else { ! append(SPARCOP3Op.newBinaryVoid(Op3s.Andcc, load(a), loadNonConst(b))); ! append(SPARCOP3Op.newBinaryVoid(Op3s.Andcc, load(a), loadSimm13(b))); } } private Value loadSimm11(Value value) { if (isJavaConstant(value)) {
*** 248,257 **** --- 248,267 ---- } } return load(value); } + private Value loadSimm13(Value value) { + if (isJavaConstant(value)) { + JavaConstant c = asJavaConstant(value); + if (c.isNull() || SPARCAssembler.isSimm13(c)) { + return value; + } + } + return load(value); + } + @Override public Variable emitConditionalMove(PlatformKind cmpKind, Value left, Value right, Condition cond, boolean unorderedIsTrue, Value trueValue, Value falseValue) { // Emit compare SPARCKind cmpSPARCKind = (SPARCKind) cmpKind; boolean mirrored = emitCompare(cmpSPARCKind, left, right);
*** 302,329 **** --- 312,339 ---- } private boolean emitIntegerCompare(SPARCKind cmpKind, Value a, Value b) { boolean mirrored; assert cmpKind.isInteger(); ! AllocatableValue left; Value right; if (LIRValueUtil.isVariable(b)) { left = load(b); ! right = loadNonConst(a); ! right = loadSimm13(a); mirrored = true; } else { left = load(a); ! right = loadNonConst(b); ! right = loadSimm13(b); mirrored = false; } int compareBytes = cmpKind.getSizeInBytes(); // SPARC compares 32 or 64 bits if (compareBytes < left.getPlatformKind().getSizeInBytes()) { ! left = arithmeticLIRGen.emitSignExtend(left, compareBytes * 8, XWORD.getSizeInBytes() * 8); ! left = asAllocatable(arithmeticLIRGen.emitSignExtend(left, cmpKind.getSizeInBits(), XWORD.getSizeInBits())); } if (compareBytes < right.getPlatformKind().getSizeInBytes()) { ! right = arithmeticLIRGen.emitSignExtend(right, compareBytes * 8, XWORD.getSizeInBytes() * 8); ! right = arithmeticLIRGen.emitSignExtend(right, cmpKind.getSizeInBits(), XWORD.getSizeInBits()); } append(SPARCOP3Op.newBinaryVoid(Subcc, left, right)); return mirrored; }
*** 363,384 **** --- 373,394 ---- } } @Override public void emitStrategySwitch(SwitchStrategy strategy, Variable key, LabelRef[] keyTargets, LabelRef defaultTarget) { ! AllocatableValue scratchValue = newVariable(key.getValueKind()); ! Variable scratchValue = newVariable(key.getValueKind()); AllocatableValue base = AllocatableValue.ILLEGAL; for (Constant c : strategy.getKeyConstants()) { ! if (!(c instanceof JavaConstant) || !getMoveFactory().canInlineConstant((JavaConstant) c)) { base = constantTableBaseProvider.getConstantTableBase(); break; } } append(createStrategySwitchOp(base, strategy, keyTargets, defaultTarget, key, scratchValue)); } ! protected StrategySwitchOp createStrategySwitchOp(AllocatableValue base, SwitchStrategy strategy, LabelRef[] keyTargets, LabelRef defaultTarget, Variable key, AllocatableValue scratchValue) { ! protected StrategySwitchOp createStrategySwitchOp(AllocatableValue base, SwitchStrategy strategy, LabelRef[] keyTargets, LabelRef defaultTarget, Variable key, Variable scratchValue) { return new StrategySwitchOp(base, strategy, keyTargets, defaultTarget, key, scratchValue); } @Override protected void emitTableSwitch(int lowKey, LabelRef defaultTarget, LabelRef[] targets, Value key) {
*** 394,404 **** --- 404,414 ---- } @Override public Variable emitByteSwap(Value input) { Variable result = newVariable(LIRKind.combine(input)); ! append(new SPARCByteSwapOp(this, result, asAllocatable(input))); return result; } @Override public Variable emitArrayEquals(JavaKind kind, Value array1, Value array2, Value length) {

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRGenerator.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File