hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
author prr
Wed, 15 Apr 2015 14:28:43 -0700
changeset 30465 a77083748efc
parent 24953 9680119572be
child 31404 63e8fcd70bfc
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
24328
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
     2
 * Copyright (c) 1997, 2014, 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: 5542
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5542
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: 5542
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
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7112
diff changeset
    25
#ifndef CPU_SPARC_VM_ASSEMBLER_SPARC_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7112
diff changeset
    26
#define CPU_SPARC_VM_ASSEMBLER_SPARC_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7112
diff changeset
    27
14631
526804361522 8003250: SPARC: move MacroAssembler into separate file
twisti
parents: 13969
diff changeset
    28
#include "asm/register.hpp"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
// The SPARC Assembler: Pure assembler doing NO optimizations on the instruction
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
// level; i.e., what you write
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
// is what you get. The Assembler is generating code into a CodeBuffer.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
class Assembler : public AbstractAssembler  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
  friend class AbstractAssembler;
2571
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 2534
diff changeset
    36
  friend class AddressLiteral;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
  // code patchers need various routines like inv_wdisp()
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
  friend class NativeInstruction;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
  friend class NativeGeneralJump;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
  friend class Relocation;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
  friend class Label;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
  // op carries format info; see page 62 & 267
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  enum ops {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
    call_op   = 1, // fmt 1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
    branch_op = 0, // also sethi (fmt2)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
    arith_op  = 2, // fmt 3, arith & misc
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
    ldst_op   = 3  // fmt 3, load/store
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  enum op2s {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
    bpr_op2   = 3,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
    fb_op2    = 6,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
    fbp_op2   = 5,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
    br_op2    = 2,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
    bp_op2    = 1,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
    sethi_op2 = 4
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  enum op3s {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
    // selected op3s
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
    add_op3      = 0x00,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
    and_op3      = 0x01,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
    or_op3       = 0x02,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
    xor_op3      = 0x03,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
    sub_op3      = 0x04,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
    andn_op3     = 0x05,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
    orn_op3      = 0x06,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
    xnor_op3     = 0x07,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
    addc_op3     = 0x08,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
    mulx_op3     = 0x09,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
    umul_op3     = 0x0a,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
    smul_op3     = 0x0b,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
    subc_op3     = 0x0c,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
    udivx_op3    = 0x0d,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
    udiv_op3     = 0x0e,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
    sdiv_op3     = 0x0f,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
    addcc_op3    = 0x10,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
    andcc_op3    = 0x11,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
    orcc_op3     = 0x12,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
    xorcc_op3    = 0x13,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
    subcc_op3    = 0x14,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
    andncc_op3   = 0x15,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
    orncc_op3    = 0x16,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
    xnorcc_op3   = 0x17,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
    addccc_op3   = 0x18,
22505
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
    91
    aes4_op3     = 0x19,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
    umulcc_op3   = 0x1a,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
    smulcc_op3   = 0x1b,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
    subccc_op3   = 0x1c,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
    udivcc_op3   = 0x1e,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
    sdivcc_op3   = 0x1f,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
    taddcc_op3   = 0x20,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
    tsubcc_op3   = 0x21,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
    taddcctv_op3 = 0x22,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
    tsubcctv_op3 = 0x23,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
    mulscc_op3   = 0x24,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
    sll_op3      = 0x25,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
    sllx_op3     = 0x25,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
    srl_op3      = 0x26,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
    srlx_op3     = 0x26,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
    sra_op3      = 0x27,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
    srax_op3     = 0x27,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
    rdreg_op3    = 0x28,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
    membar_op3   = 0x28,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
    flushw_op3   = 0x2b,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
    movcc_op3    = 0x2c,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
    sdivx_op3    = 0x2d,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
    popc_op3     = 0x2e,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
    movr_op3     = 0x2f,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
    sir_op3      = 0x30,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
    wrreg_op3    = 0x30,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
    saved_op3    = 0x31,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
    fpop1_op3    = 0x34,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
    fpop2_op3    = 0x35,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
    impdep1_op3  = 0x36,
22505
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   125
    aes3_op3     = 0x36,
24953
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 24328
diff changeset
   126
    sha_op3      = 0x36,
24328
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
   127
    alignaddr_op3  = 0x36,
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
   128
    faligndata_op3 = 0x36,
22505
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   129
    flog3_op3    = 0x36,
24328
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
   130
    edge_op3     = 0x36,
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
   131
    fsrc_op3     = 0x36,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
    impdep2_op3  = 0x37,
24328
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
   133
    stpartialf_op3 = 0x37,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
    jmpl_op3     = 0x38,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
    rett_op3     = 0x39,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
    trap_op3     = 0x3a,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
    flush_op3    = 0x3b,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
    save_op3     = 0x3c,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
    restore_op3  = 0x3d,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
    done_op3     = 0x3e,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
    retry_op3    = 0x3e,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
    lduw_op3     = 0x00,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
    ldub_op3     = 0x01,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
    lduh_op3     = 0x02,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
    ldd_op3      = 0x03,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
    stw_op3      = 0x04,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
    stb_op3      = 0x05,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
    sth_op3      = 0x06,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
    std_op3      = 0x07,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
    ldsw_op3     = 0x08,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
    ldsb_op3     = 0x09,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
    ldsh_op3     = 0x0a,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
    ldx_op3      = 0x0b,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
    stx_op3      = 0x0e,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
    swap_op3     = 0x0f,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
    stwa_op3     = 0x14,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
    stxa_op3     = 0x1e,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
    ldf_op3      = 0x20,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
    ldfsr_op3    = 0x21,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
    ldqf_op3     = 0x22,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
    lddf_op3     = 0x23,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
    stf_op3      = 0x24,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
    stfsr_op3    = 0x25,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
    stqf_op3     = 0x26,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
    stdf_op3     = 0x27,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
    prefetch_op3 = 0x2d,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
    casa_op3     = 0x3c,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
    casxa_op3    = 0x3e,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
10027
20cd71f29262 7059034: Use movxtod/movdtox on T4
kvn
parents: 9976
diff changeset
   176
    mftoi_op3    = 0x36,
20cd71f29262 7059034: Use movxtod/movdtox on T4
kvn
parents: 9976
diff changeset
   177
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
    alt_bit_op3  = 0x10,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
     cc_bit_op3  = 0x10
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
  enum opfs {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
    // selected opfs
24328
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
   184
    edge8n_opf         = 0x01,
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
   185
22505
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   186
    fmovs_opf          = 0x01,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   187
    fmovd_opf          = 0x02,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
22505
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   189
    fnegs_opf          = 0x05,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   190
    fnegd_opf          = 0x06,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
24328
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
   192
    alignaddr_opf      = 0x18,
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
   193
22505
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   194
    fadds_opf          = 0x41,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   195
    faddd_opf          = 0x42,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   196
    fsubs_opf          = 0x45,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   197
    fsubd_opf          = 0x46,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
24328
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
   199
    faligndata_opf     = 0x48,
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
   200
22505
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   201
    fmuls_opf          = 0x49,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   202
    fmuld_opf          = 0x4a,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   203
    fdivs_opf          = 0x4d,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   204
    fdivd_opf          = 0x4e,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   205
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   206
    fcmps_opf          = 0x51,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   207
    fcmpd_opf          = 0x52,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
22505
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   209
    fstox_opf          = 0x81,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   210
    fdtox_opf          = 0x82,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   211
    fxtos_opf          = 0x84,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   212
    fxtod_opf          = 0x88,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   213
    fitos_opf          = 0xc4,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   214
    fdtos_opf          = 0xc6,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   215
    fitod_opf          = 0xc8,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   216
    fstod_opf          = 0xc9,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   217
    fstoi_opf          = 0xd1,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   218
    fdtoi_opf          = 0xd2,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
22505
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   220
    mdtox_opf          = 0x110,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   221
    mstouw_opf         = 0x111,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   222
    mstosw_opf         = 0x113,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   223
    mxtod_opf          = 0x118,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   224
    mwtos_opf          = 0x119,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   225
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   226
    aes_kexpand0_opf   = 0x130,
24953
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 24328
diff changeset
   227
    aes_kexpand2_opf   = 0x131,
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 24328
diff changeset
   228
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 24328
diff changeset
   229
    sha1_opf           = 0x141,
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 24328
diff changeset
   230
    sha256_opf         = 0x142,
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 24328
diff changeset
   231
    sha512_opf         = 0x143
22505
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   232
  };
10027
20cd71f29262 7059034: Use movxtod/movdtox on T4
kvn
parents: 9976
diff changeset
   233
22505
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   234
  enum op5s {
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   235
    aes_eround01_op5     = 0x00,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   236
    aes_eround23_op5     = 0x01,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   237
    aes_dround01_op5     = 0x02,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   238
    aes_dround23_op5     = 0x03,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   239
    aes_eround01_l_op5   = 0x04,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   240
    aes_eround23_l_op5   = 0x05,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   241
    aes_dround01_l_op5   = 0x06,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   242
    aes_dround23_l_op5   = 0x07,
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   243
    aes_kexpand1_op5     = 0x08
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
10252
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   246
  enum RCondition {  rc_z = 1,  rc_lez = 2,  rc_lz = 3, rc_nz = 5, rc_gz = 6, rc_gez = 7, rc_last = rc_gez  };
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
  enum Condition {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
     // for FBfcc & FBPfcc instruction
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
    f_never                     = 0,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
    f_notEqual                  = 1,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
    f_notZero                   = 1,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
    f_lessOrGreater             = 2,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
    f_unorderedOrLess           = 3,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
    f_less                      = 4,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
    f_unorderedOrGreater        = 5,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
    f_greater                   = 6,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
    f_unordered                 = 7,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
    f_always                    = 8,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
    f_equal                     = 9,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
    f_zero                      = 9,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
    f_unorderedOrEqual          = 10,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
    f_greaterOrEqual            = 11,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
    f_unorderedOrGreaterOrEqual = 12,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
    f_lessOrEqual               = 13,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
    f_unorderedOrLessOrEqual    = 14,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
    f_ordered                   = 15,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
    // V8 coproc, pp 123 v8 manual
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
    cp_always  = 8,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
    cp_never   = 0,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
    cp_3       = 7,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
    cp_2       = 6,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
    cp_2or3    = 5,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
    cp_1       = 4,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
    cp_1or3    = 3,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
    cp_1or2    = 2,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
    cp_1or2or3 = 1,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
    cp_0       = 9,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
    cp_0or3    = 10,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
    cp_0or2    = 11,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
    cp_0or2or3 = 12,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
    cp_0or1    = 13,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
    cp_0or1or3 = 14,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
    cp_0or1or2 = 15,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
    // for integers
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
    never                 =  0,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
    equal                 =  1,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
    zero                  =  1,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
    lessEqual             =  2,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
    less                  =  3,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
    lessEqualUnsigned     =  4,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
    lessUnsigned          =  5,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
    carrySet              =  5,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
    negative              =  6,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
    overflowSet           =  7,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
    always                =  8,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
    notEqual              =  9,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
    notZero               =  9,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
    greater               =  10,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
    greaterEqual          =  11,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
    greaterUnsigned       =  12,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
    greaterEqualUnsigned  =  13,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
    carryClear            =  13,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
    positive              =  14,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
    overflowClear         =  15
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
  enum CC {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
    icc  = 0,  xcc  = 2,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
    // ptr_cc is the correct condition code for a pointer or intptr_t:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
    ptr_cc = NOT_LP64(icc) LP64_ONLY(xcc),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
    fcc0 = 0,  fcc1 = 1, fcc2 = 2, fcc3 = 3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
  enum PrefetchFcn {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
    severalReads = 0,  oneRead = 1,  severalWritesAndPossiblyReads = 2, oneWrite = 3, page = 4
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
  // Helper functions for groups of instructions
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
  enum Predict { pt = 1, pn = 0 }; // pt = predict taken
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
  enum Membar_mask_bits { // page 184, v9
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
    StoreStore = 1 << 3,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
    LoadStore  = 1 << 2,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
    StoreLoad  = 1 << 1,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
    LoadLoad   = 1 << 0,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
    Sync       = 1 << 6,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
    MemIssue   = 1 << 5,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
    Lookaside  = 1 << 4
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
7892
ff4948f95c49 7011627: C1: call_RT must support targets that don't fit in wdisp30
iveresov
parents: 7700
diff changeset
   340
  static bool is_in_wdisp_range(address a, address b, int nbits) {
ff4948f95c49 7011627: C1: call_RT must support targets that don't fit in wdisp30
iveresov
parents: 7700
diff changeset
   341
    intptr_t d = intptr_t(b) - intptr_t(a);
ff4948f95c49 7011627: C1: call_RT must support targets that don't fit in wdisp30
iveresov
parents: 7700
diff changeset
   342
    return is_simm(d, nbits + 2);
ff4948f95c49 7011627: C1: call_RT must support targets that don't fit in wdisp30
iveresov
parents: 7700
diff changeset
   343
  }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
10252
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   345
  address target_distance(Label& L) {
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   346
    // Assembler::target(L) should be called only when
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   347
    // a branch instruction is emitted since non-bound
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   348
    // labels record current pc() as a branch address.
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   349
    if (L.is_bound()) return target(L);
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   350
    // Return current address for non-bound labels.
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   351
    return pc();
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   352
  }
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   353
6774
a224d6a24120 6991512: G1 barriers fail with 64bit C1
iveresov
parents: 6772
diff changeset
   354
  // test if label is in simm16 range in words (wdisp16).
a224d6a24120 6991512: G1 barriers fail with 64bit C1
iveresov
parents: 6772
diff changeset
   355
  bool is_in_wdisp16_range(Label& L) {
10252
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   356
    return is_in_wdisp_range(target_distance(L), pc(), 16);
7892
ff4948f95c49 7011627: C1: call_RT must support targets that don't fit in wdisp30
iveresov
parents: 7700
diff changeset
   357
  }
ff4948f95c49 7011627: C1: call_RT must support targets that don't fit in wdisp30
iveresov
parents: 7700
diff changeset
   358
  // test if the distance between two addresses fits in simm30 range in words
ff4948f95c49 7011627: C1: call_RT must support targets that don't fit in wdisp30
iveresov
parents: 7700
diff changeset
   359
  static bool is_in_wdisp30_range(address a, address b) {
ff4948f95c49 7011627: C1: call_RT must support targets that don't fit in wdisp30
iveresov
parents: 7700
diff changeset
   360
    return is_in_wdisp_range(a, b, 30);
6774
a224d6a24120 6991512: G1 barriers fail with 64bit C1
iveresov
parents: 6772
diff changeset
   361
  }
a224d6a24120 6991512: G1 barriers fail with 64bit C1
iveresov
parents: 6772
diff changeset
   362
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   363
  enum ASIs { // page 72, v9
10501
5bce84af0883 7059037: Use BIS for zeroing on T4
kvn
parents: 10267
diff changeset
   364
    ASI_PRIMARY            = 0x80,
5bce84af0883 7059037: Use BIS for zeroing on T4
kvn
parents: 10267
diff changeset
   365
    ASI_PRIMARY_NOFAULT    = 0x82,
5bce84af0883 7059037: Use BIS for zeroing on T4
kvn
parents: 10267
diff changeset
   366
    ASI_PRIMARY_LITTLE     = 0x88,
24328
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
   367
    // 8x8-bit partial store
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
   368
    ASI_PST8_PRIMARY       = 0xC0,
10267
8bdeec886dc4 7079329: Adjust allocation prefetching for T4
kvn
parents: 10264
diff changeset
   369
    // Block initializing store
8bdeec886dc4 7079329: Adjust allocation prefetching for T4
kvn
parents: 10264
diff changeset
   370
    ASI_ST_BLKINIT_PRIMARY = 0xE2,
8bdeec886dc4 7079329: Adjust allocation prefetching for T4
kvn
parents: 10264
diff changeset
   371
    // Most-Recently-Used (MRU) BIS variant
8bdeec886dc4 7079329: Adjust allocation prefetching for T4
kvn
parents: 10264
diff changeset
   372
    ASI_ST_BLKINIT_MRU_PRIMARY = 0xF2
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   373
    // add more from book as needed
489c9b5090e2 Initial load
duke
parents:
diff changeset
   374
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
489c9b5090e2 Initial load
duke
parents:
diff changeset
   376
 protected:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   377
  // helpers
489c9b5090e2 Initial load
duke
parents:
diff changeset
   378
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
  // x is supposed to fit in a field "nbits" wide
489c9b5090e2 Initial load
duke
parents:
diff changeset
   380
  // and be sign-extended. Check the range.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
489c9b5090e2 Initial load
duke
parents:
diff changeset
   382
  static void assert_signed_range(intptr_t x, int nbits) {
9976
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents: 9176
diff changeset
   383
    assert(nbits == 32 || (-(1 << nbits-1) <= x  &&  x < ( 1 << nbits-1)),
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents: 9176
diff changeset
   384
           err_msg("value out of range: x=" INTPTR_FORMAT ", nbits=%d", x, nbits));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   385
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
  static void assert_signed_word_disp_range(intptr_t x, int nbits) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   388
    assert( (x & 3) == 0, "not word aligned");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   389
    assert_signed_range(x, nbits + 2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   390
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
489c9b5090e2 Initial load
duke
parents:
diff changeset
   392
  static void assert_unsigned_const(int x, int nbits) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
    assert( juint(x)  <  juint(1 << nbits), "unsigned constant out of range");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
  // fields: note bits numbered from LSB = 0,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   397
  //  fields known by inclusive bit range
489c9b5090e2 Initial load
duke
parents:
diff changeset
   398
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
  static int fmask(juint hi_bit, juint lo_bit) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   400
    assert( hi_bit >= lo_bit  &&  0 <= lo_bit  &&  hi_bit < 32, "bad bits");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   401
    return (1 << ( hi_bit-lo_bit + 1 )) - 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   402
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   403
489c9b5090e2 Initial load
duke
parents:
diff changeset
   404
  // inverse of u_field
489c9b5090e2 Initial load
duke
parents:
diff changeset
   405
489c9b5090e2 Initial load
duke
parents:
diff changeset
   406
  static int inv_u_field(int x, int hi_bit, int lo_bit) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   407
    juint r = juint(x) >> lo_bit;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   408
    r &= fmask( hi_bit, lo_bit);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   409
    return int(r);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   410
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   411
489c9b5090e2 Initial load
duke
parents:
diff changeset
   412
489c9b5090e2 Initial load
duke
parents:
diff changeset
   413
  // signed version: extract from field and sign-extend
489c9b5090e2 Initial load
duke
parents:
diff changeset
   414
489c9b5090e2 Initial load
duke
parents:
diff changeset
   415
  static int inv_s_field(int x, int hi_bit, int lo_bit) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   416
    int sign_shift = 31 - hi_bit;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   417
    return inv_u_field( ((x << sign_shift) >> sign_shift), hi_bit, lo_bit);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   418
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   419
489c9b5090e2 Initial load
duke
parents:
diff changeset
   420
  // given a field that ranges from hi_bit to lo_bit (inclusive,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   421
  // LSB = 0), and an unsigned value for the field,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   422
  // shift it into the field
489c9b5090e2 Initial load
duke
parents:
diff changeset
   423
489c9b5090e2 Initial load
duke
parents:
diff changeset
   424
#ifdef ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   425
  static int u_field(int x, int hi_bit, int lo_bit) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   426
    assert( ( x & ~fmask(hi_bit, lo_bit))  == 0,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   427
            "value out of range");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   428
    int r = x << lo_bit;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   429
    assert( inv_u_field(r, hi_bit, lo_bit) == x, "just checking");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   430
    return r;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   431
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   432
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   433
  // make sure this is inlined as it will reduce code size significantly
489c9b5090e2 Initial load
duke
parents:
diff changeset
   434
  #define u_field(x, hi_bit, lo_bit)   ((x) << (lo_bit))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   435
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   436
489c9b5090e2 Initial load
duke
parents:
diff changeset
   437
  static int inv_op(  int x ) { return inv_u_field(x, 31, 30); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   438
  static int inv_op2( int x ) { return inv_u_field(x, 24, 22); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   439
  static int inv_op3( int x ) { return inv_u_field(x, 24, 19); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   440
  static int inv_cond( int x ){ return inv_u_field(x, 28, 25); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   441
489c9b5090e2 Initial load
duke
parents:
diff changeset
   442
  static bool inv_immed( int x ) { return (x & Assembler::immed(true)) != 0; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   443
489c9b5090e2 Initial load
duke
parents:
diff changeset
   444
  static Register inv_rd(  int x ) { return as_Register(inv_u_field(x, 29, 25)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   445
  static Register inv_rs1( int x ) { return as_Register(inv_u_field(x, 18, 14)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   446
  static Register inv_rs2( int x ) { return as_Register(inv_u_field(x,  4,  0)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   447
489c9b5090e2 Initial load
duke
parents:
diff changeset
   448
  static int op(       int         x)  { return  u_field(x,             31, 30); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   449
  static int rd(       Register    r)  { return  u_field(r->encoding(), 29, 25); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   450
  static int fcn(      int         x)  { return  u_field(x,             29, 25); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   451
  static int op3(      int         x)  { return  u_field(x,             24, 19); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   452
  static int rs1(      Register    r)  { return  u_field(r->encoding(), 18, 14); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   453
  static int rs2(      Register    r)  { return  u_field(r->encoding(),  4,  0); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   454
  static int annul(    bool        a)  { return  u_field(a ? 1 : 0,     29, 29); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   455
  static int cond(     int         x)  { return  u_field(x,             28, 25); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   456
  static int cond_mov( int         x)  { return  u_field(x,             17, 14); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   457
  static int rcond(    RCondition  x)  { return  u_field(x,             12, 10); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   458
  static int op2(      int         x)  { return  u_field(x,             24, 22); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   459
  static int predict(  bool        p)  { return  u_field(p ? 1 : 0,     19, 19); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   460
  static int branchcc( CC       fcca)  { return  u_field(fcca,          21, 20); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   461
  static int cmpcc(    CC       fcca)  { return  u_field(fcca,          26, 25); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   462
  static int imm_asi(  int         x)  { return  u_field(x,             12,  5); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   463
  static int immed(    bool        i)  { return  u_field(i ? 1 : 0,     13, 13); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   464
  static int opf_low6( int         w)  { return  u_field(w,             10,  5); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   465
  static int opf_low5( int         w)  { return  u_field(w,              9,  5); }
22505
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   466
  static int op5(      int         x)  { return  u_field(x,              8,  5); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   467
  static int trapcc(   CC         cc)  { return  u_field(cc,            12, 11); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   468
  static int sx(       int         i)  { return  u_field(i,             12, 12); } // shift x=1 means 64-bit
489c9b5090e2 Initial load
duke
parents:
diff changeset
   469
  static int opf(      int         x)  { return  u_field(x,             13,  5); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   470
10252
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   471
  static bool is_cbcond( int x ) {
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   472
    return (VM_Version::has_cbcond() && (inv_cond(x) > rc_last) &&
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   473
            inv_op(x) == branch_op && inv_op2(x) == bpr_op2);
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   474
  }
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   475
  static bool is_cxb( int x ) {
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   476
    assert(is_cbcond(x), "wrong instruction");
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   477
    return (x & (1<<21)) != 0;
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   478
  }
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   479
  static int cond_cbcond( int         x)  { return  u_field((((x & 8)<<1) + 8 + (x & 7)), 29, 25); }
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   480
  static int inv_cond_cbcond(int      x)  {
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   481
    assert(is_cbcond(x), "wrong instruction");
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   482
    return inv_u_field(x, 27, 25) | (inv_u_field(x, 29, 29)<<3);
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   483
  }
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   484
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   485
  static int opf_cc(   CC          c, bool useFloat ) { return u_field((useFloat ? 0 : 4) + c, 13, 11); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   486
  static int mov_cc(   CC          c, bool useFloat ) { return u_field(useFloat ? 0 : 1,  18, 18) | u_field(c, 12, 11); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   487
489c9b5090e2 Initial load
duke
parents:
diff changeset
   488
  static int fd( FloatRegister r,  FloatRegisterImpl::Width fwa) { return u_field(r->encoding(fwa), 29, 25); };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   489
  static int fs1(FloatRegister r,  FloatRegisterImpl::Width fwa) { return u_field(r->encoding(fwa), 18, 14); };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   490
  static int fs2(FloatRegister r,  FloatRegisterImpl::Width fwa) { return u_field(r->encoding(fwa),  4,  0); };
22505
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   491
  static int fs3(FloatRegister r,  FloatRegisterImpl::Width fwa) { return u_field(r->encoding(fwa), 13,  9); };
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   492
489c9b5090e2 Initial load
duke
parents:
diff changeset
   493
  // some float instructions use this encoding on the op3 field
489c9b5090e2 Initial load
duke
parents:
diff changeset
   494
  static int alt_op3(int op, FloatRegisterImpl::Width w) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   495
    int r;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   496
    switch(w) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   497
     case FloatRegisterImpl::S: r = op + 0;  break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   498
     case FloatRegisterImpl::D: r = op + 3;  break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   499
     case FloatRegisterImpl::Q: r = op + 2;  break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   500
     default: ShouldNotReachHere(); break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   501
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   502
    return op3(r);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   503
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   504
489c9b5090e2 Initial load
duke
parents:
diff changeset
   505
489c9b5090e2 Initial load
duke
parents:
diff changeset
   506
  // compute inverse of simm
489c9b5090e2 Initial load
duke
parents:
diff changeset
   507
  static int inv_simm(int x, int nbits) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   508
    return (int)(x << (32 - nbits)) >> (32 - nbits);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   509
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   510
489c9b5090e2 Initial load
duke
parents:
diff changeset
   511
  static int inv_simm13( int x ) { return inv_simm(x, 13); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   512
489c9b5090e2 Initial load
duke
parents:
diff changeset
   513
  // signed immediate, in low bits, nbits long
489c9b5090e2 Initial load
duke
parents:
diff changeset
   514
  static int simm(int x, int nbits) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   515
    assert_signed_range(x, nbits);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   516
    return x  &  (( 1 << nbits ) - 1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   517
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   518
489c9b5090e2 Initial load
duke
parents:
diff changeset
   519
  // compute inverse of wdisp16
489c9b5090e2 Initial load
duke
parents:
diff changeset
   520
  static intptr_t inv_wdisp16(int x, intptr_t pos) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   521
    int lo = x & (( 1 << 14 ) - 1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   522
    int hi = (x >> 20) & 3;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   523
    if (hi >= 2) hi |= ~1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   524
    return (((hi << 14) | lo) << 2) + pos;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   525
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   526
489c9b5090e2 Initial load
duke
parents:
diff changeset
   527
  // word offset, 14 bits at LSend, 2 bits at B21, B20
489c9b5090e2 Initial load
duke
parents:
diff changeset
   528
  static int wdisp16(intptr_t x, intptr_t off) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   529
    intptr_t xx = x - off;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   530
    assert_signed_word_disp_range(xx, 16);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   531
    int r =  (xx >> 2) & ((1 << 14) - 1)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   532
           |  (  ( (xx>>(2+14)) & 3 )  <<  20 );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   533
    assert( inv_wdisp16(r, off) == x,  "inverse is not inverse");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   534
    return r;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   535
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   536
10252
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   537
  // compute inverse of wdisp10
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   538
  static intptr_t inv_wdisp10(int x, intptr_t pos) {
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   539
    assert(is_cbcond(x), "wrong instruction");
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   540
    int lo = inv_u_field(x, 12, 5);
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   541
    int hi = (x >> 19) & 3;
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   542
    if (hi >= 2) hi |= ~1;
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   543
    return (((hi << 8) | lo) << 2) + pos;
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   544
  }
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   545
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   546
  // word offset for cbcond, 8 bits at [B12,B5], 2 bits at [B20,B19]
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   547
  static int wdisp10(intptr_t x, intptr_t off) {
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   548
    assert(VM_Version::has_cbcond(), "This CPU does not have CBCOND instruction");
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   549
    intptr_t xx = x - off;
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   550
    assert_signed_word_disp_range(xx, 10);
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   551
    int r =  ( ( (xx >>  2   ) & ((1 << 8) - 1) ) <<  5 )
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   552
           | ( ( (xx >> (2+8)) & 3              ) << 19 );
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   553
    // Have to fake cbcond instruction to pass assert in inv_wdisp10()
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   554
    assert(inv_wdisp10((r | op(branch_op) | cond_cbcond(rc_last+1) | op2(bpr_op2)), off) == x,  "inverse is not inverse");
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   555
    return r;
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   556
  }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   557
489c9b5090e2 Initial load
duke
parents:
diff changeset
   558
  // word displacement in low-order nbits bits
489c9b5090e2 Initial load
duke
parents:
diff changeset
   559
489c9b5090e2 Initial load
duke
parents:
diff changeset
   560
  static intptr_t inv_wdisp( int x, intptr_t pos, int nbits ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   561
    int pre_sign_extend = x & (( 1 << nbits ) - 1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   562
    int r =  pre_sign_extend >= ( 1 << (nbits-1) )
489c9b5090e2 Initial load
duke
parents:
diff changeset
   563
       ?   pre_sign_extend | ~(( 1 << nbits ) - 1)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   564
       :   pre_sign_extend;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   565
    return (r << 2) + pos;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   566
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   567
489c9b5090e2 Initial load
duke
parents:
diff changeset
   568
  static int wdisp( intptr_t x, intptr_t off, int nbits ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   569
    intptr_t xx = x - off;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   570
    assert_signed_word_disp_range(xx, nbits);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   571
    int r =  (xx >> 2) & (( 1 << nbits ) - 1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   572
    assert( inv_wdisp( r, off, nbits )  ==  x, "inverse not inverse");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   573
    return r;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   574
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   575
489c9b5090e2 Initial load
duke
parents:
diff changeset
   576
489c9b5090e2 Initial load
duke
parents:
diff changeset
   577
  // Extract the top 32 bits in a 64 bit word
489c9b5090e2 Initial load
duke
parents:
diff changeset
   578
  static int32_t hi32( int64_t x ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   579
    int32_t r = int32_t( (uint64_t)x >> 32 );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   580
    return r;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   581
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   582
489c9b5090e2 Initial load
duke
parents:
diff changeset
   583
  // given a sethi instruction, extract the constant, left-justified
489c9b5090e2 Initial load
duke
parents:
diff changeset
   584
  static int inv_hi22( int x ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   585
    return x << 10;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   586
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   587
489c9b5090e2 Initial load
duke
parents:
diff changeset
   588
  // create an imm22 field, given a 32-bit left-justified constant
489c9b5090e2 Initial load
duke
parents:
diff changeset
   589
  static int hi22( int x ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   590
    int r = int( juint(x) >> 10 );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   591
    assert( (r & ~((1 << 22) - 1))  ==  0, "just checkin'");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   592
    return r;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   593
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   594
489c9b5090e2 Initial load
duke
parents:
diff changeset
   595
  // create a low10 __value__ (not a field) for a given a 32-bit constant
489c9b5090e2 Initial load
duke
parents:
diff changeset
   596
  static int low10( int x ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   597
    return x & ((1 << 10) - 1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   598
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   599
22505
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   600
  // AES crypto instructions supported only on certain processors
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   601
  static void aes_only() { assert( VM_Version::has_aes(), "This instruction only works on SPARC with AES instructions support"); }
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   602
24953
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 24328
diff changeset
   603
  // SHA crypto instructions supported only on certain processors
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 24328
diff changeset
   604
  static void sha1_only()   { assert( VM_Version::has_sha1(),   "This instruction only works on SPARC with SHA1"); }
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 24328
diff changeset
   605
  static void sha256_only() { assert( VM_Version::has_sha256(), "This instruction only works on SPARC with SHA256"); }
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 24328
diff changeset
   606
  static void sha512_only() { assert( VM_Version::has_sha512(), "This instruction only works on SPARC with SHA512"); }
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 24328
diff changeset
   607
22505
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   608
  // instruction only in VIS1
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   609
  static void vis1_only() { assert( VM_Version::has_vis1(), "This instruction only works on SPARC with VIS1"); }
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   610
24328
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
   611
  // instruction only in VIS2
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
   612
  static void vis2_only() { assert( VM_Version::has_vis2(), "This instruction only works on SPARC with VIS2"); }
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
   613
10027
20cd71f29262 7059034: Use movxtod/movdtox on T4
kvn
parents: 9976
diff changeset
   614
  // instruction only in VIS3
20cd71f29262 7059034: Use movxtod/movdtox on T4
kvn
parents: 9976
diff changeset
   615
  static void vis3_only() { assert( VM_Version::has_vis3(), "This instruction only works on SPARC with VIS3"); }
20cd71f29262 7059034: Use movxtod/movdtox on T4
kvn
parents: 9976
diff changeset
   616
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   617
  // instruction only in v9
18097
acd70736bd60 8008407: remove SPARC V8 support
morris
parents: 15116
diff changeset
   618
  static void v9_only() { } // do nothing
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   619
489c9b5090e2 Initial load
duke
parents:
diff changeset
   620
  // instruction deprecated in v9
489c9b5090e2 Initial load
duke
parents:
diff changeset
   621
  static void v9_dep()  { } // do nothing for now
489c9b5090e2 Initial load
duke
parents:
diff changeset
   622
489c9b5090e2 Initial load
duke
parents:
diff changeset
   623
  // v8 has no CC field
489c9b5090e2 Initial load
duke
parents:
diff changeset
   624
  static void v8_no_cc(CC cc)  { if (cc)  v9_only(); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   625
489c9b5090e2 Initial load
duke
parents:
diff changeset
   626
 protected:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   627
  // Simple delay-slot scheme:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   628
  // In order to check the programmer, the assembler keeps track of deley slots.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   629
  // It forbids CTIs in delay slots (conservative, but should be OK).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   630
  // Also, when putting an instruction into a delay slot, you must say
489c9b5090e2 Initial load
duke
parents:
diff changeset
   631
  // asm->delayed()->add(...), in order to check that you don't omit
489c9b5090e2 Initial load
duke
parents:
diff changeset
   632
  // delay-slot instructions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   633
  // To implement this, we use a simple FSA
489c9b5090e2 Initial load
duke
parents:
diff changeset
   634
489c9b5090e2 Initial load
duke
parents:
diff changeset
   635
#ifdef ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   636
  #define CHECK_DELAY
489c9b5090e2 Initial load
duke
parents:
diff changeset
   637
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   638
#ifdef CHECK_DELAY
489c9b5090e2 Initial load
duke
parents:
diff changeset
   639
  enum Delay_state { no_delay, at_delay_slot, filling_delay_slot } delay_state;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   640
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   641
489c9b5090e2 Initial load
duke
parents:
diff changeset
   642
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   643
  // Tells assembler next instruction must NOT be in delay slot.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   644
  // Use at start of multinstruction macros.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   645
  void assert_not_delayed() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   646
    // This is a separate overloading to avoid creation of string constants
489c9b5090e2 Initial load
duke
parents:
diff changeset
   647
    // in non-asserted code--with some compilers this pollutes the object code.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   648
#ifdef CHECK_DELAY
489c9b5090e2 Initial load
duke
parents:
diff changeset
   649
    assert_not_delayed("next instruction should not be a delay slot");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   650
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   651
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   652
  void assert_not_delayed(const char* msg) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   653
#ifdef CHECK_DELAY
5403
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 4009
diff changeset
   654
    assert(delay_state == no_delay, msg);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   655
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   656
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   657
489c9b5090e2 Initial load
duke
parents:
diff changeset
   658
 protected:
24008
da7059252295 8038297: Avoid placing CTI immediately following cbcond instruction on T4
iveresov
parents: 22505
diff changeset
   659
  // Insert a nop if the previous is cbcond
da7059252295 8038297: Avoid placing CTI immediately following cbcond instruction on T4
iveresov
parents: 22505
diff changeset
   660
  void insert_nop_after_cbcond() {
da7059252295 8038297: Avoid placing CTI immediately following cbcond instruction on T4
iveresov
parents: 22505
diff changeset
   661
    if (UseCBCond && cbcond_before()) {
da7059252295 8038297: Avoid placing CTI immediately following cbcond instruction on T4
iveresov
parents: 22505
diff changeset
   662
      nop();
da7059252295 8038297: Avoid placing CTI immediately following cbcond instruction on T4
iveresov
parents: 22505
diff changeset
   663
    }
da7059252295 8038297: Avoid placing CTI immediately following cbcond instruction on T4
iveresov
parents: 22505
diff changeset
   664
  }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   665
  // Delay slot helpers
489c9b5090e2 Initial load
duke
parents:
diff changeset
   666
  // cti is called when emitting control-transfer instruction,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   667
  // BEFORE doing the emitting.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   668
  // Only effective when assertion-checking is enabled.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   669
  void cti() {
24008
da7059252295 8038297: Avoid placing CTI immediately following cbcond instruction on T4
iveresov
parents: 22505
diff changeset
   670
    // A cbcond instruction immediately followed by a CTI
da7059252295 8038297: Avoid placing CTI immediately following cbcond instruction on T4
iveresov
parents: 22505
diff changeset
   671
    // instruction introduces pipeline stalls, we need to avoid that.
da7059252295 8038297: Avoid placing CTI immediately following cbcond instruction on T4
iveresov
parents: 22505
diff changeset
   672
    no_cbcond_before();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   673
#ifdef CHECK_DELAY
489c9b5090e2 Initial load
duke
parents:
diff changeset
   674
    assert_not_delayed("cti should not be in delay slot");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   675
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   676
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   677
489c9b5090e2 Initial load
duke
parents:
diff changeset
   678
  // called when emitting cti with a delay slot, AFTER emitting
489c9b5090e2 Initial load
duke
parents:
diff changeset
   679
  void has_delay_slot() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   680
#ifdef CHECK_DELAY
489c9b5090e2 Initial load
duke
parents:
diff changeset
   681
    assert_not_delayed("just checking");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   682
    delay_state = at_delay_slot;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   683
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   684
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   685
10252
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   686
  // cbcond instruction should not be generated one after an other
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   687
  bool cbcond_before() {
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   688
    if (offset() == 0) return false; // it is first instruction
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   689
    int x = *(int*)(intptr_t(pc()) - 4); // previous instruction
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   690
    return is_cbcond(x);
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   691
  }
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   692
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   693
  void no_cbcond_before() {
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   694
    assert(offset() == 0 || !cbcond_before(), "cbcond should not follow an other cbcond");
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   695
  }
10264
6879f93d268d 7063629: use cbcond in C2 generated code on T4
kvn
parents: 10252
diff changeset
   696
public:
6879f93d268d 7063629: use cbcond in C2 generated code on T4
kvn
parents: 10252
diff changeset
   697
10252
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   698
  bool use_cbcond(Label& L) {
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   699
    if (!UseCBCond || cbcond_before()) return false;
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   700
    intptr_t x = intptr_t(target_distance(L)) - intptr_t(pc());
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   701
    assert( (x & 3) == 0, "not word aligned");
11190
d561d41f241a 7003454: order constants in constant table by number of references in code
twisti
parents: 10519
diff changeset
   702
    return is_simm12(x);
10252
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   703
  }
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   704
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   705
  // Tells assembler you know that next instruction is delayed
489c9b5090e2 Initial load
duke
parents:
diff changeset
   706
  Assembler* delayed() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   707
#ifdef CHECK_DELAY
489c9b5090e2 Initial load
duke
parents:
diff changeset
   708
    assert ( delay_state == at_delay_slot, "delayed instruction is not in delay slot");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   709
    delay_state = filling_delay_slot;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   710
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   711
    return this;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   712
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   713
489c9b5090e2 Initial load
duke
parents:
diff changeset
   714
  void flush() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   715
#ifdef CHECK_DELAY
489c9b5090e2 Initial load
duke
parents:
diff changeset
   716
    assert ( delay_state == no_delay, "ending code with a delay slot");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   717
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   718
    AbstractAssembler::flush();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   719
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   720
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   721
  inline void emit_int32(int);  // shadows AbstractAssembler::emit_int32
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   722
  inline void emit_data(int x) { emit_int32(x); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   723
  inline void emit_data(int, RelocationHolder const&);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   724
  inline void emit_data(int, relocInfo::relocType rtype);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   725
  // helper for above fcns
489c9b5090e2 Initial load
duke
parents:
diff changeset
   726
  inline void check_delay();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   727
489c9b5090e2 Initial load
duke
parents:
diff changeset
   728
489c9b5090e2 Initial load
duke
parents:
diff changeset
   729
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   730
  // instructions, refer to page numbers in the SPARC Architecture Manual, V9
489c9b5090e2 Initial load
duke
parents:
diff changeset
   731
489c9b5090e2 Initial load
duke
parents:
diff changeset
   732
  // pp 135 (addc was addx in v8)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   733
2571
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 2534
diff changeset
   734
  inline void add(Register s1, Register s2, Register d );
14631
526804361522 8003250: SPARC: move MacroAssembler into separate file
twisti
parents: 13969
diff changeset
   735
  inline void add(Register s1, int simm13a, Register d );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   736
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   737
  void addcc(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3  | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   738
  void addcc(  Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3  | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   739
  void addc(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3             ) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   740
  void addc(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   741
  void addccc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   742
  void addccc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   743
10252
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   744
22505
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   745
  // 4-operand AES instructions
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   746
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   747
  void aes_eround01(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_eround01_op5) | fs2(s2, FloatRegisterImpl::D) ); }
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   748
  void aes_eround23(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_eround23_op5) | fs2(s2, FloatRegisterImpl::D) ); }
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   749
  void aes_dround01(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_dround01_op5) | fs2(s2, FloatRegisterImpl::D) ); }
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   750
  void aes_dround23(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_dround23_op5) | fs2(s2, FloatRegisterImpl::D) ); }
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   751
  void aes_eround01_l(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_eround01_l_op5) | fs2(s2, FloatRegisterImpl::D) ); }
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   752
  void aes_eround23_l(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_eround23_l_op5) | fs2(s2, FloatRegisterImpl::D) ); }
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   753
  void aes_dround01_l(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_dround01_l_op5) | fs2(s2, FloatRegisterImpl::D) ); }
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   754
  void aes_dround23_l(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_dround23_l_op5) | fs2(s2, FloatRegisterImpl::D) ); }
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   755
  void aes_kexpand1(  FloatRegister s1, FloatRegister s2, int imm5a, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | u_field(imm5a, 13, 9) | op5(aes_kexpand1_op5) | fs2(s2, FloatRegisterImpl::D) ); }
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   756
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   757
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   758
  // 3-operand AES instructions
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   759
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   760
  void aes_kexpand0(  FloatRegister s1, FloatRegister s2, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes3_op3) | fs1(s1, FloatRegisterImpl::D) | opf(aes_kexpand0_opf) | fs2(s2, FloatRegisterImpl::D) ); }
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   761
  void aes_kexpand2(  FloatRegister s1, FloatRegister s2, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes3_op3) | fs1(s1, FloatRegisterImpl::D) | opf(aes_kexpand2_opf) | fs2(s2, FloatRegisterImpl::D) ); }
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   762
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   763
  // pp 136
489c9b5090e2 Initial load
duke
parents:
diff changeset
   764
10252
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   765
  inline void bpr(RCondition c, bool a, Predict p, Register s1, address d, relocInfo::relocType rt = relocInfo::none);
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   766
  inline void bpr(RCondition c, bool a, Predict p, Register s1, Label& L);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   767
10264
6879f93d268d 7063629: use cbcond in C2 generated code on T4
kvn
parents: 10252
diff changeset
   768
  // compare and branch
6879f93d268d 7063629: use cbcond in C2 generated code on T4
kvn
parents: 10252
diff changeset
   769
  inline void cbcond(Condition c, CC cc, Register s1, Register s2, Label& L);
6879f93d268d 7063629: use cbcond in C2 generated code on T4
kvn
parents: 10252
diff changeset
   770
  inline void cbcond(Condition c, CC cc, Register s1, int simm5, Label& L);
6879f93d268d 7063629: use cbcond in C2 generated code on T4
kvn
parents: 10252
diff changeset
   771
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   772
 protected: // use MacroAssembler::br instead
489c9b5090e2 Initial load
duke
parents:
diff changeset
   773
489c9b5090e2 Initial load
duke
parents:
diff changeset
   774
  // pp 138
489c9b5090e2 Initial load
duke
parents:
diff changeset
   775
489c9b5090e2 Initial load
duke
parents:
diff changeset
   776
  inline void fb( Condition c, bool a, address d, relocInfo::relocType rt = relocInfo::none );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   777
  inline void fb( Condition c, bool a, Label& L );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   778
489c9b5090e2 Initial load
duke
parents:
diff changeset
   779
  // pp 141
489c9b5090e2 Initial load
duke
parents:
diff changeset
   780
489c9b5090e2 Initial load
duke
parents:
diff changeset
   781
  inline void fbp( Condition c, bool a, CC cc, Predict p, address d, relocInfo::relocType rt = relocInfo::none );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   782
  inline void fbp( Condition c, bool a, CC cc, Predict p, Label& L );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   783
489c9b5090e2 Initial load
duke
parents:
diff changeset
   784
  // pp 144
489c9b5090e2 Initial load
duke
parents:
diff changeset
   785
489c9b5090e2 Initial load
duke
parents:
diff changeset
   786
  inline void br( Condition c, bool a, address d, relocInfo::relocType rt = relocInfo::none );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   787
  inline void br( Condition c, bool a, Label& L );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   788
489c9b5090e2 Initial load
duke
parents:
diff changeset
   789
  // pp 146
489c9b5090e2 Initial load
duke
parents:
diff changeset
   790
489c9b5090e2 Initial load
duke
parents:
diff changeset
   791
  inline void bp( Condition c, bool a, CC cc, Predict p, address d, relocInfo::relocType rt = relocInfo::none );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   792
  inline void bp( Condition c, bool a, CC cc, Predict p, Label& L );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   793
489c9b5090e2 Initial load
duke
parents:
diff changeset
   794
  // pp 149
489c9b5090e2 Initial load
duke
parents:
diff changeset
   795
489c9b5090e2 Initial load
duke
parents:
diff changeset
   796
  inline void call( address d,  relocInfo::relocType rt = relocInfo::runtime_call_type );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   797
  inline void call( Label& L,   relocInfo::relocType rt = relocInfo::runtime_call_type );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   798
10252
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   799
 public:
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 10027
diff changeset
   800
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   801
  // pp 150
489c9b5090e2 Initial load
duke
parents:
diff changeset
   802
489c9b5090e2 Initial load
duke
parents:
diff changeset
   803
  // These instructions compare the contents of s2 with the contents of
489c9b5090e2 Initial load
duke
parents:
diff changeset
   804
  // memory at address in s1. If the values are equal, the contents of memory
489c9b5090e2 Initial load
duke
parents:
diff changeset
   805
  // at address s1 is swapped with the data in d. If the values are not equal,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   806
  // the the contents of memory at s1 is loaded into d, without the swap.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   807
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   808
  void casa(  Register s1, Register s2, Register d, int ia = -1 ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(casa_op3 ) | rs1(s1) | (ia == -1  ? immed(true) : imm_asi(ia)) | rs2(s2)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   809
  void casxa( Register s1, Register s2, Register d, int ia = -1 ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(casxa_op3) | rs1(s1) | (ia == -1  ? immed(true) : imm_asi(ia)) | rs2(s2)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   810
489c9b5090e2 Initial load
duke
parents:
diff changeset
   811
  // pp 152
489c9b5090e2 Initial load
duke
parents:
diff changeset
   812
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   813
  void udiv(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3             ) | rs1(s1) | rs2(s2)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   814
  void udiv(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   815
  void sdiv(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3             ) | rs1(s1) | rs2(s2)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   816
  void sdiv(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   817
  void udivcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3 | cc_bit_op3) | rs1(s1) | rs2(s2)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   818
  void udivcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   819
  void sdivcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3 | cc_bit_op3) | rs1(s1) | rs2(s2)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   820
  void sdivcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   821
489c9b5090e2 Initial load
duke
parents:
diff changeset
   822
  // pp 155
489c9b5090e2 Initial load
duke
parents:
diff changeset
   823
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   824
  void done()  { v9_only();  cti();  emit_int32( op(arith_op) | fcn(0) | op3(done_op3) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   825
  void retry() { v9_only();  cti();  emit_int32( op(arith_op) | fcn(1) | op3(retry_op3) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   826
489c9b5090e2 Initial load
duke
parents:
diff changeset
   827
  // pp 156
489c9b5090e2 Initial load
duke
parents:
diff changeset
   828
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   829
  void fadd( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x40 + w) | fs2(s2, w)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   830
  void fsub( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x44 + w) | fs2(s2, w)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   831
489c9b5090e2 Initial load
duke
parents:
diff changeset
   832
  // pp 157
489c9b5090e2 Initial load
duke
parents:
diff changeset
   833
18097
acd70736bd60 8008407: remove SPARC V8 support
morris
parents: 15116
diff changeset
   834
  void fcmp(  FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2) { emit_int32( op(arith_op) | cmpcc(cc) | op3(fpop2_op3) | fs1(s1, w) | opf(0x50 + w) | fs2(s2, w)); }
acd70736bd60 8008407: remove SPARC V8 support
morris
parents: 15116
diff changeset
   835
  void fcmpe( FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2) { emit_int32( op(arith_op) | cmpcc(cc) | op3(fpop2_op3) | fs1(s1, w) | opf(0x54 + w) | fs2(s2, w)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   836
489c9b5090e2 Initial load
duke
parents:
diff changeset
   837
  // pp 159
489c9b5090e2 Initial load
duke
parents:
diff changeset
   838
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   839
  void ftox( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v9_only();  emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(fpop1_op3) | opf(0x80 + w) | fs2(s, w)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   840
  void ftoi( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) {             emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::S) | op3(fpop1_op3) | opf(0xd0 + w) | fs2(s, w)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   841
489c9b5090e2 Initial load
duke
parents:
diff changeset
   842
  // pp 160
489c9b5090e2 Initial load
duke
parents:
diff changeset
   843
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   844
  void ftof( FloatRegisterImpl::Width sw, FloatRegisterImpl::Width dw, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, dw) | op3(fpop1_op3) | opf(0xc0 + sw + dw*4) | fs2(s, sw)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   845
489c9b5090e2 Initial load
duke
parents:
diff changeset
   846
  // pp 161
489c9b5090e2 Initial load
duke
parents:
diff changeset
   847
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   848
  void fxtof( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v9_only();  emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x80 + w*4) | fs2(s, FloatRegisterImpl::D)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   849
  void fitof( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) {             emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0xc0 + w*4) | fs2(s, FloatRegisterImpl::S)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   850
489c9b5090e2 Initial load
duke
parents:
diff changeset
   851
  // pp 162
489c9b5090e2 Initial load
duke
parents:
diff changeset
   852
18097
acd70736bd60 8008407: remove SPARC V8 support
morris
parents: 15116
diff changeset
   853
  void fmov( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x00 + w) | fs2(s, w)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   854
18097
acd70736bd60 8008407: remove SPARC V8 support
morris
parents: 15116
diff changeset
   855
  void fneg( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x04 + w) | fs2(s, w)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   856
18097
acd70736bd60 8008407: remove SPARC V8 support
morris
parents: 15116
diff changeset
   857
  void fabs( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x08 + w) | fs2(s, w)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   858
489c9b5090e2 Initial load
duke
parents:
diff changeset
   859
  // pp 163
489c9b5090e2 Initial load
duke
parents:
diff changeset
   860
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   861
  void fmul( FloatRegisterImpl::Width w,                            FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w)  | op3(fpop1_op3) | fs1(s1, w)  | opf(0x48 + w)         | fs2(s2, w)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   862
  void fmul( FloatRegisterImpl::Width sw, FloatRegisterImpl::Width dw,  FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, dw) | op3(fpop1_op3) | fs1(s1, sw) | opf(0x60 + sw + dw*4) | fs2(s2, sw)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   863
  void fdiv( FloatRegisterImpl::Width w,                            FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w)  | op3(fpop1_op3) | fs1(s1, w)  | opf(0x4c + w)         | fs2(s2, w)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   864
22505
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   865
  // FXORs/FXORd instructions
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   866
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   867
  void fxor( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, w) | op3(flog3_op3) | fs1(s1, w) | opf(0x6E - w) | fs2(s2, w)); }
4523090c9674 8002074: Support for AES on SPARC
kvn
parents: 22234
diff changeset
   868
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   869
  // pp 164
489c9b5090e2 Initial load
duke
parents:
diff changeset
   870
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   871
  void fsqrt( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x28 + w) | fs2(s, w)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   872
489c9b5090e2 Initial load
duke
parents:
diff changeset
   873
  // pp 165
489c9b5090e2 Initial load
duke
parents:
diff changeset
   874
489c9b5090e2 Initial load
duke
parents:
diff changeset
   875
  inline void flush( Register s1, Register s2 );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   876
  inline void flush( Register s1, int simm13a);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   877
489c9b5090e2 Initial load
duke
parents:
diff changeset
   878
  // pp 167
489c9b5090e2 Initial load
duke
parents:
diff changeset
   879
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   880
  void flushw() { v9_only();  emit_int32( op(arith_op) | op3(flushw_op3) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   881
489c9b5090e2 Initial load
duke
parents:
diff changeset
   882
  // pp 168
489c9b5090e2 Initial load
duke
parents:
diff changeset
   883
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   884
  void illtrap( int const22a) { if (const22a != 0) v9_only();  emit_int32( op(branch_op) | u_field(const22a, 21, 0) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   885
  // v8 unimp == illtrap(0)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   886
489c9b5090e2 Initial load
duke
parents:
diff changeset
   887
  // pp 169
489c9b5090e2 Initial load
duke
parents:
diff changeset
   888
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   889
  void impdep1( int id1, int const19a ) { v9_only();  emit_int32( op(arith_op) | fcn(id1) | op3(impdep1_op3) | u_field(const19a, 18, 0)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   890
  void impdep2( int id1, int const19a ) { v9_only();  emit_int32( op(arith_op) | fcn(id1) | op3(impdep2_op3) | u_field(const19a, 18, 0)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   891
489c9b5090e2 Initial load
duke
parents:
diff changeset
   892
  // pp 170
489c9b5090e2 Initial load
duke
parents:
diff changeset
   893
489c9b5090e2 Initial load
duke
parents:
diff changeset
   894
  void jmpl( Register s1, Register s2, Register d );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   895
  void jmpl( Register s1, int simm13a, Register d, RelocationHolder const& rspec = RelocationHolder() );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   896
489c9b5090e2 Initial load
duke
parents:
diff changeset
   897
  // 171
489c9b5090e2 Initial load
duke
parents:
diff changeset
   898
2571
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 2534
diff changeset
   899
  inline void ldf(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d);
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 2534
diff changeset
   900
  inline void ldf(FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d, RelocationHolder const& rspec = RelocationHolder());
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 2534
diff changeset
   901
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   902
489c9b5090e2 Initial load
duke
parents:
diff changeset
   903
  inline void ldfsr(  Register s1, Register s2 );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   904
  inline void ldfsr(  Register s1, int simm13a);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   905
  inline void ldxfsr( Register s1, Register s2 );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   906
  inline void ldxfsr( Register s1, int simm13a);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   907
489c9b5090e2 Initial load
duke
parents:
diff changeset
   908
  // 173
489c9b5090e2 Initial load
duke
parents:
diff changeset
   909
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   910
  void ldfa(  FloatRegisterImpl::Width w, Register s1, Register s2, int ia, FloatRegister d ) { v9_only();  emit_int32( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3 | alt_bit_op3, w) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   911
  void ldfa(  FloatRegisterImpl::Width w, Register s1, int simm13a,         FloatRegister d ) { v9_only();  emit_int32( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3 | alt_bit_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   912
489c9b5090e2 Initial load
duke
parents:
diff changeset
   913
  // pp 175, lduw is ld on v8
489c9b5090e2 Initial load
duke
parents:
diff changeset
   914
489c9b5090e2 Initial load
duke
parents:
diff changeset
   915
  inline void ldsb(  Register s1, Register s2, Register d );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   916
  inline void ldsb(  Register s1, int simm13a, Register d);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   917
  inline void ldsh(  Register s1, Register s2, Register d );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   918
  inline void ldsh(  Register s1, int simm13a, Register d);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   919
  inline void ldsw(  Register s1, Register s2, Register d );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   920
  inline void ldsw(  Register s1, int simm13a, Register d);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   921
  inline void ldub(  Register s1, Register s2, Register d );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   922
  inline void ldub(  Register s1, int simm13a, Register d);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   923
  inline void lduh(  Register s1, Register s2, Register d );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   924
  inline void lduh(  Register s1, int simm13a, Register d);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   925
  inline void lduw(  Register s1, Register s2, Register d );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   926
  inline void lduw(  Register s1, int simm13a, Register d);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   927
  inline void ldx(   Register s1, Register s2, Register d );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   928
  inline void ldx(   Register s1, int simm13a, Register d);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   929
  inline void ldd(   Register s1, Register s2, Register d );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   930
  inline void ldd(   Register s1, int simm13a, Register d);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   931
489c9b5090e2 Initial load
duke
parents:
diff changeset
   932
  // pp 177
489c9b5090e2 Initial load
duke
parents:
diff changeset
   933
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   934
  void ldsba(  Register s1, Register s2, int ia, Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(ldsb_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   935
  void ldsba(  Register s1, int simm13a,         Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(ldsb_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   936
  void ldsha(  Register s1, Register s2, int ia, Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(ldsh_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   937
  void ldsha(  Register s1, int simm13a,         Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(ldsh_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   938
  void ldswa(  Register s1, Register s2, int ia, Register d ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(ldsw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   939
  void ldswa(  Register s1, int simm13a,         Register d ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(ldsw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   940
  void lduba(  Register s1, Register s2, int ia, Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(ldub_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   941
  void lduba(  Register s1, int simm13a,         Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(ldub_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   942
  void lduha(  Register s1, Register s2, int ia, Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(lduh_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   943
  void lduha(  Register s1, int simm13a,         Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(lduh_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   944
  void lduwa(  Register s1, Register s2, int ia, Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(lduw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   945
  void lduwa(  Register s1, int simm13a,         Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(lduw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   946
  void ldxa(   Register s1, Register s2, int ia, Register d ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(ldx_op3  | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   947
  void ldxa(   Register s1, int simm13a,         Register d ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(ldx_op3  | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   948
489c9b5090e2 Initial load
duke
parents:
diff changeset
   949
  // pp 181
489c9b5090e2 Initial load
duke
parents:
diff changeset
   950
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   951
  void and3(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3              ) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   952
  void and3(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3              ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   953
  void andcc(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3  | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   954
  void andcc(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3  | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   955
  void andn(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3             ) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   956
  void andn(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   957
  void andncc(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   958
  void andncc(  Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   959
  void or3(     Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3               ) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   960
  void or3(     Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3               ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   961
  void orcc(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3   | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   962
  void orcc(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3   | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   963
  void orn(     Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   964
  void orn(     Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   965
  void orncc(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3  | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   966
  void orncc(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3  | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   967
  void xor3(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3              ) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   968
  void xor3(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3              ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   969
  void xorcc(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3  | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   970
  void xorcc(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3  | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   971
  void xnor(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3             ) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   972
  void xnor(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   973
  void xnorcc(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   974
  void xnorcc(  Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   975
489c9b5090e2 Initial load
duke
parents:
diff changeset
   976
  // pp 183
489c9b5090e2 Initial load
duke
parents:
diff changeset
   977
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   978
  void membar( Membar_mask_bits const7a ) { v9_only(); emit_int32( op(arith_op) | op3(membar_op3) | rs1(O7) | immed(true) | u_field( int(const7a), 6, 0)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   979
489c9b5090e2 Initial load
duke
parents:
diff changeset
   980
  // pp 185
489c9b5090e2 Initial load
duke
parents:
diff changeset
   981
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   982
  void fmov( FloatRegisterImpl::Width w, Condition c,  bool floatCC, CC cca, FloatRegister s2, FloatRegister d ) { v9_only();  emit_int32( op(arith_op) | fd(d, w) | op3(fpop2_op3) | cond_mov(c) | opf_cc(cca, floatCC) | opf_low6(w) | fs2(s2, w)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   983
489c9b5090e2 Initial load
duke
parents:
diff changeset
   984
  // pp 189
489c9b5090e2 Initial load
duke
parents:
diff changeset
   985
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   986
  void fmov( FloatRegisterImpl::Width w, RCondition c, Register s1,  FloatRegister s2, FloatRegister d ) { v9_only();  emit_int32( op(arith_op) | fd(d, w) | op3(fpop2_op3) | rs1(s1) | rcond(c) | opf_low5(4 + w) | fs2(s2, w)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   987
489c9b5090e2 Initial load
duke
parents:
diff changeset
   988
  // pp 191
489c9b5090e2 Initial load
duke
parents:
diff changeset
   989
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   990
  void movcc( Condition c, bool floatCC, CC cca, Register s2, Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(movcc_op3) | mov_cc(cca, floatCC) | cond_mov(c) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   991
  void movcc( Condition c, bool floatCC, CC cca, int simm11a, Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(movcc_op3) | mov_cc(cca, floatCC) | cond_mov(c) | immed(true) | simm(simm11a, 11) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   992
489c9b5090e2 Initial load
duke
parents:
diff changeset
   993
  // pp 195
489c9b5090e2 Initial load
duke
parents:
diff changeset
   994
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   995
  void movr( RCondition c, Register s1, Register s2,  Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(movr_op3) | rs1(s1) | rcond(c) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
   996
  void movr( RCondition c, Register s1, int simm10a,  Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(movr_op3) | rs1(s1) | rcond(c) | immed(true) | simm(simm10a, 10) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   997
489c9b5090e2 Initial load
duke
parents:
diff changeset
   998
  // pp 196
489c9b5090e2 Initial load
duke
parents:
diff changeset
   999
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1000
  void mulx(  Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(mulx_op3 ) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1001
  void mulx(  Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(mulx_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1002
  void sdivx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sdivx_op3) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1003
  void sdivx( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sdivx_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1004
  void udivx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(udivx_op3) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1005
  void udivx( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(udivx_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1006
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1007
  // pp 197
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1008
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1009
  void umul(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3             ) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1010
  void umul(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1011
  void smul(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3             ) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1012
  void smul(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1013
  void umulcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1014
  void umulcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1015
  void smulcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1016
  void smulcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1017
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1018
  // pp 201
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1019
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1020
  void nop() { emit_int32( op(branch_op) | op2(sethi_op2) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1021
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1022
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1023
  // pp 202
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1024
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1025
  void popc( Register s,  Register d) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(popc_op3) | rs2(s)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1026
  void popc( int simm13a, Register d) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(popc_op3) | immed(true) | simm(simm13a, 13)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1027
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1028
  // pp 203
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1029
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1030
  void prefetch(   Register s1, Register s2, PrefetchFcn f) { v9_only();  emit_int32( op(ldst_op) | fcn(f) | op3(prefetch_op3) | rs1(s1) | rs2(s2) ); }
14631
526804361522 8003250: SPARC: move MacroAssembler into separate file
twisti
parents: 13969
diff changeset
  1031
  void prefetch(   Register s1, int simm13a, PrefetchFcn f) { v9_only();  emit_data( op(ldst_op) | fcn(f) | op3(prefetch_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
526804361522 8003250: SPARC: move MacroAssembler into separate file
twisti
parents: 13969
diff changeset
  1032
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1033
  void prefetcha(  Register s1, Register s2, int ia, PrefetchFcn f ) { v9_only();  emit_int32( op(ldst_op) | fcn(f) | op3(prefetch_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1034
  void prefetcha(  Register s1, int simm13a,         PrefetchFcn f ) { v9_only();  emit_int32( op(ldst_op) | fcn(f) | op3(prefetch_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1035
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1036
  // pp 208
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1037
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1038
  // not implementing read privileged register
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1039
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1040
  inline void rdy(    Register d) { v9_dep();  emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(0, 18, 14)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1041
  inline void rdccr(  Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(2, 18, 14)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1042
  inline void rdasi(  Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(3, 18, 14)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1043
  inline void rdtick( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(4, 18, 14)); } // Spoon!
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1044
  inline void rdpc(   Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(5, 18, 14)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1045
  inline void rdfprs( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(6, 18, 14)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1046
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1047
  // pp 213
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1048
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1049
  inline void rett( Register s1, Register s2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1050
  inline void rett( Register s1, int simm13a, relocInfo::relocType rt = relocInfo::none);
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1051
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1052
  // pp 214
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1053
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1054
  void save(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(save_op3) | rs1(s1) | rs2(s2) ); }
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 371
diff changeset
  1055
  void save(    Register s1, int simm13a, Register d ) {
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 371
diff changeset
  1056
    // make sure frame is at least large enough for the register save area
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 371
diff changeset
  1057
    assert(-simm13a >= 16 * wordSize, "frame too small");
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1058
    emit_int32( op(arith_op) | rd(d) | op3(save_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) );
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 371
diff changeset
  1059
  }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1060
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1061
  void restore( Register s1 = G0,  Register s2 = G0, Register d = G0 ) { emit_int32( op(arith_op) | rd(d) | op3(restore_op3) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1062
  void restore( Register s1,       int simm13a,      Register d      ) { emit_int32( op(arith_op) | rd(d) | op3(restore_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1063
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1064
  // pp 216
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1065
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1066
  void saved()    { v9_only();  emit_int32( op(arith_op) | fcn(0) | op3(saved_op3)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1067
  void restored() { v9_only();  emit_int32( op(arith_op) | fcn(1) | op3(saved_op3)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1068
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1069
  // pp 217
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1070
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1071
  inline void sethi( int imm22a, Register d, RelocationHolder const& rspec = RelocationHolder() );
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1072
  // pp 218
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1073
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1074
  void sll(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(0) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1075
  void sll(  Register s1, int imm5a,   Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1076
  void srl(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(0) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1077
  void srl(  Register s1, int imm5a,   Register d ) { emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1078
  void sra(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(0) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1079
  void sra(  Register s1, int imm5a,   Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1080
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1081
  void sllx( Register s1, Register s2, Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1082
  void sllx( Register s1, int imm6a,   Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1083
  void srlx( Register s1, Register s2, Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1084
  void srlx( Register s1, int imm6a,   Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1085
  void srax( Register s1, Register s2, Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1086
  void srax( Register s1, int imm6a,   Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1087
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1088
  // pp 220
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1089
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1090
  void sir( int simm13a ) { emit_int32( op(arith_op) | fcn(15) | op3(sir_op3) | immed(true) | simm(simm13a, 13)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1091
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1092
  // pp 221
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1093
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1094
  void stbar() { emit_int32( op(arith_op) | op3(membar_op3) | u_field(15, 18, 14)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1095
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1096
  // pp 222
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1097
4009
8731c367fa98 6879902: CTW failure jdk6_18/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp:845
twisti
parents: 3905
diff changeset
  1098
  inline void stf(    FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1099
  inline void stf(    FloatRegisterImpl::Width w, FloatRegister d, Register s1, int simm13a);
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1100
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1101
  inline void stfsr(  Register s1, Register s2 );
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1102
  inline void stfsr(  Register s1, int simm13a);
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1103
  inline void stxfsr( Register s1, Register s2 );
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1104
  inline void stxfsr( Register s1, int simm13a);
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1105
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1106
  //  pp 224
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1107
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1108
  void stfa(  FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2, int ia ) { v9_only();  emit_int32( op(ldst_op) | fd(d, w) | alt_op3(stf_op3 | alt_bit_op3, w) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1109
  void stfa(  FloatRegisterImpl::Width w, FloatRegister d, Register s1, int simm13a         ) { v9_only();  emit_int32( op(ldst_op) | fd(d, w) | alt_op3(stf_op3 | alt_bit_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1110
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1111
  // p 226
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1112
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1113
  inline void stb(  Register d, Register s1, Register s2 );
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1114
  inline void stb(  Register d, Register s1, int simm13a);
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1115
  inline void sth(  Register d, Register s1, Register s2 );
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1116
  inline void sth(  Register d, Register s1, int simm13a);
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1117
  inline void stw(  Register d, Register s1, Register s2 );
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1118
  inline void stw(  Register d, Register s1, int simm13a);
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1119
  inline void stx(  Register d, Register s1, Register s2 );
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1120
  inline void stx(  Register d, Register s1, int simm13a);
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1121
  inline void std(  Register d, Register s1, Register s2 );
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1122
  inline void std(  Register d, Register s1, int simm13a);
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1123
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1124
  // pp 177
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1125
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1126
  void stba(  Register d, Register s1, Register s2, int ia ) {             emit_int32( op(ldst_op) | rd(d) | op3(stb_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1127
  void stba(  Register d, Register s1, int simm13a         ) {             emit_int32( op(ldst_op) | rd(d) | op3(stb_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1128
  void stha(  Register d, Register s1, Register s2, int ia ) {             emit_int32( op(ldst_op) | rd(d) | op3(sth_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1129
  void stha(  Register d, Register s1, int simm13a         ) {             emit_int32( op(ldst_op) | rd(d) | op3(sth_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1130
  void stwa(  Register d, Register s1, Register s2, int ia ) {             emit_int32( op(ldst_op) | rd(d) | op3(stw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1131
  void stwa(  Register d, Register s1, int simm13a         ) {             emit_int32( op(ldst_op) | rd(d) | op3(stw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1132
  void stxa(  Register d, Register s1, Register s2, int ia ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(stx_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1133
  void stxa(  Register d, Register s1, int simm13a         ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(stx_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1134
  void stda(  Register d, Register s1, Register s2, int ia ) {             emit_int32( op(ldst_op) | rd(d) | op3(std_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1135
  void stda(  Register d, Register s1, int simm13a         ) {             emit_int32( op(ldst_op) | rd(d) | op3(std_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1136
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1137
  // pp 230
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1138
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1139
  void sub(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3              ) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1140
  void sub(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3              ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
7433
b418028612ad 6961690: load oops from constant table on SPARC
twisti
parents: 7427
diff changeset
  1141
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1142
  void subcc(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1143
  void subcc(  Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1144
  void subc(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3             ) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1145
  void subc(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1146
  void subccc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1147
  void subccc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1148
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1149
  // pp 231
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1150
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1151
  inline void swap( Register s1, Register s2, Register d );
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1152
  inline void swap( Register s1, int simm13a, Register d);
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1153
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1154
  // pp 232
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1155
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1156
  void swapa(   Register s1, Register s2, int ia, Register d ) { v9_dep();  emit_int32( op(ldst_op) | rd(d) | op3(swap_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1157
  void swapa(   Register s1, int simm13a,         Register d ) { v9_dep();  emit_int32( op(ldst_op) | rd(d) | op3(swap_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1158
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1159
  // pp 234, note op in book is wrong, see pp 268
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1160
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1161
  void taddcc(    Register s1, Register s2, Register d ) {            emit_int32( op(arith_op) | rd(d) | op3(taddcc_op3  ) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1162
  void taddcc(    Register s1, int simm13a, Register d ) {            emit_int32( op(arith_op) | rd(d) | op3(taddcc_op3  ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1163
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1164
  // pp 235
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1165
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1166
  void tsubcc(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(tsubcc_op3  ) | rs1(s1) | rs2(s2) ); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1167
  void tsubcc(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(tsubcc_op3  ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1168
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1169
  // pp 237
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1170
18097
acd70736bd60 8008407: remove SPARC V8 support
morris
parents: 15116
diff changeset
  1171
  void trap( Condition c, CC cc, Register s1, Register s2 ) { emit_int32( op(arith_op) | cond(c) | op3(trap_op3) | rs1(s1) | trapcc(cc) | rs2(s2)); }
acd70736bd60 8008407: remove SPARC V8 support
morris
parents: 15116
diff changeset
  1172
  void trap( Condition c, CC cc, Register s1, int trapa   ) { emit_int32( op(arith_op) | cond(c) | op3(trap_op3) | rs1(s1) | trapcc(cc) | immed(true) | u_field(trapa, 6, 0)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1173
  // simple uncond. trap
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1174
  void trap( int trapa ) { trap( always, icc, G0, trapa ); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1175
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1176
  // pp 239 omit write priv register for now
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1177
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1178
  inline void wry(    Register d) { v9_dep();  emit_int32( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(0, 29, 25)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1179
  inline void wrccr(Register s) { v9_only(); emit_int32( op(arith_op) | rs1(s) | op3(wrreg_op3) | u_field(2, 29, 25)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1180
  inline void wrccr(Register s, int simm13a) { v9_only(); emit_int32( op(arith_op) |
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1181
                                                                           rs1(s) |
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1182
                                                                           op3(wrreg_op3) |
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1183
                                                                           u_field(2, 29, 25) |
10501
5bce84af0883 7059037: Use BIS for zeroing on T4
kvn
parents: 10267
diff changeset
  1184
                                                                           immed(true) |
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1185
                                                                           simm(simm13a, 13)); }
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1186
  inline void wrasi(Register d) { v9_only(); emit_int32( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(3, 29, 25)); }
10501
5bce84af0883 7059037: Use BIS for zeroing on T4
kvn
parents: 10267
diff changeset
  1187
  // wrasi(d, imm) stores (d xor imm) to asi
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1188
  inline void wrasi(Register d, int simm13a) { v9_only(); emit_int32( op(arith_op) | rs1(d) | op3(wrreg_op3) |
10501
5bce84af0883 7059037: Use BIS for zeroing on T4
kvn
parents: 10267
diff changeset
  1189
                                               u_field(3, 29, 25) | immed(true) | simm(simm13a, 13)); }
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1190
  inline void wrfprs( Register d) { v9_only(); emit_int32( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(6, 29, 25)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1191
24328
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
  1192
  //  VIS1 instructions
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
  1193
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
  1194
  void alignaddr( Register s1, Register s2, Register d ) { vis1_only(); emit_int32( op(arith_op) | rd(d) | op3(alignaddr_op3) | rs1(s1) | opf(alignaddr_opf) | rs2(s2)); }
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
  1195
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
  1196
  void faligndata( FloatRegister s1, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(faligndata_op3) | fs1(s1, FloatRegisterImpl::D) | opf(faligndata_opf) | fs2(s2, FloatRegisterImpl::D)); }
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
  1197
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
  1198
  void fsrc2( FloatRegisterImpl::Width w, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fsrc_op3) | opf(0x7A - w) | fs2(s2, w)); }
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
  1199
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
  1200
  void stpartialf( Register s1, Register s2, FloatRegister d, int ia = -1 ) { vis1_only(); emit_int32( op(ldst_op) | fd(d, FloatRegisterImpl::D) | op3(stpartialf_op3) | rs1(s1) | imm_asi(ia) | rs2(s2)); }
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
  1201
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
  1202
  //  VIS2 instructions
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
  1203
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
  1204
  void edge8n( Register s1, Register s2, Register d ) { vis2_only(); emit_int32( op(arith_op) | rd(d) | op3(edge_op3) | rs1(s1) | opf(edge8n_opf) | rs2(s2)); }
bddefb356fba 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 24008
diff changeset
  1205
10027
20cd71f29262 7059034: Use movxtod/movdtox on T4
kvn
parents: 9976
diff changeset
  1206
  // VIS3 instructions
20cd71f29262 7059034: Use movxtod/movdtox on T4
kvn
parents: 9976
diff changeset
  1207
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1208
  void movstosw( FloatRegister s, Register d ) { vis3_only();  emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mstosw_opf) | fs2(s, FloatRegisterImpl::S)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1209
  void movstouw( FloatRegister s, Register d ) { vis3_only();  emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mstouw_opf) | fs2(s, FloatRegisterImpl::S)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1210
  void movdtox(  FloatRegister s, Register d ) { vis3_only();  emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mdtox_opf) | fs2(s, FloatRegisterImpl::D)); }
10027
20cd71f29262 7059034: Use movxtod/movdtox on T4
kvn
parents: 9976
diff changeset
  1211
15116
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1212
  void movwtos( Register s, FloatRegister d ) { vis3_only();  emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::S) | op3(mftoi_op3) | opf(mwtos_opf) | rs2(s)); }
af423dcb739c 8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents: 14631
diff changeset
  1213
  void movxtod( Register s, FloatRegister d ) { vis3_only();  emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(mftoi_op3) | opf(mxtod_opf) | rs2(s)); }
10027
20cd71f29262 7059034: Use movxtod/movdtox on T4
kvn
parents: 9976
diff changeset
  1214
24953
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 24328
diff changeset
  1215
  // Crypto SHA instructions
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 24328
diff changeset
  1216
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 24328
diff changeset
  1217
  void sha1()   { sha1_only();    emit_int32( op(arith_op) | op3(sha_op3) | opf(sha1_opf)); }
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 24328
diff changeset
  1218
  void sha256() { sha256_only();  emit_int32( op(arith_op) | op3(sha_op3) | opf(sha256_opf)); }
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 24328
diff changeset
  1219
  void sha512() { sha512_only();  emit_int32( op(arith_op) | op3(sha_op3) | opf(sha512_opf)); }
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 24328
diff changeset
  1220
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1221
  // Creation
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1222
  Assembler(CodeBuffer* code) : AbstractAssembler(code) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1223
#ifdef CHECK_DELAY
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1224
    delay_state = no_delay;
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1225
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1226
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1227
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
  1228
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7112
diff changeset
  1229
#endif // CPU_SPARC_VM_ASSEMBLER_SPARC_HPP