hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9InstructionFactoryImpl.java
author trims
Thu, 27 May 2010 19:08:38 -0700
changeset 5547 f4b087cbb361
parent 1 489c9b5090e2
permissions -rw-r--r--
6941466: Oracle rebranding changes for Hotspot repositories Summary: Change all the Sun copyrights to Oracle copyright Reviewed-by: ohair
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
     2
 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
package sun.jvm.hotspot.asm.sparc;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
import sun.jvm.hotspot.asm.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
public class SPARCV9InstructionFactoryImpl extends SPARCInstructionFactoryImpl
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
                      implements SPARCV9InstructionFactory {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
    public SPARCInstruction newUnimpInstruction(int const22) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
        return new SPARCV9IlltrapInstruction(const22);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
    public SPARCInstruction newRettInstruction(SPARCRegisterIndirectAddress addr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
        return new SPARCV9ReturnInstruction(addr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
    public SPARCInstruction newCoprocessorInstruction(int instruction, int cpopcode, int opc,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
                                                     int rs1Num, int rs2Num, int rdNum) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
        return new SPARCV9ImpdepInstruction(cpopcode == SPARCOpcodes.CPop1? "impdep1" : "impdep2");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
    public SPARCInstruction newV9ReadInstruction(int specialRegNum, int asrRegNum, SPARCRegister rd) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
        return new SPARCV9ReadInstruction(specialRegNum, asrRegNum, rd);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
    public SPARCInstruction newV9WriteInstruction(int specialRegNum, int asrRegNum, SPARCRegister rs1,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
                                                  ImmediateOrRegister operand2) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
        return new SPARCV9WriteInstruction(specialRegNum, asrRegNum, rs1, operand2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
    public SPARCInstruction newV9BranchInstruction(String name, PCRelativeAddress addr,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
              boolean isAnnuled, int conditionCode, boolean predictTaken, int conditionFlag) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
        return new SPARCV9BranchInstruction(name, addr, isAnnuled, conditionCode,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
                       predictTaken, conditionFlag);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
    public SPARCInstruction newV9RegisterBranchInstruction(String name, PCRelativeAddress addr,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
                               boolean isAnnuled, int regConditionCode, SPARCRegister conditionRegister,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
                               boolean predictTaken) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
        return new SPARCV9RegisterBranchInstruction(name, addr, isAnnuled, regConditionCode,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
                               conditionRegister, predictTaken);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
    public SPARCInstruction newV9CasInstruction(String name, SPARCRegisterIndirectAddress addr,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
                                              SPARCRegister rs2, SPARCRegister rd, int dataType) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
        return new SPARCV9CasInstruction(name, addr, rs2, rd, dataType);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
    public SPARCInstruction newV9PrefetchInstruction(String name, SPARCRegisterIndirectAddress addr,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
                               int prefetchFcn) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
        return new SPARCV9PrefetchInstruction(name, addr, prefetchFcn);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
    public SPARCInstruction newV9FlushwInstruction() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
        return new SPARCV9FlushwInstruction();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
    public SPARCInstruction newV9MOVccInstruction(String name, int conditionCode, int conditionFlag,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
                                  ImmediateOrRegister source, SPARCRegister rd) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
        return new SPARCV9MOVccInstruction(name, conditionCode, conditionFlag, source, rd);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
    public SPARCInstruction newV9MOVrInstruction(String name, SPARCRegister rs1,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
                                   ImmediateOrRegister operand2, SPARCRegister rd,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
                                   int regConditionCode) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
        return new SPARCV9MOVrInstruction(name, rs1, operand2, rd, regConditionCode);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
    public SPARCInstruction newV9RdprInstruction(int regNum, SPARCRegister rd) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
        return new SPARCV9RdprInstruction(regNum, rd);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
    public SPARCInstruction newV9WrprInstruction(SPARCRegister rs1, ImmediateOrRegister operand2, int regNum) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
        return new SPARCV9WrprInstruction(rs1, operand2, regNum);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
    public SPARCInstruction newV9PopcInstruction(ImmediateOrRegister source, SPARCRegister rd) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
        return new SPARCV9PopcInstruction(source, rd);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
    public SPARCInstruction newV9DoneInstruction() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
        return new SPARCV9DoneInstruction();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
    public SPARCInstruction newV9RetryInstruction() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
        return new SPARCV9RetryInstruction();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
    public SPARCInstruction newV9SavedInstruction() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
        return new SPARCV9SavedInstruction();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
    public SPARCInstruction newV9RestoredInstruction() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
        return new SPARCV9RestoredInstruction();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
    public SPARCInstruction newV9MembarInstruction(int mmask, int cmask) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
        return new SPARCV9MembarInstruction(mmask, cmask);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
    public SPARCInstruction newV9SirInstruction() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
        return new SPARCV9SirInstruction();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
    public SPARCInstruction newV9FMOVccInstruction(String name, int opf,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
                                           int conditionCode, int conditionFlag,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
                                           SPARCFloatRegister rs, SPARCFloatRegister rd) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
        return new SPARCV9FMOVccInstruction(name, opf, conditionCode, conditionFlag, rs, rd);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
    public SPARCInstruction newV9FMOVrInstruction(String name, int opf,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
                                   SPARCRegister rs1, SPARCFloatRegister rs2,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
                                   SPARCFloatRegister rd, int regConditionCode) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
        return new SPARCV9FMOVrInstruction(name, opf, rs1, rs2, rd, regConditionCode);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
}