hotspot/src/cpu/ppc/vm/assembler_ppc.cpp
author lana
Sat, 25 Mar 2017 01:44:22 +0000
changeset 44469 900705f4b1f3
parent 35594 cc13089c6327
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
     1
/*
30303
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
     2
 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
35594
cc13089c6327 8147937: Adapt SAP copyrights to new company name.
goetz
parents: 35085
diff changeset
     3
 * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
     5
 *
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
     8
 * published by the Free Software Foundation.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
     9
 *
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    14
 * accompanied this code).
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    15
 *
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    19
 *
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    22
 * questions.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    23
 *
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    24
 */
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    25
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    26
#include "precompiled.hpp"
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    27
#include "asm/assembler.inline.hpp"
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30303
diff changeset
    28
#include "gc/shared/cardTableModRefBS.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30303
diff changeset
    29
#include "gc/shared/collectedHeap.inline.hpp"
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    30
#include "interpreter/interpreter.hpp"
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    31
#include "memory/resourceArea.hpp"
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    32
#include "prims/methodHandles.hpp"
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    33
#include "runtime/biasedLocking.hpp"
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    34
#include "runtime/interfaceSupport.hpp"
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    35
#include "runtime/objectMonitor.hpp"
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    36
#include "runtime/os.hpp"
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    37
#include "runtime/sharedRuntime.hpp"
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    38
#include "runtime/stubRoutines.hpp"
23492
af5352f40e65 8037915: PPC64/AIX: Several smaller fixes
goetz
parents: 22824
diff changeset
    39
#include "utilities/macros.hpp"
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    40
#if INCLUDE_ALL_GCS
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30303
diff changeset
    41
#include "gc/g1/g1CollectedHeap.inline.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30303
diff changeset
    42
#include "gc/g1/g1SATBCardTableModRefBS.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30303
diff changeset
    43
#include "gc/g1/heapRegion.hpp"
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    44
#endif // INCLUDE_ALL_GCS
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    45
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    46
#ifdef PRODUCT
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    47
#define BLOCK_COMMENT(str) // nothing
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    48
#else
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    49
#define BLOCK_COMMENT(str) block_comment(str)
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    50
#endif
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    51
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    52
int AbstractAssembler::code_fill_byte() {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    53
  return 0x00;                  // illegal instruction 0x00000000
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    54
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    55
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    56
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    57
// Patch instruction `inst' at offset `inst_pos' to refer to
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    58
// `dest_pos' and return the resulting instruction.  We should have
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    59
// pcs, not offsets, but since all is relative, it will work out fine.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    60
int Assembler::patched_branch(int dest_pos, int inst, int inst_pos) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    61
  int m = 0; // mask for displacement field
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    62
  int v = 0; // new value for displacement field
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    63
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    64
  switch (inv_op_ppc(inst)) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    65
  case b_op:  m = li(-1); v = li(disp(dest_pos, inst_pos)); break;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    66
  case bc_op: m = bd(-1); v = bd(disp(dest_pos, inst_pos)); break;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    67
    default: ShouldNotReachHere();
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    68
  }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    69
  return inst & ~m | v;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    70
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    71
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    72
// Return the offset, relative to _code_begin, of the destination of
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    73
// the branch inst at offset pos.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    74
int Assembler::branch_destination(int inst, int pos) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    75
  int r = 0;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    76
  switch (inv_op_ppc(inst)) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    77
    case b_op:  r = bxx_destination_offset(inst, pos); break;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    78
    case bc_op: r = inv_bd_field(inst, pos); break;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    79
    default: ShouldNotReachHere();
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    80
  }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    81
  return r;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    82
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    83
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    84
// Low-level andi-one-instruction-macro.
30303
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
    85
