/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
// Please refer to "The SPARC Architecture Manual - Version 9"
// format 2, v9 specific "op2" values.
// branch on integer condition codes with prediction
// branch on integer register contents with prediction
// branch on float condition codes with prediction
// "rcond" - branch on register condition
// rcond is 3 bits length
// "rcond" - as used in conditional moves
// various rcond values - used in BPr, MOVr and FMOVr
// reserved register condition
public static final int BRZ =
1;
public static final int BRLEZ =
2;
public static final int BRLZ =
3;
// reserved register condition
public static final int BRNZ =
5;
public static final int BRGZ =
6;
public static final int BRGEZ =
7;
// "p" - prediction bit - predict branch taken or not taken
// branch pc relative displacement - hi 2 bits of disp16.
// disp 16 hi is 2 bits length
// disp 16 low 14 bits
// disp 19 - integer branch with prediction - displacement
/*
* condition code selected for integer branches - cc1 & cc0.
* condition code selected for float branches - cc1 & cc0.
* opf_cc field - floating conditional moves - 3 bits.
* convert 2 bit codes as 3 bit codes always and use following codes
* uniformly.
*/
// opf_cc - 3 bits
public static final int fcc0 =
0;
// 000 public static final int fcc1 =
1;
// 001 public static final int fcc2 =
2;
// 010 public static final int fcc3 =
3;
// 011 public static final int icc =
4;
// 100 public static final int xcc =
6;
// 110
// cc0, cc1 as in integer, float predicted branches
// condition codes for integer branches with prediction - BPcc
// condition codes for float branches with prediction
// "cmask" - 3 bit mask used in membar for completion constraints
// "mmask" - 4 bit mask used in member for ordering instruction classes.
public static final int MMASK_MASK =
0xF;
// no need to shift
// v9 specific load/store instruction opcodes // load/store instructions - op3 values - used with op=3 (FORMAT_3)
public static final int LDUW =
LD;
public static final int LDFA =
LDC;
public static final int LDQF = (
2 <<
4) |
2;
public static final int LDQFA = (
3 <<
4) |
2;
public static final int STW =
ST;
public static final int STWA =
STA;
public static final int STFA =
STC;
public static final int LDSW =
8;
public static final int LDSWA = (
1 <<
4) |
8;
public static final int LDX =
0xB;
public static final int LDXA = (
1 <<
4) |
0xB;
public static final int PREFETCH = (
2 <<
4) |
0xD;
public static final int PREFETCHA = (
3 <<
4) |
0xD;
public static final int CASA = (
3 <<
4) |
0xC;
public static final int STX =
0xE;
public static final int STXA = (
1 <<
4) |
0xE;
public static final int CASXA = (
3 <<
4) |
0xE;
// 6 bit immediate shift count mask
// X bit mask - used to differentiate b/w 32 bit and 64 bit shifts
public static final int X_MASK =
1 <<
12;
// E Opcode maps - Page 274 - Table 32 - op3 (op=2) table
// v9 specific items
public static final int MULX =
9;
public static final int UDIVX =
0xD;
public static final int SLLX =
SLL;
public static final int SRLX =
SRL;
public static final int SRAX =
SRA;
// special register reads
public static final int RDPC =
RDY;
public static final int RDPR = (
2 <<
4) |
0xA;
public static final int FLUSHW = (
2 <<
4) |
0xB;
public static final int MOVcc = (
2 <<
4) |
0xC;
public static final int SDIVX = (
2 <<
4) |
0xD;
public static final int POPC = (
2 <<
4) |
0xE;
public static final int MOVr = (
2 <<
4) |
0xF;
// special regitser writes
public static final int SIR =
WRY;
public static final int SAVED = (
3 <<
4) |
0x1;
public static final int WRPR = (
3 <<
4) |
0x2;
public static final int DONE = (
3 <<
4) |
0xE;
// various integer condition code move instructions
// cc0, cc1 & cc2 in conditional moves
// condition code is 4 bits
// opf[8:0] (op=2,op3=0x34=FPop1) - Table 34 - Page 276 - E Opcode Maps
// v9 specific opcodes only - remaining are in SPARCOpcodes.
public static final int FMOVd =
0x2;
public static final int FMOVq =
0x3;
public static final int FNEGd =
0x6;
public static final int FNEGq =
0x7;
public static final int FABSd =
0xA;
public static final int FABSq =
0xB;
public static final int FsTOx = (
0x8 <<
4) |
0x1;
public static final int FdTOx = (
0x8 <<
4) |
0x2;
public static final int FqTOx = (
0x8 <<
4) |
0x3;
public static final int FxTOs = (
0x8 <<
4) |
0x4;
public static final int FxTOd = (
0x8 <<
4) |
0x8;
public static final int FxTOq = (
0x8 <<
4) |
0xC;
// opf[8:0] (op=2, op3=0x35= FPop2) - Table 35 - Page 277 - E.2 Tables
// v9 specific opcodes only 0 remanining are in SPARCOpcodes.
// fp condition moves
public static final int FMOVs_fcc1 =
1 | (
0x4 <<
4);
public static final int FMOVs_fcc2 =
1 | (
0x8 <<
4);
public static final int FMOVs_fcc3 =
1 | (
0xC <<
4);
public static final int FMOVs_icc =
1 | (
0x10 <<
4);
public static final int FMOVs_xcc =
1 | (
0x18 <<
4);
public static final int FMOVd_fcc1 =
2 | (
0x4 <<
4);
public static final int FMOVd_fcc2 =
2 | (
0x8 <<
4);
public static final int FMOVd_fcc3 =
2 | (
0xC <<
4);
public static final int FMOVd_icc =
2 | (
0x10 <<
4);
public static final int FMOVd_xcc =
2 | (
0x18 <<
4);
public static final int FMOVq_fcc1 =
3 | (
0x4 <<
4);
public static final int FMOVq_fcc2 =
3 | (
0x8 <<
4);
public static final int FMOVq_fcc3 =
3 | (
0xC <<
4);
public static final int FMOVq_icc =
3 | (
0x10 <<
4);
public static final int FMOVq_xcc =
3 | (
0x18 <<
4);
// fp register condition moves
public static final int FMOVRsZ =
5 | (
0x2 <<
4);
public static final int FMOVRsLEZ =
5 | (
0x4 <<
4);
public static final int FMOVRsLZ =
5 | (
0x6 <<
4);
public static final int FMOVRsNZ =
5 | (
0xA <<
4);
public static final int FMOVRsGZ =
5 | (
0xC <<
4);
public static final int FMOVRsGEZ =
5 | (
0xE <<
4);
public static final int FMOVRdZ =
6 | (
0x2 <<
4);
public static final int FMOVRdLEZ =
6 | (
0x4 <<
4);
public static final int FMOVRdLZ =
6 | (
0x6 <<
4);
public static final int FMOVRdNZ =
6 | (
0xA <<
4);
public static final int FMOVRdGZ =
6 | (
0xC <<
4);
public static final int FMOVRdGEZ =
6 | (
0xE <<
4);
public static final int FMOVRqZ =
7 | (
0x2 <<
4);
public static final int FMOVRqLEZ =
7 | (
0x4 <<
4);
public static final int FMOVRqLZ =
7 | (
0x6 <<
4);
public static final int FMOVRqNZ =
7 | (
0xA <<
4);
public static final int FMOVRqGZ =
7 | (
0xC <<
4);
public static final int FMOVRqGEZ =
7 | (
0xE <<
4);
}