< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRGenerator.java

Print this page
rev 56282 : [mq]: graal
   1 /*
   2  * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */


 403     protected void emitTableSwitch(int lowKey, LabelRef defaultTarget, LabelRef[] targets, Value key) {
 404         // Making a copy of the switch value is necessary because jump table destroys the input
 405         // value
 406         Variable tmp = newVariable(key.getValueKind());
 407         emitMove(tmp, key);
 408         append(new TableSwitchOp(lowKey, defaultTarget, targets, tmp, newVariable(LIRKind.value(target().arch.getWordKind()))));
 409     }
 410 
 411     protected SPARC getArchitecture() {
 412         return (SPARC) target().arch;
 413     }
 414 
 415     @Override
 416     public Variable emitByteSwap(Value input) {
 417         Variable result = newVariable(LIRKind.combine(input));
 418         append(new SPARCByteSwapOp(this, result, asAllocatable(input)));
 419         return result;
 420     }
 421 
 422     @Override
 423     public Variable emitArrayEquals(JavaKind kind, Value array1, Value array2, Value length, int constantLength, boolean directPointers) {
 424         Variable result = newVariable(LIRKind.value(SPARCKind.WORD));
 425         append(new SPARCArrayEqualsOp(this, kind, result, load(array1), load(array2), asAllocatable(length), directPointers));
 426         return result;
 427     }
 428 
 429     @Override
 430     public void emitMembar(int barriers) {
 431         int necessaryBarriers = target().arch.requiredBarriers(barriers);
 432         if (target().isMP && necessaryBarriers != 0) {
 433             append(new MembarOp(necessaryBarriers));
 434         }
 435     }
 436 
 437     @Override
 438     public void emitDeoptimize(Value actionAndReason, Value speculation, LIRFrameState state) {
 439         append(new ReturnOp(Value.ILLEGAL));
 440     }
 441 
 442     public Value emitSignExtendLoad(LIRKind kind, LIRKind resultKind, Value address, LIRFrameState state) {
 443         SPARCAddressValue loadAddress = asAddressValue(address);


   1 /*
   2  * Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */


 403     protected void emitTableSwitch(int lowKey, LabelRef defaultTarget, LabelRef[] targets, Value key) {
 404         // Making a copy of the switch value is necessary because jump table destroys the input
 405         // value
 406         Variable tmp = newVariable(key.getValueKind());
 407         emitMove(tmp, key);
 408         append(new TableSwitchOp(lowKey, defaultTarget, targets, tmp, newVariable(LIRKind.value(target().arch.getWordKind()))));
 409     }
 410 
 411     protected SPARC getArchitecture() {
 412         return (SPARC) target().arch;
 413     }
 414 
 415     @Override
 416     public Variable emitByteSwap(Value input) {
 417         Variable result = newVariable(LIRKind.combine(input));
 418         append(new SPARCByteSwapOp(this, result, asAllocatable(input)));
 419         return result;
 420     }
 421 
 422     @Override
 423     public Variable emitArrayEquals(JavaKind kind, Value array1, Value array2, Value length, boolean directPointers) {
 424         Variable result = newVariable(LIRKind.value(SPARCKind.WORD));
 425         append(new SPARCArrayEqualsOp(this, kind, result, load(array1), load(array2), asAllocatable(length), directPointers));
 426         return result;
 427     }
 428 
 429     @Override
 430     public void emitMembar(int barriers) {
 431         int necessaryBarriers = target().arch.requiredBarriers(barriers);
 432         if (target().isMP && necessaryBarriers != 0) {
 433             append(new MembarOp(necessaryBarriers));
 434         }
 435     }
 436 
 437     @Override
 438     public void emitDeoptimize(Value actionAndReason, Value speculation, LIRFrameState state) {
 439         append(new ReturnOp(Value.ILLEGAL));
 440     }
 441 
 442     public Value emitSignExtendLoad(LIRKind kind, LIRKind resultKind, Value address, LIRFrameState state) {
 443         SPARCAddressValue loadAddress = asAddressValue(address);


< prev index next >