void Assembler::andi(Register a, Register s, const long ui16) {
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    86
  if (is_power_of_2_long(((jlong) ui16)+1)) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    87
    // pow2minus1
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    88
    clrldi(a, s, 64-log2_long((((jlong) ui16)+1)));
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    89
  } else if (is_power_of_2_long((jlong) ui16)) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    90
    // pow2
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    91
    rlwinm(a, s, 0, 31-log2_long((jlong) ui16), 31-log2_long((jlong) ui16));
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    92
  } else if (is_power_of_2_long((jlong)-ui16)) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    93
    // negpow2
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    94
    clrrdi(a, s, log2_long((jlong)-ui16));
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    95
  } else {
30303
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
    96
    assert(is_uimm(ui16, 16), "must be 16-bit unsigned immediate");
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    97
    andi_(a, s, ui16);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    98
  }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    99
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   100
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   101
// RegisterOrConstant version.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   102
void Assembler::ld(Register d, RegisterOrConstant roc, Register s1) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   103
  if (roc.is_constant()) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   104
    if (s1 == noreg) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   105
      int simm16_rest = load_const_optimized(d, roc.as_constant(), noreg, true);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   106
      Assembler::ld(d, simm16_rest, d);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   107
    } else if (is_simm(roc.as_constant(), 16)) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   108
      Assembler::ld(d, roc.as_constant(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   109
    } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   110
      load_const_optimized(d, roc.as_constant());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   111
      Assembler::ldx(d, d, s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   112
    }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   113
  } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   114
    if (s1 == noreg)
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   115
      Assembler::ld(d, 0, roc.as_register());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   116
    else
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   117
      Assembler::ldx(d, roc.as_register(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   118
  }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   119
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   120
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   121
void Assembler::lwa(Register d, RegisterOrConstant roc, Register s1) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   122
  if (roc.is_constant()) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   123
    if (s1 == noreg) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   124
      int simm16_rest = load_const_optimized(d, roc.as_constant(), noreg, true);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   125
      Assembler::lwa(d, simm16_rest, d);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   126
    } else if (is_simm(roc.as_constant(), 16)) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   127
      Assembler::lwa(d, roc.as_constant(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   128
    } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   129
      load_const_optimized(d, roc.as_constant());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   130
      Assembler::lwax(d, d, s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   131
    }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   132
  } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   133
    if (s1 == noreg)
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   134
      Assembler::lwa(d, 0, roc.as_register());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   135
    else
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   136
      Assembler::lwax(d, roc.as_register(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   137
  }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   138
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   139
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   140
void Assembler::lwz(Register d, RegisterOrConstant roc, Register s1) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   141
  if (roc.is_constant()) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   142
    if (s1 == noreg) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   143
      int simm16_rest = load_const_optimized(d, roc.as_constant(), noreg, true);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   144
      Assembler::lwz(d, simm16_rest, d);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   145
    } else if (is_simm(roc.as_constant(), 16)) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   146
      Assembler::lwz(d, roc.as_constant(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   147
    } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   148
      load_const_optimized(d, roc.as_constant());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   149
      Assembler::lwzx(d, d, s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   150
    }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   151
  } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   152
    if (s1 == noreg)
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   153
      Assembler::lwz(d, 0, roc.as_register());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   154
    else
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   155
      Assembler::lwzx(d, roc.as_register(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   156
  }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   157
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   158
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   159
void Assembler::lha(Register d, RegisterOrConstant roc, Register s1) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   160
  if (roc.is_constant()) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   161
    if (s1 == noreg) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   162
      int simm16_rest = load_const_optimized(d, roc.as_constant(), noreg, true);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   163
      Assembler::lha(d, simm16_rest, d);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   164
    } else if (is_simm(roc.as_constant(), 16)) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   165
      Assembler::lha(d, roc.as_constant(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   166
    } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   167
      load_const_optimized(d, roc.as_constant());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   168
      Assembler::lhax(d, d, s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   169
    }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   170
  } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   171
    if (s1 == noreg)
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   172
      Assembler::lha(d, 0, roc.as_register());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   173
    else
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   174
      Assembler::lhax(d, roc.as_register(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   175
  }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   176
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   177
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   178
void Assembler::lhz(Register d, RegisterOrConstant roc, Register s1) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   179
  if (roc.is_constant()) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   180
    if (s1 == noreg) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   181
      int simm16_rest = load_const_optimized(d, roc.as_constant(), noreg, true);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   182
      Assembler::lhz(d, simm16_rest, d);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   183
    } else if (is_simm(roc.as_constant(), 16)) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   184
      Assembler::lhz(d, roc.as_constant(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   185
    } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   186
      load_const_optimized(d, roc.as_constant());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   187
      Assembler::lhzx(d, d, s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   188
    }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   189
  } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   190
    if (s1 == noreg)
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   191
      Assembler::lhz(d, 0, roc.as_register());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   192
    else
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   193
      Assembler::lhzx(d, roc.as_register(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   194
  }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   195
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   196
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   197
void Assembler::lbz(Register d, RegisterOrConstant roc, Register s1) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   198
  if (roc.is_constant()) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   199
    if (s1 == noreg) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   200
      int simm16_rest = load_const_optimized(d, roc.as_constant(), noreg, true);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   201
      Assembler::lbz(d, simm16_rest, d);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   202
    } else if (is_simm(roc.as_constant(), 16)) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   203
      Assembler::lbz(d, roc.as_constant(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   204
    } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   205
      load_const_optimized(d, roc.as_constant());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   206
      Assembler::lbzx(d, d, s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   207
    }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   208
  } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   209
    if (s1 == noreg)
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   210
      Assembler::lbz(d, 0, roc.as_register());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   211
    else
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   212
      Assembler::lbzx(d, roc.as_register(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   213
  }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   214
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   215
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   216
void Assembler::std(Register d, RegisterOrConstant roc, Register s1, Register tmp) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   217
  if (roc.is_constant()) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   218
    if (s1 == noreg) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   219
      guarantee(tmp != noreg, "Need tmp reg to encode large constants");
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   220
      int simm16_rest = load_const_optimized(tmp, roc.as_constant(), noreg, true);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   221
      Assembler::std(d, simm16_rest, tmp);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   222
    } else if (is_simm(roc.as_constant(), 16)) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   223
      Assembler::std(d, roc.as_constant(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   224
    } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   225
      guarantee(tmp != noreg, "Need tmp reg to encode large constants");
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   226
      load_const_optimized(tmp, roc.as_constant());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   227
      Assembler::stdx(d, tmp, s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   228
    }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   229
  } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   230
    if (s1 == noreg)
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   231
      Assembler::std(d, 0, roc.as_register());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   232
    else
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   233
      Assembler::stdx(d, roc.as_register(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   234
  }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   235
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   236
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   237
void Assembler::stw(Register d, RegisterOrConstant roc, Register s1, Register tmp) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   238
  if (roc.is_constant()) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   239
    if (s1 == noreg) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   240
      guarantee(tmp != noreg, "Need tmp reg to encode large constants");
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   241
      int simm16_rest = load_const_optimized(tmp, roc.as_constant(), noreg, true);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   242
      Assembler::stw(d, simm16_rest, tmp);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   243
    } else if (is_simm(roc.as_constant(), 16)) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   244
      Assembler::stw(d, roc.as_constant(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   245
    } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   246
      guarantee(tmp != noreg, "Need tmp reg to encode large constants");
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   247
      load_const_optimized(tmp, roc.as_constant());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   248
      Assembler::stwx(d, tmp, s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   249
    }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   250
  } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   251
    if (s1 == noreg)
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   252
      Assembler::stw(d, 0, roc.as_register());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   253
    else
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   254
      Assembler::stwx(d, roc.as_register(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   255
  }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   256
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   257
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   258
void Assembler::sth(Register d, RegisterOrConstant roc, Register s1, Register tmp) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   259
  if (roc.is_constant()) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   260
    if (s1 == noreg) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   261
      guarantee(tmp != noreg, "Need tmp reg to encode large constants");
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   262
      int simm16_rest = load_const_optimized(tmp, roc.as_constant(), noreg, true);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   263
      Assembler::sth(d, simm16_rest, tmp);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   264
    } else if (is_simm(roc.as_constant(), 16)) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   265
      Assembler::sth(d, roc.as_constant(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   266
    } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   267
      guarantee(tmp != noreg, "Need tmp reg to encode large constants");
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   268
      load_const_optimized(tmp, roc.as_constant());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   269
      Assembler::sthx(d, tmp, s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   270
    }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   271
  } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   272
    if (s1 == noreg)
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   273
      Assembler::sth(d, 0, roc.as_register());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   274
    else
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   275
      Assembler::sthx(d, roc.as_register(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   276
  }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   277
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   278
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   279
void Assembler::stb(Register d, RegisterOrConstant roc, Register s1, Register tmp) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   280
  if (roc.is_constant()) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   281
    if (s1 == noreg) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   282
      guarantee(tmp != noreg, "Need tmp reg to encode large constants");
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   283
      int simm16_rest = load_const_optimized(tmp, roc.as_constant(), noreg, true);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   284
      Assembler::stb(d, simm16_rest, tmp);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   285
    } else if (is_simm(roc.as_constant(), 16)) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   286
      Assembler::stb(d, roc.as_constant(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   287
    } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   288
      guarantee(tmp != noreg, "Need tmp reg to encode large constants");
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   289
      load_const_optimized(tmp, roc.as_constant());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   290
      Assembler::stbx(d, tmp, s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   291
    }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   292
  } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   293
    if (s1 == noreg)
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   294
      Assembler::stb(d, 0, roc.as_register());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   295
    else
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   296
      Assembler::stbx(d, roc.as_register(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   297
  }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   298
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   299
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   300
void Assembler::add(Register d, RegisterOrConstant roc, Register s1) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   301
  if (roc.is_constant()) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   302
    intptr_t c = roc.as_constant();
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   303
    assert(is_simm(c, 16), "too big");
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   304
    addi(d, s1, (int)c);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   305
  }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   306
  else add(d, roc.as_register(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   307
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   308
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   309
void Assembler::subf(Register d, RegisterOrConstant roc, Register s1) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   310
  if (roc.is_constant()) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   311
    intptr_t c = roc.as_constant();
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   312
    assert(is_simm(-c, 16), "too big");
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   313
    addi(d, s1, (int)-c);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   314
  }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   315
  else subf(d, roc.as_register(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   316
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   317
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   318
void Assembler::cmpd(ConditionRegister d, RegisterOrConstant roc, Register s1) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   319
  if (roc.is_constant()) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   320
    intptr_t c = roc.as_constant();
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   321
    assert(is_simm(c, 16), "too big");
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   322
    cmpdi(d, s1, (int)c);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   323
  }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   324
  else cmpd(d, roc.as_register(), s1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   325
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   326
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   327
// Load a 64 bit constant. Patchable.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   328
void Assembler::load_const(Register d, long x, Register tmp) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   329
  // 64-bit value: x = xa xb xc xd
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   330
  int xa = (x >> 48) & 0xffff;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   331
  int xb = (x >> 32) & 0xffff;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   332
  int xc = (x >> 16) & 0xffff;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   333
  int xd = (x >>  0) & 0xffff;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   334
  if (tmp == noreg) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   335
    Assembler::lis( d, (int)(short)xa);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   336
    Assembler::ori( d, d, (unsigned int)xb);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   337
    Assembler::sldi(d, d, 32);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   338
    Assembler::oris(d, d, (unsigned int)xc);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   339
    Assembler::ori( d, d, (unsigned int)xd);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   340
  } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   341
    // exploit instruction level parallelism if we have a tmp register
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   342
    assert_different_registers(d, tmp);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   343
    Assembler::lis(tmp, (int)(short)xa);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   344
    Assembler::lis(d, (int)(short)xc);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   345
    Assembler::ori(tmp, tmp, (unsigned int)xb);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   346
    Assembler::ori(d, d, (unsigned int)xd);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   347
    Assembler::insrdi(d, tmp, 32, 0);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   348
  }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   349
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   350
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   351
// Load a 64 bit constant, optimized, not identifyable.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   352
// Tmp can be used to increase ILP. Set return_simm16_rest=true to get a
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   353
// 16 bit immediate offset.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   354
int Assembler::load_const_optimized(Register d, long x, Register tmp, bool return_simm16_rest) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   355
  // Avoid accidentally trying to use R0 for indexed addressing.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   356
  assert_different_registers(d, tmp);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   357
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   358
  short xa, xb, xc, xd; // Four 16-bit chunks of const.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   359
  long rem = x;         // Remaining part of const.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   360
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   361
  xd = rem & 0xFFFF;    // Lowest 16-bit chunk.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   362
  rem = (rem >> 16) + ((unsigned short)xd >> 15); // Compensation for sign extend.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   363
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   364
  if (rem == 0) { // opt 1: simm16
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   365
    li(d, xd);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   366
    return 0;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   367
  }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   368
30303
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   369
  int retval = 0;
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   370
  if (return_simm16_rest) {
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   371
    retval = xd;
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   372
    x = rem << 16;
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   373
    xd = 0;
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   374
  }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   375
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   376
  if (d == R0) { // Can't use addi.
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   377
    if (is_simm(x, 32)) { // opt 2: simm32
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   378
      lis(d, x >> 16);
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   379
      if (xd) ori(d, d, (unsigned short)xd);
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   380
    } else {
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   381
      // 64-bit value: x = xa xb xc xd
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   382
      xa = (x >> 48) & 0xffff;
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   383
      xb = (x >> 32) & 0xffff;
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   384
      xc = (x >> 16) & 0xffff;
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   385
      bool xa_loaded = (xb & 0x8000) ? (xa != -1) : (xa != 0);
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   386
      if (tmp == noreg || (xc == 0 && xd == 0)) {
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   387
        if (xa_loaded) {
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   388
          lis(d, xa);
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   389
          if (xb) { ori(d, d, (unsigned short)xb); }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   390
        } else {
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   391
          li(d, xb);
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   392
        }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   393
        sldi(d, d, 32);
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   394
        if (xc) { oris(d, d, (unsigned short)xc); }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   395
        if (xd) { ori( d, d, (unsigned short)xd); }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   396
      } else {
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   397
        // Exploit instruction level parallelism if we have a tmp register.
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   398
        bool xc_loaded = (xd & 0x8000) ? (xc != -1) : (xc != 0);
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   399
        if (xa_loaded) {
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   400
          lis(tmp, xa);
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   401
        }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   402
        if (xc_loaded) {
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   403
          lis(d, xc);
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   404
        }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   405
        if (xa_loaded) {
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   406
          if (xb) { ori(tmp, tmp, (unsigned short)xb); }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   407
        } else {
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   408
          li(tmp, xb);
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   409
        }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   410
        if (xc_loaded) {
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   411
          if (xd) { ori(d, d, (unsigned short)xd); }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   412
        } else {
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   413
          li(d, xd);
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   414
        }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   415
        insrdi(d, tmp, 32, 0);
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   416
      }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   417
    }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   418
    return retval;
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   419
  }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   420
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   421
  xc = rem & 0xFFFF; // Next 16-bit chunk.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   422
  rem = (rem >> 16) + ((unsigned short)xc >> 15); // Compensation for sign extend.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   423
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   424
  if (rem == 0) { // opt 2: simm32
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   425
    lis(d, xc);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   426
  } else { // High 32 bits needed.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   427
30303
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   428
    if (tmp != noreg  && (int)x != 0) { // opt 3: We have a temp reg.
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   429
      // No carry propagation between xc and higher chunks here (use logical instructions).
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   430
      xa = (x >> 48) & 0xffff;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   431
      xb = (x >> 32) & 0xffff; // No sign compensation, we use lis+ori or li to allow usage of R0.
30303
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   432
      bool xa_loaded = (xb & 0x8000) ? (xa != -1) : (xa != 0);
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   433
      bool return_xd = false;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   434
30303
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   435
      if (xa_loaded) { lis(tmp, xa); }
23492
af5352f40e65 8037915: PPC64/AIX: Several smaller fixes
goetz
parents: 22824
diff changeset
   436
      if (xc) { lis(d, xc); }
30303
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   437
      if (xa_loaded) {
23492
af5352f40e65 8037915: PPC64/AIX: Several smaller fixes
goetz
parents: 22824
diff changeset
   438
        if (xb) { ori(tmp, tmp, (unsigned short)xb); } // No addi, we support tmp == R0.
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   439
      } else {
30303
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   440
        li(tmp, xb);
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   441
      }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   442
      if (xc) {
30303
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   443
        if (xd) { addi(d, d, xd); }
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   444
      } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   445
        li(d, xd);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   446
      }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   447
      insrdi(d, tmp, 32, 0);
30303
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   448
      return retval;
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   449
    }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   450
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   451
    xb = rem & 0xFFFF; // Next 16-bit chunk.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   452
    rem = (rem >> 16) + ((unsigned short)xb >> 15); // Compensation for sign extend.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   453
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   454
    xa = rem & 0xFFFF; // Highest 16-bit chunk.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   455
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   456
    // opt 4: avoid adding 0
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   457
    if (xa) { // Highest 16-bit needed?
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   458
      lis(d, xa);
23492
af5352f40e65 8037915: PPC64/AIX: Several smaller fixes
goetz
parents: 22824
diff changeset
   459
      if (xb) { addi(d, d, xb); }
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   460
    } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   461
      li(d, xb);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   462
    }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   463
    sldi(d, d, 32);
