annotate graal/com.oracle.jvmci.asm.amd64/src/com/oracle/jvmci/asm/amd64/AMD64MacroAssembler.java @ 21708:6df25b1418be

moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
author Doug Simon <doug.simon@oracle.com>
date Wed, 03 Jun 2015 18:06:44 +0200
parents graal/com.oracle.graal.asm.amd64/src/com/oracle/graal/asm/amd64/AMD64MacroAssembler.java@5024c80224c7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
19874
89c729e9e0a4 Refactoring of AMD64 code generation.
Roland Schatz <roland.schatz@oracle.com>
parents: 18253
diff changeset
2 * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
13 * accompanied this code).
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
21 * questions.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
22 */
21708
6df25b1418be moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21673
diff changeset
23 package com.oracle.jvmci.asm.amd64;
6493
85c1b84f8fd9 moved ADM64-specific assembler code into separate project
Doug Simon <doug.simon@oracle.com>
parents: 6329
diff changeset
24
21673
5024c80224c7 moved com.oracle.graal.[amd64|sparc] to com.oracle.jvmci.[amd64|sparc] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21556
diff changeset
25 import com.oracle.jvmci.amd64.*;
21708
6df25b1418be moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21673
diff changeset
26 import com.oracle.jvmci.asm.*;
21556
48c1ebd24120 renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21437
diff changeset
27 import com.oracle.jvmci.code.Register;
48c1ebd24120 renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21437
diff changeset
28 import com.oracle.jvmci.code.CalleeSaveLayout;
48c1ebd24120 renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21437
diff changeset
29 import com.oracle.jvmci.code.TargetDescription;
48c1ebd24120 renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21437
diff changeset
30 import com.oracle.jvmci.code.RegisterConfig;
48c1ebd24120 renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21437
diff changeset
31 import com.oracle.jvmci.meta.Kind;
21673
5024c80224c7 moved com.oracle.graal.[amd64|sparc] to com.oracle.jvmci.[amd64|sparc] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21556
diff changeset
32
21708
6df25b1418be moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21673
diff changeset
33 import static com.oracle.jvmci.asm.amd64.AMD64AsmOptions.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
34
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
35 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
36 * This class implements commonly used X86 code patterns.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
37 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
38 public class AMD64MacroAssembler extends AMD64Assembler {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
39
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5540
diff changeset
40 public AMD64MacroAssembler(TargetDescription target, RegisterConfig registerConfig) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
41 super(target, registerConfig);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
42 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
43
7822
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
44 public final void decrementq(Register reg, int value) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
45 if (value == Integer.MIN_VALUE) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
46 subq(reg, value);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
47 return;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
48 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
49 if (value < 0) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
50 incrementq(reg, -value);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
51 return;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
52 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
53 if (value == 0) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
54 return;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
55 }
6493
85c1b84f8fd9 moved ADM64-specific assembler code into separate project
Doug Simon <doug.simon@oracle.com>
parents: 6329
diff changeset
56 if (value == 1 && UseIncDec) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
57 decq(reg);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
58 } else {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
59 subq(reg, value);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
60 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
61 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
62
20085
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
63 public final void decrementq(AMD64Address dst, int value) {
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
64 if (value == Integer.MIN_VALUE) {
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
65 subq(dst, value);
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
66 return;
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
67 }
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
68 if (value < 0) {
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
69 incrementq(dst, -value);
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
70 return;
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
71 }
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
72 if (value == 0) {
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
73 return;
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
74 }
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
75 if (value == 1 && UseIncDec) {
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
76 decq(dst);
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
77 } else {
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
78 subq(dst, value);
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
79 }
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
80 }
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
81
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5540
diff changeset
82 public void incrementq(Register reg, int value) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
83 if (value == Integer.MIN_VALUE) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
84 addq(reg, value);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
85 return;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
86 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
87 if (value < 0) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
88 decrementq(reg, -value);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
89 return;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
90 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
91 if (value == 0) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
92 return;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
93 }
6493
85c1b84f8fd9 moved ADM64-specific assembler code into separate project
Doug Simon <doug.simon@oracle.com>
parents: 6329
diff changeset
94 if (value == 1 && UseIncDec) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
95 incq(reg);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
96 } else {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
97 addq(reg, value);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
98 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
99 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
100
20085
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
101 public final void incrementq(AMD64Address dst, int value) {
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
102 if (value == Integer.MIN_VALUE) {
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
103 addq(dst, value);
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
104 return;
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
105 }
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
106 if (value < 0) {
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
107 decrementq(dst, -value);
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
108 return;
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
109 }
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
110 if (value == 0) {
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
111 return;
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
112 }
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
113 if (value == 1 && UseIncDec) {
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
114 incq(dst);
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
115 } else {
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
116 addq(dst, value);
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
117 }
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
118 }
5a42f9b582c6 AMD64Assembler: introduce DEC and incrementq/decrementq macros for AMD64Addresses.
Josef Eisl <josef.eisl@jku.at>
parents: 19874
diff changeset
119
15456
bb97b75d1d65 AMD64: implemented DeoptimizationStub.deoptimizationHandler
twisti
parents: 14559
diff changeset
120 public final void movptr(Register dst, AMD64Address src) {
bb97b75d1d65 AMD64: implemented DeoptimizationStub.deoptimizationHandler
twisti
parents: 14559
diff changeset
121 movq(dst, src);
bb97b75d1d65 AMD64: implemented DeoptimizationStub.deoptimizationHandler
twisti
parents: 14559
diff changeset
122 }
bb97b75d1d65 AMD64: implemented DeoptimizationStub.deoptimizationHandler
twisti
parents: 14559
diff changeset
123
bb97b75d1d65 AMD64: implemented DeoptimizationStub.deoptimizationHandler
twisti
parents: 14559
diff changeset
124 public final void movptr(AMD64Address dst, Register src) {
bb97b75d1d65 AMD64: implemented DeoptimizationStub.deoptimizationHandler
twisti
parents: 14559
diff changeset
125 movq(dst, src);
bb97b75d1d65 AMD64: implemented DeoptimizationStub.deoptimizationHandler
twisti
parents: 14559
diff changeset
126 }
bb97b75d1d65 AMD64: implemented DeoptimizationStub.deoptimizationHandler
twisti
parents: 14559
diff changeset
127
7839
838293a77af7 Make Address class platform specific.
Roland Schatz <roland.schatz@oracle.com>
parents: 7822
diff changeset
128 public final void movptr(AMD64Address dst, int src) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
129 movslq(dst, src);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
130 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
131
7822
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
132 public final void cmpptr(Register src1, Register src2) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
133 cmpq(src1, src2);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
134 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
135
7839
838293a77af7 Make Address class platform specific.
Roland Schatz <roland.schatz@oracle.com>
parents: 7822
diff changeset
136 public final void cmpptr(Register src1, AMD64Address src2) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
137 cmpq(src1, src2);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
138 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
139
7822
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
140 public final void decrementl(Register reg, int value) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
141 if (value == Integer.MIN_VALUE) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
142 subl(reg, value);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
143 return;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
144 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
145 if (value < 0) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
146 incrementl(reg, -value);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
147 return;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
148 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
149 if (value == 0) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
150 return;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
151 }
6493
85c1b84f8fd9 moved ADM64-specific assembler code into separate project
Doug Simon <doug.simon@oracle.com>
parents: 6329
diff changeset
152 if (value == 1 && UseIncDec) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
153 decl(reg);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
154 } else {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
155 subl(reg, value);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
156 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
157 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
158
7839
838293a77af7 Make Address class platform specific.
Roland Schatz <roland.schatz@oracle.com>
parents: 7822
diff changeset
159 public final void decrementl(AMD64Address dst, int value) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
160 if (value == Integer.MIN_VALUE) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
161 subl(dst, value);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
162 return;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
163 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
164 if (value < 0) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
165 incrementl(dst, -value);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
166 return;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
167 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
168 if (value == 0) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
169 return;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
170 }
6493
85c1b84f8fd9 moved ADM64-specific assembler code into separate project
Doug Simon <doug.simon@oracle.com>
parents: 6329
diff changeset
171 if (value == 1 && UseIncDec) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
172 decl(dst);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
173 } else {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
174 subl(dst, value);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
175 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
176 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
177
7822
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
178 public final void incrementl(Register reg, int value) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
179 if (value == Integer.MIN_VALUE) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
180 addl(reg, value);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
181 return;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
182 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
183 if (value < 0) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
184 decrementl(reg, -value);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
185 return;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
186 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
187 if (value == 0) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
188 return;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
189 }
6493
85c1b84f8fd9 moved ADM64-specific assembler code into separate project
Doug Simon <doug.simon@oracle.com>
parents: 6329
diff changeset
190 if (value == 1 && UseIncDec) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
191 incl(reg);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
192 } else {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
193 addl(reg, value);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
194 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
195 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
196
7839
838293a77af7 Make Address class platform specific.
Roland Schatz <roland.schatz@oracle.com>
parents: 7822
diff changeset
197 public final void incrementl(AMD64Address dst, int value) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
198 if (value == Integer.MIN_VALUE) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
199 addl(dst, value);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
200 return;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
201 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
202 if (value < 0) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
203 decrementl(dst, -value);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
204 return;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
205 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
206 if (value == 0) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
207 return;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
208 }
6493
85c1b84f8fd9 moved ADM64-specific assembler code into separate project
Doug Simon <doug.simon@oracle.com>
parents: 6329
diff changeset
209 if (value == 1 && UseIncDec) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
210 incl(dst);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
211 } else {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
212 addl(dst, value);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
213 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
214 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
215
13265
2d76d0c85345 Make selection of x86 floating point move instruction extensible.
Roland Schatz <roland.schatz@oracle.com>
parents: 10513
diff changeset
216 public void movflt(Register dst, Register src) {
18253
edb88f5425e6 switch to using use .equals() instead of == when comparing RegisterCaterory objects for equality
Doug Simon <doug.simon@oracle.com>
parents: 15456
diff changeset
217 assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
6493
85c1b84f8fd9 moved ADM64-specific assembler code into separate project
Doug Simon <doug.simon@oracle.com>
parents: 6329
diff changeset
218 if (UseXmmRegToRegMoveAll) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
219 movaps(dst, src);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
220 } else {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
221 movss(dst, src);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
222 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
223 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
224
13265
2d76d0c85345 Make selection of x86 floating point move instruction extensible.
Roland Schatz <roland.schatz@oracle.com>
parents: 10513
diff changeset
225 public void movflt(Register dst, AMD64Address src) {
18253
edb88f5425e6 switch to using use .equals() instead of == when comparing RegisterCaterory objects for equality
Doug Simon <doug.simon@oracle.com>
parents: 15456
diff changeset
226 assert dst.getRegisterCategory().equals(AMD64.XMM);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
227 movss(dst, src);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
228 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
229
13265
2d76d0c85345 Make selection of x86 floating point move instruction extensible.
Roland Schatz <roland.schatz@oracle.com>
parents: 10513
diff changeset
230 public void movflt(AMD64Address dst, Register src) {
18253
edb88f5425e6 switch to using use .equals() instead of == when comparing RegisterCaterory objects for equality
Doug Simon <doug.simon@oracle.com>
parents: 15456
diff changeset
231 assert src.getRegisterCategory().equals(AMD64.XMM);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
232 movss(dst, src);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
233 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
234
13265
2d76d0c85345 Make selection of x86 floating point move instruction extensible.
Roland Schatz <roland.schatz@oracle.com>
parents: 10513
diff changeset
235 public void movdbl(Register dst, Register src) {
18253
edb88f5425e6 switch to using use .equals() instead of == when comparing RegisterCaterory objects for equality
Doug Simon <doug.simon@oracle.com>
parents: 15456
diff changeset
236 assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
6493
85c1b84f8fd9 moved ADM64-specific assembler code into separate project
Doug Simon <doug.simon@oracle.com>
parents: 6329
diff changeset
237 if (UseXmmRegToRegMoveAll) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
238 movapd(dst, src);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
239 } else {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
240 movsd(dst, src);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
241 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
242 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
243
13265
2d76d0c85345 Make selection of x86 floating point move instruction extensible.
Roland Schatz <roland.schatz@oracle.com>
parents: 10513
diff changeset
244 public void movdbl(Register dst, AMD64Address src) {
18253
edb88f5425e6 switch to using use .equals() instead of == when comparing RegisterCaterory objects for equality
Doug Simon <doug.simon@oracle.com>
parents: 15456
diff changeset
245 assert dst.getRegisterCategory().equals(AMD64.XMM);
6493
85c1b84f8fd9 moved ADM64-specific assembler code into separate project
Doug Simon <doug.simon@oracle.com>
parents: 6329
diff changeset
246 if (UseXmmLoadAndClearUpper) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
247 movsd(dst, src);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
248 } else {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
249 movlpd(dst, src);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
250 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
251 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
252
13265
2d76d0c85345 Make selection of x86 floating point move instruction extensible.
Roland Schatz <roland.schatz@oracle.com>
parents: 10513
diff changeset
253 public void movdbl(AMD64Address dst, Register src) {
18253
edb88f5425e6 switch to using use .equals() instead of == when comparing RegisterCaterory objects for equality
Doug Simon <doug.simon@oracle.com>
parents: 15456
diff changeset
254 assert src.getRegisterCategory().equals(AMD64.XMM);
13265
2d76d0c85345 Make selection of x86 floating point move instruction extensible.
Roland Schatz <roland.schatz@oracle.com>
parents: 10513
diff changeset
255 movsd(dst, src);
2d76d0c85345 Make selection of x86 floating point move instruction extensible.
Roland Schatz <roland.schatz@oracle.com>
parents: 10513
diff changeset
256 }
2d76d0c85345 Make selection of x86 floating point move instruction extensible.
Roland Schatz <roland.schatz@oracle.com>
parents: 10513
diff changeset
257
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
258 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6580
diff changeset
259 * Non-atomic write of a 64-bit constant to memory. Do not use if the address might be a
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6580
diff changeset
260 * volatile field!
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
261 */
7839
838293a77af7 Make Address class platform specific.
Roland Schatz <roland.schatz@oracle.com>
parents: 7822
diff changeset
262 public final void movlong(AMD64Address dst, long src) {
21437
3c66c48a28f3 AMD64MacroAssembler#movlong: use sign-extend 32bit move if possible.
Josef Eisl <josef.eisl@jku.at>
parents: 20085
diff changeset
263 if (NumUtil.isInt(src)) {
3c66c48a28f3 AMD64MacroAssembler#movlong: use sign-extend 32bit move if possible.
Josef Eisl <josef.eisl@jku.at>
parents: 20085
diff changeset
264 AMD64MIOp.MOV.emit(this, OperandSize.QWORD, dst, (int) src);
3c66c48a28f3 AMD64MacroAssembler#movlong: use sign-extend 32bit move if possible.
Josef Eisl <josef.eisl@jku.at>
parents: 20085
diff changeset
265 } else {
3c66c48a28f3 AMD64MacroAssembler#movlong: use sign-extend 32bit move if possible.
Josef Eisl <josef.eisl@jku.at>
parents: 20085
diff changeset
266 AMD64Address high = new AMD64Address(dst.getBase(), dst.getIndex(), dst.getScale(), dst.getDisplacement() + 4);
3c66c48a28f3 AMD64MacroAssembler#movlong: use sign-extend 32bit move if possible.
Josef Eisl <josef.eisl@jku.at>
parents: 20085
diff changeset
267 movl(dst, (int) (src & 0xFFFFFFFF));
3c66c48a28f3 AMD64MacroAssembler#movlong: use sign-extend 32bit move if possible.
Josef Eisl <josef.eisl@jku.at>
parents: 20085
diff changeset
268 movl(high, (int) (src >> 32));
3c66c48a28f3 AMD64MacroAssembler#movlong: use sign-extend 32bit move if possible.
Josef Eisl <josef.eisl@jku.at>
parents: 20085
diff changeset
269 }
3c66c48a28f3 AMD64MacroAssembler#movlong: use sign-extend 32bit move if possible.
Josef Eisl <josef.eisl@jku.at>
parents: 20085
diff changeset
270
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
271 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
272
7822
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
273 public final void flog(Register dest, Register value, boolean base10) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
274 if (base10) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
275 fldlg2();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
276 } else {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
277 fldln2();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
278 }
9581
d84ea522800e replaced arithmetic_[fd]rem stubs with inline compiled code (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9425
diff changeset
279 AMD64Address tmp = trigPrologue(value);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
280 fyl2x();
7822
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
281 trigEpilogue(dest, tmp);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
282 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
283
7822
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
284 public final void fsin(Register dest, Register value) {
7839
838293a77af7 Make Address class platform specific.
Roland Schatz <roland.schatz@oracle.com>
parents: 7822
diff changeset
285 AMD64Address tmp = trigPrologue(value);
7822
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
286 fsin();
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
287 trigEpilogue(dest, tmp);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
288 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
289
7822
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
290 public final void fcos(Register dest, Register value) {
7839
838293a77af7 Make Address class platform specific.
Roland Schatz <roland.schatz@oracle.com>
parents: 7822
diff changeset
291 AMD64Address tmp = trigPrologue(value);
7822
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
292 fcos();
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
293 trigEpilogue(dest, tmp);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
294 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
295
7822
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
296 public final void ftan(Register dest, Register value) {
7839
838293a77af7 Make Address class platform specific.
Roland Schatz <roland.schatz@oracle.com>
parents: 7822
diff changeset
297 AMD64Address tmp = trigPrologue(value);
7822
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
298 fptan();
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
299 fstp(0); // ftan pushes 1.0 in addition to the actual result, pop
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
300 trigEpilogue(dest, tmp);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
301 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
302
9581
d84ea522800e replaced arithmetic_[fd]rem stubs with inline compiled code (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9425
diff changeset
303 public final void fpop() {
d84ea522800e replaced arithmetic_[fd]rem stubs with inline compiled code (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9425
diff changeset
304 ffree(0);
d84ea522800e replaced arithmetic_[fd]rem stubs with inline compiled code (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9425
diff changeset
305 fincstp();
d84ea522800e replaced arithmetic_[fd]rem stubs with inline compiled code (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9425
diff changeset
306 }
d84ea522800e replaced arithmetic_[fd]rem stubs with inline compiled code (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9425
diff changeset
307
7839
838293a77af7 Make Address class platform specific.
Roland Schatz <roland.schatz@oracle.com>
parents: 7822
diff changeset
308 private AMD64Address trigPrologue(Register value) {
18253
edb88f5425e6 switch to using use .equals() instead of == when comparing RegisterCaterory objects for equality
Doug Simon <doug.simon@oracle.com>
parents: 15456
diff changeset
309 assert value.getRegisterCategory().equals(AMD64.XMM);
8167
7f57c30575c8 Make AMD64Address a low-level representation for use by the assembler only.
Roland Schatz <roland.schatz@oracle.com>
parents: 7839
diff changeset
310 AMD64Address tmp = new AMD64Address(AMD64.rsp);
14559
883fbd3e06e0 Make size of PlatformKind overridable by VM specific code.
Roland Schatz <roland.schatz@oracle.com>
parents: 13587
diff changeset
311 subq(AMD64.rsp, target.getSizeInBytes(Kind.Double));
13265
2d76d0c85345 Make selection of x86 floating point move instruction extensible.
Roland Schatz <roland.schatz@oracle.com>
parents: 10513
diff changeset
312 movdbl(tmp, value);
10513
00b70a864d3b updated Checkstyle rules to prohibit underscores in method names and fixed current violations
Doug Simon <doug.simon@oracle.com>
parents: 9756
diff changeset
313 fldd(tmp);
7822
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
314 return tmp;
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
315 }
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
316
7839
838293a77af7 Make Address class platform specific.
Roland Schatz <roland.schatz@oracle.com>
parents: 7822
diff changeset
317 private void trigEpilogue(Register dest, AMD64Address tmp) {
18253
edb88f5425e6 switch to using use .equals() instead of == when comparing RegisterCaterory objects for equality
Doug Simon <doug.simon@oracle.com>
parents: 15456
diff changeset
318 assert dest.getRegisterCategory().equals(AMD64.XMM);
10513
00b70a864d3b updated Checkstyle rules to prohibit underscores in method names and fixed current violations
Doug Simon <doug.simon@oracle.com>
parents: 9756
diff changeset
319 fstpd(tmp);
13265
2d76d0c85345 Make selection of x86 floating point move instruction extensible.
Roland Schatz <roland.schatz@oracle.com>
parents: 10513
diff changeset
320 movdbl(dest, tmp);
14559
883fbd3e06e0 Make size of PlatformKind overridable by VM specific code.
Roland Schatz <roland.schatz@oracle.com>
parents: 13587
diff changeset
321 addq(AMD64.rsp, target.getSizeInBytes(Kind.Double));
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
322 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
323
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
324 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6580
diff changeset
325 * Emit code to save a given set of callee save registers in the {@linkplain CalleeSaveLayout
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6580
diff changeset
326 * CSA} within the frame.
15456
bb97b75d1d65 AMD64: implemented DeoptimizationStub.deoptimizationHandler
twisti
parents: 14559
diff changeset
327 *
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
328 * @param csl the description of the CSA
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
329 * @param frameToCSA offset from the frame pointer to the CSA
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
330 */
7822
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
331 public final void save(CalleeSaveLayout csl, int frameToCSA) {
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5540
diff changeset
332 for (Register r : csl.registers) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
333 int offset = csl.offsetOf(r);
8167
7f57c30575c8 Make AMD64Address a low-level representation for use by the assembler only.
Roland Schatz <roland.schatz@oracle.com>
parents: 7839
diff changeset
334 movq(new AMD64Address(frameRegister, frameToCSA + offset), r);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
335 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
336 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
337
7822
03eec5b7a546 Clean up of AMD64MacroAssembler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7791
diff changeset
338 public final void restore(CalleeSaveLayout csl, int frameToCSA) {
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5540
diff changeset
339 for (Register r : csl.registers) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
340 int offset = csl.offsetOf(r);
8167
7f57c30575c8 Make AMD64Address a low-level representation for use by the assembler only.
Roland Schatz <roland.schatz@oracle.com>
parents: 7839
diff changeset
341 movq(r, new AMD64Address(frameRegister, frameToCSA + offset));
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
342 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
343 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
344 }