23492
af5352f40e65 8037915: PPC64/AIX: Several smaller fixes
goetz
parents: 22824
diff changeset
   464
    if (xc) { addis(d, d, xc); }
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   465
  }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   466
30303
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   467
  if (xd) { addi(d, d, xd); }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   468
  return retval;
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   469
}
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   470
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   471
// We emit only one addition to s to optimize latency.
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   472
int Assembler::add_const_optimized(Register d, Register s, long x, Register tmp, bool return_simm16_rest) {
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   473
  assert(s != R0 && s != tmp, "unsupported");
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   474
  long rem = x;
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   475
30303
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   476
  // Case 1: Can use mr or addi.
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   477
  short xd = rem & 0xFFFF; // Lowest 16-bit chunk.
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   478
  rem = (rem >> 16) + ((unsigned short)xd >> 15);
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   479
  if (rem == 0) {
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   480
    if (xd == 0) {
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   481
      if (d != s) { mr(d, s); }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   482
      return 0;
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   483
    }
35085
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents: 30764
diff changeset
   484
    if (return_simm16_rest && (d == s)) {
30303
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   485
      return xd;
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   486
    }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   487
    addi(d, s, xd);
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   488
    return 0;
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   489
  }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   490
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   491
  // Case 2: Can use addis.
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   492
  if (xd == 0) {
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   493
    short xc = rem & 0xFFFF; // 2nd 16-bit chunk.
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   494
    rem = (rem >> 16) + ((unsigned short)xd >> 15);
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   495
    if (rem == 0) {
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   496
      addis(d, s, xc);
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   497
      return 0;
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   498
    }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   499
  }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   500
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   501
  // Other cases: load & add.
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   502
  Register tmp1 = tmp,
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   503
           tmp2 = noreg;
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   504
  if ((d != tmp) && (d != s)) {
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   505
    // Can use d.
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   506
    tmp1 = d;
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   507
    tmp2 = tmp;
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   508
  }
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   509
  int simm16_rest = load_const_optimized(tmp1, x, tmp2, return_simm16_rest);
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   510
  add(d, tmp1, s);
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 25374
diff changeset
   511
  return simm16_rest;
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   512
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   513
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   514
#ifndef PRODUCT
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   515
// Test of ppc assembler.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   516
void Assembler::test_asm() {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   517
  // PPC 1, section 3.3.8, Fixed-Point Arithmetic Instructions
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   518
  addi(   R0,  R1,  10);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   519
  addis(  R5,  R2,  11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   520
  addic_( R3,  R31, 42);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   521
  subfic( R21, R12, 2112);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   522
  add(    R3,  R2,  R1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   523
  add_(   R11, R22, R30);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   524
  subf(   R7,  R6,  R5);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   525
  subf_(  R8,  R9,  R4);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   526
  addc(   R11, R12, R13);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   527
  addc_(  R14, R14, R14);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   528
  subfc(  R15, R16, R17);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   529
  subfc_( R18, R20, R19);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   530
  adde(   R20, R22, R24);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   531
  adde_(  R29, R27, R26);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   532
  subfe(  R28, R1,  R0);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   533
  subfe_( R21, R11, R29);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   534
  neg(    R21, R22);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   535
  neg_(   R13, R23);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   536
  mulli(  R0,  R11, -31);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   537
  mulld(  R1,  R18, R21);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   538
  mulld_( R2,  R17, R22);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   539
  mullw(  R3,  R16, R23);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   540
  mullw_( R4,  R15, R24);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   541
  divd(   R5,  R14, R25);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   542
  divd_(  R6,  R13, R26);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   543
  divw(   R7,  R12, R27);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   544
  divw_(  R8,  R11, R28);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   545
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   546
  li(     R3, -4711);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   547
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   548
  // PPC 1, section 3.3.9, Fixed-Point Compare Instructions
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   549
  cmpi(   CCR7,  0, R27, 4711);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   550
  cmp(    CCR0, 1, R14, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   551
  cmpli(  CCR5,  1, R17, 45);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   552
  cmpl(   CCR3, 0, R9,  R10);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   553
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   554
  cmpwi(  CCR7,  R27, 4711);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   555
  cmpw(   CCR0, R14, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   556
  cmplwi( CCR5,  R17, 45);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   557
  cmplw(  CCR3, R9,  R10);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   558
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   559
  cmpdi(  CCR7,  R27, 4711);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   560
  cmpd(   CCR0, R14, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   561
  cmpldi( CCR5,  R17, 45);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   562
  cmpld(  CCR3, R9,  R10);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   563
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   564
  // PPC 1, section 3.3.11, Fixed-Point Logical Instructions
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   565
  andi_(  R4,  R5,  0xff);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   566
  andis_( R12, R13, 0x7b51);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   567
  ori(    R1,  R4,  13);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   568
  oris(   R3,  R5,  177);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   569
  xori(   R7,  R6,  51);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   570
  xoris(  R29, R0,  1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   571
  andr(   R17, R21, R16);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   572
  and_(   R3,  R5,  R15);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   573
  orr(    R2,  R1,  R9);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   574
  or_(    R17, R15, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   575
  xorr(   R19, R18, R10);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   576
  xor_(   R31, R21, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   577
  nand(   R5,  R7,  R3);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   578
  nand_(  R3,  R1,  R0);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   579
  nor(    R2,  R3,  R5);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   580
  nor_(   R3,  R6,  R8);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   581
  andc(   R25, R12, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   582
  andc_(  R24, R22, R21);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   583
  orc(    R20, R10, R12);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   584
  orc_(   R22, R2,  R13);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   585
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   586
  nop();
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   587
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   588
  // PPC 1, section 3.3.12, Fixed-Point Rotate and Shift Instructions
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   589
  sld(    R5,  R6,  R8);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   590
  sld_(   R3,  R5,  R9);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   591
  slw(    R2,  R1,  R10);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   592
  slw_(   R6,  R26, R16);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   593
  srd(    R16, R24, R8);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   594
  srd_(   R21, R14, R7);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   595
  srw(    R22, R25, R29);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   596
  srw_(   R5,  R18, R17);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   597
  srad(   R7,  R11, R0);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   598
  srad_(  R9,  R13, R1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   599
  sraw(   R7,  R15, R2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   600
  sraw_(  R4,  R17, R3);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   601
  sldi(   R3,  R18, 63);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   602
  sldi_(  R2,  R20, 30);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   603
  slwi(   R1,  R21, 30);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   604
  slwi_(  R7,  R23, 8);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   605
  srdi(   R0,  R19, 2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   606
  srdi_(  R12, R24, 5);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   607
  srwi(   R13, R27, 6);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   608
  srwi_(  R14, R29, 7);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   609
  sradi(  R15, R30, 9);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   610
  sradi_( R16, R31, 19);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   611
  srawi(  R17, R31, 15);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   612
  srawi_( R18, R31, 12);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   613
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   614
  clrrdi( R3, R30, 5);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   615
  clrldi( R9, R10, 11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   616
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   617
  rldicr( R19, R20, 13, 15);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   618
  rldicr_(R20, R20, 16, 14);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   619
  rldicl( R21, R21, 30, 33);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   620
  rldicl_(R22, R1,  20, 25);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   621
  rlwinm( R23, R2,  25, 10, 11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   622
  rlwinm_(R24, R3,  12, 13, 14);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   623
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   624
  // PPC 1, section 3.3.2 Fixed-Point Load Instructions
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   625
  lwzx(   R3,  R5, R7);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   626
  lwz(    R11,  0, R1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   627
  lwzu(   R31, -4, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   628
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   629
  lwax(   R3,  R5, R7);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   630
  lwa(    R31, -4, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   631
  lhzx(   R3,  R5, R7);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   632
  lhz(    R31, -4, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   633
  lhzu(   R31, -4, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   634
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   635
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   636
  lhax(   R3,  R5, R7);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   637
  lha(    R31, -4, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   638
  lhau(   R11,  0, R1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   639
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   640
  lbzx(   R3,  R5, R7);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   641
  lbz(    R31, -4, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   642
  lbzu(   R11,  0, R1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   643
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   644
  ld(     R31, -4, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   645
  ldx(    R3,  R5, R7);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   646
  ldu(    R31, -4, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   647
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   648
  //  PPC 1, section 3.3.3 Fixed-Point Store Instructions
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   649
  stwx(   R3,  R5, R7);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   650
  stw(    R31, -4, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   651
  stwu(   R11,  0, R1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   652
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   653
  sthx(   R3,  R5, R7 );
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   654
  sth(    R31, -4, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   655
  sthu(   R31, -4, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   656
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   657
  stbx(   R3,  R5, R7);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   658
  stb(    R31, -4, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   659
  stbu(   R31, -4, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   660
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   661
  std(    R31, -4, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   662
  stdx(   R3,  R5, R7);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   663
  stdu(   R31, -4, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   664
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   665
 // PPC 1, section 3.3.13 Move To/From System Register Instructions
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   666
  mtlr(   R3);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   667
  mflr(   R3);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   668
  mtctr(  R3);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   669
  mfctr(  R3);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   670
  mtcrf(  0xff, R15);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   671
  mtcr(   R15);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   672
  mtcrf(  0x03, R15);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   673
  mtcr(   R15);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   674
  mfcr(   R15);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   675
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   676
 // PPC 1, section 2.4.1 Branch Instructions
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   677
  Label lbl1, lbl2, lbl3;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   678
  bind(lbl1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   679
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   680
  b(pc());
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   681
  b(pc() - 8);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   682
  b(lbl1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   683
  b(lbl2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   684
  b(lbl3);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   685
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   686
  bl(pc() - 8);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   687
  bl(lbl1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   688
  bl(lbl2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   689
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   690
  bcl(4, 10, pc() - 8);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   691
  bcl(4, 10, lbl1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   692
  bcl(4, 10, lbl2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   693
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   694
  bclr( 4, 6, 0);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   695
  bclrl(4, 6, 0);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   696
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   697
  bind(lbl2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   698
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   699
  bcctr( 4, 6, 0);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   700
  bcctrl(4, 6, 0);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   701
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   702
  blt(CCR0, lbl2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   703
  bgt(CCR1, lbl2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   704
  beq(CCR2, lbl2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   705
  bso(CCR3, lbl2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   706
  bge(CCR4, lbl2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   707
  ble(CCR5, lbl2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   708
  bne(CCR6, lbl2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   709
  bns(CCR7, lbl2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   710
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   711
  bltl(CCR0, lbl2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   712
  bgtl(CCR1, lbl2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   713
  beql(CCR2, lbl2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   714
  bsol(CCR3, lbl2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   715
  bgel(CCR4, lbl2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   716
  blel(CCR5, lbl2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   717
  bnel(CCR6, lbl2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   718
  bnsl(CCR7, lbl2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   719
  blr();
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   720
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   721
  sync();
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   722
  icbi( R1, R2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   723
  dcbst(R2, R3);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   724
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   725
  // FLOATING POINT instructions ppc.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   726
  // PPC 1, section 4.6.2 Floating-Point Load Instructions
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   727
  lfs( F1, -11, R3);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   728
  lfsu(F2, 123, R4);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   729
  lfsx(F3, R5,  R6);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   730
  lfd( F4, 456, R7);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   731
  lfdu(F5, 789, R8);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   732
  lfdx(F6, R10, R11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   733
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   734
  // PPC 1, section 4.6.3 Floating-Point Store Instructions
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   735
  stfs(  F7,  876, R12);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   736
  stfsu( F8,  543, R13);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   737
  stfsx( F9,  R14, R15);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   738
  stfd(  F10, 210, R16);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   739
  stfdu( F11, 111, R17);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   740
  stfdx( F12, R18, R19);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   741
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   742
  // PPC 1, section 4.6.4 Floating-Point Move Instructions
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   743
  fmr(   F13, F14);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   744
  fmr_(  F14, F15);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   745
  fneg(  F16, F17);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   746
  fneg_( F18, F19);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   747
  fabs(  F20, F21);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   748
  fabs_( F22, F23);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   749
  fnabs( F24, F25);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   750
  fnabs_(F26, F27);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   751
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   752
  // PPC 1, section 4.6.5.1 Floating-Point Elementary Arithmetic
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   753
  // Instructions
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   754
  fadd(  F28, F29, F30);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   755
  fadd_( F31, F0,  F1);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   756
  fadds( F2,  F3,  F4);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   757
  fadds_(F5,  F6,  F7);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   758
  fsub(  F8,  F9,  F10);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   759
  fsub_( F11, F12, F13);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   760
  fsubs( F14, F15, F16);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   761
  fsubs_(F17, F18, F19);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   762
  fmul(  F20, F21, F22);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   763
  fmul_( F23, F24, F25);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   764
  fmuls( F26, F27, F28);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   765
  fmuls_(F29, F30, F31);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   766
  fdiv(  F0,  F1,  F2);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   767
  fdiv_( F3,  F4,  F5);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   768
  fdivs( F6,  F7,  F8);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   769
  fdivs_(F9,  F10, F11);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   770
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   771
  // PPC 1, section 4.6.6 Floating-Point Rounding and Conversion
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   772
  // Instructions
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   773
  frsp(  F12, F13);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   774
  fctid( F14, F15);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   775
  fctidz(F16, F17);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   776
  fctiw( F18, F19);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   777
  fctiwz(F20, F21);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   778
  fcfid( F22, F23);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   779
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   780
  // PPC 1, section 4.6.7 Floating-Point Compare Instructions
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   781
  fcmpu( CCR7, F24, F25);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   782
25374
d7fb2af5d53c 8048169: Change 8037816 breaks HS build on PPC64 and CPP-Interpreter platforms
coleenp
parents: 23492
diff changeset
   783
  tty->print_cr("\ntest_asm disassembly (0x%lx 0x%lx):", p2i(code()->insts_begin()), p2i(code()->insts_end()));
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   784
  code()->decode();
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   785
}
23492
af5352f40e65 8037915: PPC64/AIX: Several smaller fixes
goetz
parents: 22824
diff changeset
   786
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   787
#endif // !PRODUCT