annotate graal/com.oracle.jvmci.asm.sparc/src/com/oracle/jvmci/asm/sparc/SPARCAssembler.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.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java@5024c80224c7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7740
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
18187
9619ba4daf4c Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents: 18163
diff changeset
2 * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
7740
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 *
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
13 * accompanied this code).
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 *
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 *
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
21 * questions.
5f8101629080 Add projects and skeletons for SPARC port.
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.sparc;
7740
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
21708
6df25b1418be moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21673
diff changeset
25 import static com.oracle.jvmci.asm.sparc.SPARCAssembler.CC.*;
6df25b1418be moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21673
diff changeset
26 import static com.oracle.jvmci.asm.sparc.SPARCAssembler.ConditionFlag.*;
6df25b1418be moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21673
diff changeset
27 import static com.oracle.jvmci.asm.sparc.SPARCAssembler.Op.*;
6df25b1418be moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21673
diff changeset
28 import static com.oracle.jvmci.asm.sparc.SPARCAssembler.Op3s.*;
6df25b1418be moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21673
diff changeset
29 import static com.oracle.jvmci.asm.sparc.SPARCAssembler.Opfs.*;
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
30 import static com.oracle.jvmci.sparc.SPARC.*;
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
31 import static java.lang.String.*;
10694
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents: 10686
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 com.oracle.jvmci.asm.*;
6df25b1418be moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21673
diff changeset
34 import com.oracle.jvmci.code.*;
6df25b1418be moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21673
diff changeset
35 import com.oracle.jvmci.meta.*;
6df25b1418be moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21673
diff changeset
36 import com.oracle.jvmci.sparc.*;
6df25b1418be moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21673
diff changeset
37 import com.oracle.jvmci.sparc.SPARC.CPUFeature;
7740
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
38
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
39 /**
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
40 * This class implements an assembler that can encode most SPARC instructions.
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
41 */
14032
d1c1f103d42c renamed com.oracle.graal.asm.AbstractAssembler to com.oracle.graal.asm.Assembler
twisti
parents: 14031
diff changeset
42 public abstract class SPARCAssembler extends Assembler {
10459
f78079947084 some basic SPARC arithmetic works
twisti
parents: 9949
diff changeset
43
10465
699ee4e4f9dc fixed gate warnings
twisti
parents: 10459
diff changeset
44 /**
10686
73122b5edf6a SPARC: Can compile simple methods and do static calls.
twisti
parents: 10564
diff changeset
45 * Constructs an assembler for the SPARC architecture.
15345
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents: 14908
diff changeset
46 *
10465
699ee4e4f9dc fixed gate warnings
twisti
parents: 10459
diff changeset
47 * @param registerConfig the register configuration used to bind {@link Register#Frame} and
699ee4e4f9dc fixed gate warnings
twisti
parents: 10459
diff changeset
48 * {@link Register#CallerFrame} to physical registers. This value can be null if this
699ee4e4f9dc fixed gate warnings
twisti
parents: 10459
diff changeset
49 * assembler instance will not be used to assemble instructions using these logical
699ee4e4f9dc fixed gate warnings
twisti
parents: 10459
diff changeset
50 * registers.
699ee4e4f9dc fixed gate warnings
twisti
parents: 10459
diff changeset
51 */
699ee4e4f9dc fixed gate warnings
twisti
parents: 10459
diff changeset
52 public SPARCAssembler(TargetDescription target, RegisterConfig registerConfig) {
699ee4e4f9dc fixed gate warnings
twisti
parents: 10459
diff changeset
53 super(target);
699ee4e4f9dc fixed gate warnings
twisti
parents: 10459
diff changeset
54 }
699ee4e4f9dc fixed gate warnings
twisti
parents: 10459
diff changeset
55
18844
5e80dd2f1783 Extend emitMul, emitAdd and emitSub in ArithmeticLIRGenerator for explicitly requesting to set the flags register. (In AMD64 flags are set implicitly, but on SPARC it is not)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18717
diff changeset
56 public static final int CCR_ICC_SHIFT = 0;
5e80dd2f1783 Extend emitMul, emitAdd and emitSub in ArithmeticLIRGenerator for explicitly requesting to set the flags register. (In AMD64 flags are set implicitly, but on SPARC it is not)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18717
diff changeset
57 public static final int CCR_XCC_SHIFT = 4;
5e80dd2f1783 Extend emitMul, emitAdd and emitSub in ArithmeticLIRGenerator for explicitly requesting to set the flags register. (In AMD64 flags are set implicitly, but on SPARC it is not)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18717
diff changeset
58 public static final int CCR_C_SHIFT = 0;
5e80dd2f1783 Extend emitMul, emitAdd and emitSub in ArithmeticLIRGenerator for explicitly requesting to set the flags register. (In AMD64 flags are set implicitly, but on SPARC it is not)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18717
diff changeset
59 public static final int CCR_V_SHIFT = 1;
5e80dd2f1783 Extend emitMul, emitAdd and emitSub in ArithmeticLIRGenerator for explicitly requesting to set the flags register. (In AMD64 flags are set implicitly, but on SPARC it is not)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18717
diff changeset
60 public static final int CCR_Z_SHIFT = 2;
5e80dd2f1783 Extend emitMul, emitAdd and emitSub in ArithmeticLIRGenerator for explicitly requesting to set the flags register. (In AMD64 flags are set implicitly, but on SPARC it is not)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18717
diff changeset
61 public static final int CCR_N_SHIFT = 3;
5e80dd2f1783 Extend emitMul, emitAdd and emitSub in ArithmeticLIRGenerator for explicitly requesting to set the flags register. (In AMD64 flags are set implicitly, but on SPARC it is not)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18717
diff changeset
62
19675
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
63 protected static final int OP_SHIFT = 30;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
64 protected static final int CBCOND_SHIFT = 28;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
65 protected static final int OP2_SHIFT = 22;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
66 protected static final int A_SHIFT = 29;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
67
19677
7d3afd4356a2 [SPARC] Remove all object oriented fmt00 instructions (sethi, nop, cbcond) and use simple function calls
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19675
diff changeset
68 protected static final int A_MASK = 0b0010_0000_0000_0000_0000_0000_0000_0000;
7d3afd4356a2 [SPARC] Remove all object oriented fmt00 instructions (sethi, nop, cbcond) and use simple function calls
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19675
diff changeset
69 protected static final int OP_MASK = 0b1100_0000_0000_0000_0000_0000_0000_0000;
7d3afd4356a2 [SPARC] Remove all object oriented fmt00 instructions (sethi, nop, cbcond) and use simple function calls
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19675
diff changeset
70 protected static final int CBCOND_MASK = 0b0001_0000_0000_0000_0000_0000_0000_0000; // Used for
7d3afd4356a2 [SPARC] Remove all object oriented fmt00 instructions (sethi, nop, cbcond) and use simple function calls
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19675
diff changeset
71 // distinguish CBcond and BPr instructions
7d3afd4356a2 [SPARC] Remove all object oriented fmt00 instructions (sethi, nop, cbcond) and use simple function calls
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19675
diff changeset
72 protected static final int OP2_MASK = 0b0000_0001_1100_0000_0000_0000_0000_0000;
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
73
19675
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
74 protected static final int DISP22_SHIFT = 0;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
75 protected static final int DISP22_MASK = 0b00000000001111111111111111111111;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
76
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
77 protected static final int DISP19_SHIFT = 0;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
78 protected static final int DISP19_MASK = 0b00000000000001111111111111111111;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
79
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
80 protected static final int D16HI_SHIFT = 20;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
81 protected static final int D16HI_MASK = 0b0000_0000_0011_0000_0000_0000_0000_0000;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
82 protected static final int D16LO_SHIFT = 0;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
83 protected static final int D16LO_MASK = 0b0000_0000_0000_0000_0011_1111_1111_1111;
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
84
19677
7d3afd4356a2 [SPARC] Remove all object oriented fmt00 instructions (sethi, nop, cbcond) and use simple function calls
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19675
diff changeset
85 protected static final int D10LO_MASK = 0b0000_0000_0000_0000_0001_1111_1110_0000;
7d3afd4356a2 [SPARC] Remove all object oriented fmt00 instructions (sethi, nop, cbcond) and use simple function calls
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19675
diff changeset
86 protected static final int D10HI_MASK = 0b0000_0000_0001_1000_0000_0000_0000_0000;
7d3afd4356a2 [SPARC] Remove all object oriented fmt00 instructions (sethi, nop, cbcond) and use simple function calls
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19675
diff changeset
87 protected static final int D10LO_SHIFT = 5;
7d3afd4356a2 [SPARC] Remove all object oriented fmt00 instructions (sethi, nop, cbcond) and use simple function calls
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19675
diff changeset
88 protected static final int D10HI_SHIFT = 19;
9949
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
89
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
90 public enum Ops {
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
91 // @formatter:off
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
92
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
93 BranchOp(0b00),
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
94 CallOp(0b01),
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
95 ArithOp(0b10),
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
96 LdstOp(0b11);
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
97
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
98 // @formatter:on
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
99
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
100 private final int value;
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
101
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
102 private Ops(int value) {
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
103 this.value = value;
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
104 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
105
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
106 public int getValue() {
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
107 return value;
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
108 }
17177
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
109
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
110 public boolean appliesTo(int instructionWord) {
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
111 int opShift = 30;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
112 return (instructionWord >>> opShift) == value;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
113 }
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
114 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
115
19684
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
116 public enum Op {
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
117 Op00(0b00),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
118 Op01(0b01),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
119 Op10(0b10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
120 Op11(0b11);
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
121 int op;
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
122
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
123 Op(int op) {
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
124 this.op = op;
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
125 }
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
126 }
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
127
9828
5aedcaed6ccf Initial SPARC control instructions
Morris Meyer <morris.meyer@oracle.com>
parents: 9825
diff changeset
128 public enum Op2s {
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
129 // @formatter:off
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
130
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
131 Illtrap(0b000),
16520
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
132 Bpr (0b011),
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
133 Fb (0b110),
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
134 Fbp (0b101),
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
135 Br (0b010),
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
136 Bp (0b001),
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
137 Cb (0b111),
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
138 Sethi (0b100);
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
139
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
140
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
141 // @formatter:on
9828
5aedcaed6ccf Initial SPARC control instructions
Morris Meyer <morris.meyer@oracle.com>
parents: 9825
diff changeset
142
5aedcaed6ccf Initial SPARC control instructions
Morris Meyer <morris.meyer@oracle.com>
parents: 9825
diff changeset
143 private final int value;
5aedcaed6ccf Initial SPARC control instructions
Morris Meyer <morris.meyer@oracle.com>
parents: 9825
diff changeset
144
5aedcaed6ccf Initial SPARC control instructions
Morris Meyer <morris.meyer@oracle.com>
parents: 9825
diff changeset
145 private Op2s(int value) {
5aedcaed6ccf Initial SPARC control instructions
Morris Meyer <morris.meyer@oracle.com>
parents: 9825
diff changeset
146 this.value = value;
5aedcaed6ccf Initial SPARC control instructions
Morris Meyer <morris.meyer@oracle.com>
parents: 9825
diff changeset
147 }
5aedcaed6ccf Initial SPARC control instructions
Morris Meyer <morris.meyer@oracle.com>
parents: 9825
diff changeset
148
5aedcaed6ccf Initial SPARC control instructions
Morris Meyer <morris.meyer@oracle.com>
parents: 9825
diff changeset
149 public int getValue() {
5aedcaed6ccf Initial SPARC control instructions
Morris Meyer <morris.meyer@oracle.com>
parents: 9825
diff changeset
150 return value;
5aedcaed6ccf Initial SPARC control instructions
Morris Meyer <morris.meyer@oracle.com>
parents: 9825
diff changeset
151 }
16520
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
152
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
153 public static Op2s byValue(int value) {
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
154 for (Op2s op : values()) {
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
155 if (op.getValue() == value) {
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
156 return op;
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
157 }
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
158 }
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
159 return null;
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
160 }
9828
5aedcaed6ccf Initial SPARC control instructions
Morris Meyer <morris.meyer@oracle.com>
parents: 9825
diff changeset
161 }
5aedcaed6ccf Initial SPARC control instructions
Morris Meyer <morris.meyer@oracle.com>
parents: 9825
diff changeset
162
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
163 public enum Op3s {
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
164 // @formatter:off
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
165
19684
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
166 Add(0x00, "add", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
167 And(0x01, "and", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
168 Or(0x02, "or", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
169 Xor(0x03, "xor", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
170 Sub(0x04, "sub", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
171 Andn(0x05, "andn", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
172 Orn(0x06, "orn", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
173 Xnor(0x07, "xnor", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
174 Addc(0x08, "addc", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
175 Mulx(0x09, "mulx", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
176 Umul(0x0A, "umul", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
177 Smul(0x0B, "smul", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
178 Subc(0x0C, "subc", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
179 Udivx(0x0D, "udivx", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
180 Udiv(0x0E, "udiv", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
181 Sdiv(0x0F, "sdiv", Op10),
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
182
19684
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
183 Addcc(0x10, "addcc", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
184 Andcc(0x11, "andcc", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
185 Orcc(0x12, "orcc", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
186 Xorcc(0x13, "xorcc", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
187 Subcc(0x14, "subcc", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
188 Andncc(0x15, "andncc", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
189 Orncc(0x16, "orncc", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
190 Xnorcc(0x17, "xnorcc", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
191 Addccc(0x18, "addccc", Op10),
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
192
19684
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
193 Umulcc(0x1A, "umulcc", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
194 Smulcc(0x1B, "smulcc", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
195 Subccc(0x1C, "subccc", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
196 Udivcc(0x1E, "udivcc", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
197 Sdivcc(0x1F, "sdivcc", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
198
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
199 Taddcc(0x20, "taddcc", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
200 Tsubcc(0x21, "tsubcc", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
201 Taddcctv(0x22, "taddcctv", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
202 Tsubcctv(0x23, "tsubcctv", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
203 Mulscc(0x24, "mulscc", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
204 Sll(0x25, "sll", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
205 Sllx(0x25, "sllx", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
206 Srl(0x26, "srl", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
207 Srlx(0x26, "srlx", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
208 Sra(0x27, "srax", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
209 Srax(0x27, "srax", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
210 Membar(0x28, "membar", Op10),
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
211
19684
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
212 Flushw(0x2B, "flushw", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
213 Movcc(0x2C, "movcc", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
214 Sdivx(0x2D, "sdivx", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
215 Popc(0x2E, "popc", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
216 Movr(0x2F, "movr", Op10),
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
217
19684
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
218 Fpop1(0b11_0100, "fpop1", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
219 Fpop2(0b11_0101, "fpop2", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
220 Impdep1(0b11_0110, "impdep1", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
221 Impdep2(0b11_0111, "impdep2", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
222 Jmpl(0x38, "jmpl", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
223 Rett(0x39, "rett", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
224 Trap(0x3a, "trap", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
225 Flush(0x3b, "flush", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
226 Save(0x3c, "save", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
227 Restore(0x3d, "restore", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
228 Retry(0x3e, "retry", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
229
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
230
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
231 Casa(0b111100, "casa", Op11),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
232 Casxa(0b111110, "casxa", Op11),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
233 Prefetch(0b101101, "prefetch", Op11),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
234 Prefetcha(0b111101, "prefetcha", Op11),
9825
81d5d8089cda SPARC float arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9817
diff changeset
235
19684
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
236 Lduw (0b00_0000, "lduw", Op11),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
237 Ldub (0b00_0001, "ldub", Op11),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
238 Lduh (0b00_0010, "lduh", Op11),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
239 Stw (0b00_0100, "stw", Op11),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
240 Stb (0b00_0101, "stb", Op11),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
241 Sth (0b00_0110, "sth", Op11),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
242 Ldsw (0b00_1000, "ldsw", Op11),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
243 Ldsb (0b00_1001, "ldsb", Op11),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
244 Ldsh (0b00_1010, "ldsh", Op11),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
245 Ldx (0b00_1011, "ldx", Op11),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
246 Stx (0b00_1110, "stx", Op11),
16635
d4fe35867b95 [SPARC] Reformatting some enum constants to match better to the SPARC 2011 Architecture manual
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16633
diff changeset
247
19684
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
248 Ldf (0b10_0000, "ldf", Op11),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
249 Ldfsr (0b10_0001, "ldfsr", Op11),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
250 Ldaf (0b10_0010, "ldaf", Op11),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
251 Lddf (0b10_0011, "lddf", Op11),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
252 Stf (0b10_0100, "stf", Op11),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
253 Stfsr (0b10_0101, "stfsr", Op11),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
254 Staf (0x10_0110, "staf", Op11),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
255 Stdf (0b10_0111, "stdf", Op11),
16635
d4fe35867b95 [SPARC] Reformatting some enum constants to match better to the SPARC 2011 Architecture manual
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16633
diff changeset
256
19684
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
257 Rd (0b10_1000, "rd", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
258 Wr (0b11_0000, "wr", Op10),
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
259 Fcmp (0b11_0101, "fcmp", Op10),
16635
d4fe35867b95 [SPARC] Reformatting some enum constants to match better to the SPARC 2011 Architecture manual
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16633
diff changeset
260
19684
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
261 Ldxa (0b01_1011, "ldxa", Op11),
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
262 Lduwa (0b01_0000, "lduwa", Op11),
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
263
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
264 Tcc(0b11_1010, "tcc", Op10);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
265
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
266 // @formatter:on
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
267
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
268 private final int value;
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
269 private final String operator;
19684
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
270 private final Op op;
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
271
19684
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
272 private Op3s(int value, String name, Op op) {
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
273 this.value = value;
19684
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
274 this.operator = name;
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
275 this.op = op;
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
276 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
277
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
278 public int getValue() {
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
279 return value;
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
280 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
281
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
282 public String getOperator() {
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
283 return operator;
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
284 }
17177
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
285
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
286 public boolean appliesTo(int instructionWord) {
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
287 return ((instructionWord >>> 19) & 0b1_1111) == value;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
288 }
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
289 }
7740
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
290
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
291 public enum Opfs {
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
292 // @formatter:off
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
293
15345
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents: 14908
diff changeset
294 Fmovs(0b0_0000_0001, "fmovs"),
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents: 14908
diff changeset
295 Fmovd(0b0_0000_0010, "fmovd"),
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents: 14908
diff changeset
296 Fmovq(0b0_0000_0011, "fmovq"),
17177
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
297 Fmovscc(0b00_0001, "fmovscc"),
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
298 Fmovdcc(0b00_0010, "fmovdcc"),
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
299 Fnegs(0x05, "fnegs"),
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
300 Fnegd(0x06, "fnegd"),
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
301 Fnegq(0x07, "fnegq"),
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
302 Fabss(0x09, "fabss"),
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
303 Fabsd(0x0A, "fabsd"),
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
304 Fabsq(0x0B, "fabsq"),
9949
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
305
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
306 // start VIS1
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
307 Edge8cc(0x0, "edge8cc"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
308 Edge8n(0x1, "edge8n"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
309 Edge8lcc(0x2, "edge8lcc"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
310 Edge8ln(0x3, "edge8ln"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
311 Edge16cc(0x4, "edge16cc"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
312 Edge16n(0x5, "edge16n"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
313 Edge16lcc(0x6, "edge16lcc"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
314 Edge16ln(0x7, "edge16ln"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
315 Edge32cc(0x8, "edge32cc"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
316 Edge32n(0x9, "edge32n"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
317 Edge32lcc(0xA, "edge32lcc"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
318 Edge32ln(0xB, "edge32ln"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
319 Array8(0x10, "array8"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
320 Array16(0x12, "array16"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
321 Array32(0x14, "array32"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
322 AlignAddress(0x18, "alignaddress"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
323 AlignAddressLittle(0x1A, "alignaddress_little"),
10564
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
324 Fpcmple16(0x20, "fpcmple16"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
325 Fpcmpne16(0x22, "fpcmpne16"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
326 Fpcmple32(0x24, "fpcmple32"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
327 Fpcmpne32(0x26, "fpcmpne32"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
328 Fpcmpgt16(0x28, "fpcmpgt16"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
329 Fpcmpeq16(0x2A, "fpcmpeq16"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
330 Fpcmpgt32(0x2C, "fpcmpgt32"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
331 Fpcmpeq32(0x2E, "fpcmpeq32"),
9949
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
332 Fmul8x16(0x31, "fmul8x16"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
333 Fmul8x16au(0x33, "fmul8x16au"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
334 Fmul8x16al(0x35, "fmul8x16al"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
335 Fmul8sux16(0x36, "fmul8sux16"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
336 Fmul8ulx16(0x37, "fmul8ulx16"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
337 Fmuld8sux16(0x38, "fmuld8sux16"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
338 Fmuld8ulx16(0x39, "fmuld8ulx16"),
10564
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
339 Fpack32(0x3A, "fpack32"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
340 Fpack16(0x3B, "fpack16"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
341 Fpackfix(0x3D, "fpackfix"),
9949
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
342 Faligndatag(0x48, "faligndata"),
10564
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
343 Fpmerge(0x4B, "fpmerge"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
344 Fpadd16(0x50, "fpadd16"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
345 Fpadd16s(0x51, "fpadd16s"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
346 Fpadd32(0x52, "fpadd32"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
347 Fpadd32s(0x53, "fpadd32s"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
348 Fpsub16(0x54, "fpadd16"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
349 Fpsub16s(0x55, "fpadd16s"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
350 Fpsub32(0x56, "fpadd32"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
351 Fpsub32s(0x57, "fpadd32s"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
352 Fzerod(0x60, "fzerod"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
353 Fzeros(0x61, "fzeros"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
354 Fnot2d(0x66, "fnot1d"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
355 Fnot2s(0x67, "fnot1s"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
356 Fnot1d(0x6A, "fnot1d"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
357 Fnot1s(0x6B, "fnot1s"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
358 Fsrc1d(0x74, "fsrc1d"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
359 Fsrc1s(0x75, "fsrc1s"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
360 Fsrc2d(0x78, "fsrc2d"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
361 Fsrc2s(0x79, "fsrc2s"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
362 Foned(0x7E, "foned"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
363 Fones(0x7F, "fones"),
16520
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
364 Fandd(0b0_0111_0000, "fandd"),
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
365 Fands(0b0_0111_0001, "fands"),
17116
dced35fd40f7 [SPARC] fix the floatingpoint loading of constant +0.0 and -0.0, changed ArraysCompare more to the C2 implementation.
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17109
diff changeset
366 Fxord(0b0_0110_1100, "fxord"),
17164
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
367 Fxors(0b0_0110_1101, "fxors"),
9949
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
368 // end VIS1
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
369
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
370 // start VIS2
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
371 Bmask(0x19, "bmask"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
372 Bshuffle(0x4c, "bshuffle"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
373 // end VIS2 only
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
374
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
375 // start VIS3
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
376 Addxc(0x11, "addxc"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
377 Addxccc(0x13, "addxccc"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
378 Cmask8(0x1B, "cmask8"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
379 Cmask16(0x1D, "cmask16"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
380 Cmask32(0x1F, "cmask32"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
381 Fmean16(0x40, "fmean16"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
382 Fnadds(0x51, "fnadds"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
383 Fnaddd(0x52, "fnaddd"),
10564
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
384 Fnmuls(0x59, "fnmuls"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
385 Fnmuld(0x5A, "fnmuld"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
386 Fnsmuld(0x79, "fnsmuld"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
387 Fnhadds(0x71, "fnhadds"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
388 Fnhaddd(0x72, "fnhaddd"),
16321
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
389 Movdtox(0x110, "movdtox"),
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
390 Movstouw(0x111, "movstouw"),
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
391 Movstosw(0x113, "movstosw"),
16319
a4bd33d52985 Fixing tests with number conversions, float and double handling. Introducing new VIS3 instructions. Adding testcases.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16317
diff changeset
392 Movxtod(0x118, "movxtod"),
16927
949347518b66 [SPARC] new vis3 instruction umulxhi
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16651
diff changeset
393 Movwtos(0b1_0001_1001, "movwtos"),
949347518b66 [SPARC] new vis3 instruction umulxhi
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16651
diff changeset
394 UMulxhi(0b0_0001_0110, "umulxhi"),
18844
5e80dd2f1783 Extend emitMul, emitAdd and emitSub in ArithmeticLIRGenerator for explicitly requesting to set the flags register. (In AMD64 flags are set implicitly, but on SPARC it is not)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18717
diff changeset
395 Lzcnt (0b0_0001_0111, "lzcnt"),
9949
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
396 // end VIS3
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
397
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
398 // start CAMMELLIA
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
399 CammelliaFl(0x13C, "cammelia_fl"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
400 CammelliaFli(0x13D, "cammellia_fli"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
401 // end CAMMELLIA
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
402
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
403 // start CRYPTO
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
404 Crc32c(0x147, "crc32c"),
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
405 // end CRYPTO
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
406
10564
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
407 // start OSA 2011
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
408 Fpadd64(0x44, "fpadd64"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
409 Fpsub64(0x46, "fpsub64"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
410 Fpadds16(0x58, "fpadds16"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
411 Fpadds16s(0x59, "fpadds16"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
412 Fpadds32(0x5A, "fpadds32"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
413 Fpadds32s(0x5B, "fpadds32s"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
414 Fpsubs16(0x5C, "fpsubs16"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
415 Fpsubs16s(0x5D, "fpsubs16s"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
416 Fpsubs32(0x5E, "fpsubs32"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
417 Fpsubs32s(0x5F, "fpsubs32s"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
418 Fpcmpne8(0x122, "fpcmpne8"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
419 Fpcmpeq8(0x12C, "fpcmpeq8"),
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
420 // end OSA 2011
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
421
9817
26960d32552c SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9816
diff changeset
422 Fadds(0x41, "fadds"),
26960d32552c SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9816
diff changeset
423 Faddd(0x42, "faddd"),
26960d32552c SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9816
diff changeset
424 Faddq(0x43, "faddq"),
26960d32552c SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9816
diff changeset
425 Fsubs(0x45, "fsubs"),
26960d32552c SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9816
diff changeset
426 Fsubd(0x46, "fsubd"),
26960d32552c SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9816
diff changeset
427 Fsubq(0x47, "fsubq"),
9825
81d5d8089cda SPARC float arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9817
diff changeset
428 Fmuls(0x49, "fmuls"),
81d5d8089cda SPARC float arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9817
diff changeset
429 Fmuld(0x4A, "fmuld"),
16317
4b24d2019286 Fixing issues with fdiv
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16315
diff changeset
430 Fdivs(0x4D, "fdivs"),
4b24d2019286 Fixing issues with fdiv
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16315
diff changeset
431 Fdivd(0x4E, "fdivd"),
4b24d2019286 Fixing issues with fdiv
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16315
diff changeset
432 Fdivq(0x4F, "fdivq"),
9825
81d5d8089cda SPARC float arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9817
diff changeset
433
9846
91a1041ec905 SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents: 9845
diff changeset
434 Fsqrts(0x29, "fsqrts"),
91a1041ec905 SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents: 9845
diff changeset
435 Fsqrtd(0x2A, "fsqrtd"),
91a1041ec905 SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents: 9845
diff changeset
436 Fsqrtq(0x2B, "fsqrtq"),
91a1041ec905 SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents: 9845
diff changeset
437
9825
81d5d8089cda SPARC float arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9817
diff changeset
438 Fsmuld(0x69, "fsmuld"),
81d5d8089cda SPARC float arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9817
diff changeset
439 Fmulq(0x6B, "fmulq"),
81d5d8089cda SPARC float arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9817
diff changeset
440 Fdmuldq(0x6E, "fdmulq"),
81d5d8089cda SPARC float arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9817
diff changeset
441
9817
26960d32552c SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9816
diff changeset
442 Fstoi(0xD1, "fstoi"),
16315
b955d649fca8 Fixing BC_i2f, BC_i2c, BC_fadd
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16313
diff changeset
443 Fdtoi(0xD2, "fdtoi"),
16321
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
444 Fstox(0x81, "fstox"),
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
445 Fdtox(0x82, "fdtox"),
16319
a4bd33d52985 Fixing tests with number conversions, float and double handling. Introducing new VIS3 instructions. Adding testcases.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16317
diff changeset
446 Fxtos(0x84, "fxtos"),
a4bd33d52985 Fixing tests with number conversions, float and double handling. Introducing new VIS3 instructions. Adding testcases.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16317
diff changeset
447 Fxtod(0x88, "fxtod"),
a4bd33d52985 Fixing tests with number conversions, float and double handling. Introducing new VIS3 instructions. Adding testcases.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16317
diff changeset
448 Fxtoq(0x8C, "fxtoq"),
a4bd33d52985 Fixing tests with number conversions, float and double handling. Introducing new VIS3 instructions. Adding testcases.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16317
diff changeset
449 Fitos(0xC4, "fitos"),
a4bd33d52985 Fixing tests with number conversions, float and double handling. Introducing new VIS3 instructions. Adding testcases.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16317
diff changeset
450 Fdtos(0xC6, "fdtos"),
a4bd33d52985 Fixing tests with number conversions, float and double handling. Introducing new VIS3 instructions. Adding testcases.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16317
diff changeset
451 Fitod(0xC8, "fitod"),
a4bd33d52985 Fixing tests with number conversions, float and double handling. Introducing new VIS3 instructions. Adding testcases.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16317
diff changeset
452 Fstod(0xC9, "fstod"),
16321
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
453 Fitoq(0xCC, "fitoq"),
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
454
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
455
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
456 Fcmps(0x51, "fcmps"),
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
457 Fcmpd(0x52, "fcmpd"),
18163
c88ab4f1f04a re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents: 17207
diff changeset
458 Fcmpq(0x53, "fcmpq");
c88ab4f1f04a re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents: 17207
diff changeset
459
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
460 // @formatter:on
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
461
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
462 private final int value;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
463 private final String operator;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
464
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
465 private Opfs(int value, String op) {
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
466 this.value = value;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
467 this.operator = op;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
468 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
469
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
470 public int getValue() {
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
471 return value;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
472 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
473
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
474 public String getOperator() {
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
475 return operator;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
476 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
477 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
478
19675
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
479 public enum Annul {
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
480 ANNUL(1),
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
481 NOT_ANNUL(0);
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
482 public final int flag;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
483
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
484 Annul(int flag) {
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
485 this.flag = flag;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
486 }
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
487 }
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
488
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
489 public enum BranchPredict {
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
490 PREDICT_TAKEN(1),
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
491 PREDICT_NOT_TAKEN(0);
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
492 public final int flag;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
493
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
494 BranchPredict(int flag) {
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
495 this.flag = flag;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
496 }
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
497 }
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
498
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
499 public enum MembarMask {
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
500 // @formatter:off
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
501
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
502 StoreStore(1 << 3, "storestore"),
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
503 LoadStore(1 << 2, "loadstore"),
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
504 StoreLoad(1 << 1, "storeload"),
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
505 LoadLoad(1 << 0, "loadload"),
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
506 Sync(1 << 6, "sync"),
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
507 MemIssue(1 << 5, "memissue"),
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
508 LookAside(1 << 4, "lookaside");
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
509
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
510 // @formatter:on
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
511
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
512 private final int value;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
513 private final String operator;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
514
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
515 private MembarMask(int value, String op) {
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
516 this.value = value;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
517 this.operator = op;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
518 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
519
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
520 public int getValue() {
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
521 return value | 0x2000;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
522 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
523
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
524 public String getOperator() {
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
525 return operator;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
526 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
527 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
528
16303
66c7e50a9a32 SPARCMove.java: Adding constant float and double loads
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 14908
diff changeset
529 /**
18163
c88ab4f1f04a re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents: 17207
diff changeset
530 * Condition Codes to use for instruction.
16303
66c7e50a9a32 SPARCMove.java: Adding constant float and double loads
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 14908
diff changeset
531 */
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
532 public enum CC {
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
533 // @formatter:off
16303
66c7e50a9a32 SPARCMove.java: Adding constant float and double loads
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 14908
diff changeset
534 /**
18163
c88ab4f1f04a re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents: 17207
diff changeset
535 * Condition is considered as 32bit operation condition.
16303
66c7e50a9a32 SPARCMove.java: Adding constant float and double loads
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 14908
diff changeset
536 */
19683
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
537 Icc(0b00, "icc", false),
16303
66c7e50a9a32 SPARCMove.java: Adding constant float and double loads
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 14908
diff changeset
538 /**
18163
c88ab4f1f04a re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents: 17207
diff changeset
539 * Condition is considered as 64bit operation condition.
16303
66c7e50a9a32 SPARCMove.java: Adding constant float and double loads
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 14908
diff changeset
540 */
19683
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
541 Xcc(0b10, "xcc", false),
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
542 Fcc0(0b00, "fcc0", true),
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
543 Fcc1(0b01, "fcc1", true),
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
544 Fcc2(0b10, "fcc2", true),
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
545 Fcc3(0b11, "fcc3", true);
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
546
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
547 // @formatter:on
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
548
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
549 private final int value;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
550 private final String operator;
19683
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
551 private boolean isFloat;
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
552
19683
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
553 private CC(int value, String op, boolean isFloat) {
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
554 this.value = value;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
555 this.operator = op;
19683
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
556 this.isFloat = isFloat;
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
557 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
558
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
559 public int getValue() {
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
560 return value;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
561 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
562
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
563 public String getOperator() {
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
564 return operator;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
565 }
19675
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
566
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
567 public static CC forKind(Kind kind) {
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
568 boolean isInt = kind == Kind.Boolean || kind == Kind.Byte || kind == Kind.Char || kind == Kind.Short || kind == Kind.Int;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
569 boolean isFloat = kind == Kind.Float || kind == Kind.Double;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
570 boolean isLong = kind == Kind.Long || kind == Kind.Object;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
571 assert isInt || isFloat || isLong;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
572 if (isLong) {
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
573 return Xcc;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
574 } else if (isInt) {
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
575 return Icc;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
576 } else if (isFloat) {
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
577 return Fcc0;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
578 } else {
21708
6df25b1418be moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21673
diff changeset
579 throw new InternalError();
19675
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
580 }
16321
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
581 }
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
582 }
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
583
9846
91a1041ec905 SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents: 9845
diff changeset
584 public enum ConditionFlag {
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
585 // @formatter:off
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
586
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
587 // for FBfcc & FBPfcc instruction
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
588 F_Never(0, "f_never"),
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
589 F_NotEqual(1, "f_notEqual"),
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
590 F_LessOrGreater(2, "f_lessOrGreater"),
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
591 F_UnorderedOrLess(3, "f_unorderedOrLess"),
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
592 F_Less(4, "f_less"),
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
593 F_UnorderedOrGreater(5, "f_unorderedOrGreater"),
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
594 F_Greater(6, "f_greater"),
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
595 F_Unordered(7, "f_unordered"),
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
596 F_Always(8, "f_always"),
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
597 F_Equal(9, "f_equal"),
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
598 F_UnorderedOrEqual(10, "f_unorderedOrEqual"),
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
599 F_GreaterOrEqual(11, "f_greaterOrEqual"),
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
600 F_UnorderedGreaterOrEqual(12, "f_unorderedGreaterOrEqual"),
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
601 F_LessOrEqual(13, "f_lessOrEqual"),
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
602 F_UnorderedOrLessOrEqual(14, "f_unorderedOrLessOrEqual"),
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
603 F_Ordered(15, "f_ordered"),
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
604
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
605 // for integers
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
606 Never(0, "never"),
17164
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
607 Equal(1, "equal", true),
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
608 Zero(1, "zero"),
17164
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
609 LessEqual(2, "lessEqual", true),
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
610 Less(3, "less", true),
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
611 LessEqualUnsigned(4, "lessEqualUnsigned", true),
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
612 LessUnsigned(5, "lessUnsigned", true),
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
613 CarrySet(5, "carrySet"),
17164
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
614 Negative(6, "negative", true),
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
615 OverflowSet(7, "overflowSet", true),
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
616 Always(8, "always"),
17164
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
617 NotEqual(9, "notEqual", true),
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
618 NotZero(9, "notZero"),
17164
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
619 Greater(10, "greater", true),
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
620 GreaterEqual(11, "greaterEqual", true),
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
621 GreaterUnsigned(12, "greaterUnsigned", true),
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
622 GreaterEqualUnsigned(13, "greaterEqualUnsigned", true),
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
623 CarryClear(13, "carryClear"),
17164
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
624 Positive(14, "positive", true),
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
625 OverflowClear(15, "overflowClear", true);
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
626
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
627 // @formatter:on
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
628
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
629 private final int value;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
630 private final String operator;
17164
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
631 private boolean forCBcond = false;
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
632
9846
91a1041ec905 SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents: 9845
diff changeset
633 private ConditionFlag(int value, String op) {
17164
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
634 this(value, op, false);
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
635 }
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
636
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
637 private ConditionFlag(int value, String op, boolean cbcond) {
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
638 this.value = value;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
639 this.operator = op;
17164
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
640 this.forCBcond = cbcond;
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
641 }
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
642
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
643 public boolean isCBCond() {
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
644 return forCBcond;
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
645 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
646
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
647 public int getValue() {
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
648 return value;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
649 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
650
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
651 public String getOperator() {
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
652 return operator;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
653 }
16927
949347518b66 [SPARC] new vis3 instruction umulxhi
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16651
diff changeset
654
949347518b66 [SPARC] new vis3 instruction umulxhi
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16651
diff changeset
655 public ConditionFlag negate() {
17177
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
656 //@formatter:off
16927
949347518b66 [SPARC] new vis3 instruction umulxhi
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16651
diff changeset
657 switch (this) {
17177
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
658 case F_Never : return F_Always;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
659 case F_Always : return F_Never;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
660 case F_NotEqual : return F_Equal;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
661 case F_Equal : return F_NotEqual;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
662 case F_LessOrGreater : return F_UnorderedOrEqual;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
663 case F_UnorderedOrEqual : return F_LessOrGreater;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
664 case F_Less : return F_UnorderedGreaterOrEqual;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
665 case F_UnorderedGreaterOrEqual: return F_Less;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
666 case F_LessOrEqual : return F_UnorderedOrGreater;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
667 case F_UnorderedOrGreater : return F_LessOrEqual;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
668 case F_Greater : return F_UnorderedOrLessOrEqual;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
669 case F_UnorderedOrLessOrEqual : return F_Greater;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
670 case F_GreaterOrEqual : return F_UnorderedOrLess;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
671 case F_UnorderedOrLess : return F_GreaterOrEqual;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
672 case F_Unordered : return F_Ordered;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
673 case F_Ordered : return F_Unordered;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
674 case Never : return Always;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
675 case Always : return Never;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
676 case Equal : return NotEqual;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
677 case NotEqual : return Equal;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
678 case Zero : return NotZero;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
679 case NotZero : return Zero;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
680 case LessEqual : return Greater;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
681 case Greater : return LessEqual;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
682 case Less : return GreaterEqual;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
683 case GreaterEqual : return Less;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
684 case LessEqualUnsigned : return GreaterUnsigned;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
685 case GreaterUnsigned : return LessEqualUnsigned;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
686 case LessUnsigned : return GreaterEqualUnsigned;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
687 case GreaterEqualUnsigned : return LessUnsigned;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
688 case CarrySet : return CarryClear;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
689 case CarryClear : return CarrySet;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
690 case Negative : return Positive;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
691 case Positive : return Negative;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
692 case OverflowSet : return OverflowClear;
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
693 case OverflowClear : return OverflowSet;
16927
949347518b66 [SPARC] new vis3 instruction umulxhi
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16651
diff changeset
694 default:
21708
6df25b1418be moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21673
diff changeset
695 throw new InternalError();
16927
949347518b66 [SPARC] new vis3 instruction umulxhi
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16651
diff changeset
696 }
17177
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
697 //@formatter:on
16927
949347518b66 [SPARC] new vis3 instruction umulxhi
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16651
diff changeset
698 }
17177
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
699
19675
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
700 public ConditionFlag mirror() {
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
701 switch (this) {
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
702 //@formatter:off
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
703 case F_Less : return F_Greater;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
704 case F_Greater : return F_Less;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
705 case F_LessOrEqual : return F_GreaterOrEqual;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
706 case F_UnorderedGreaterOrEqual: return F_UnorderedOrLessOrEqual;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
707 case F_UnorderedOrGreater : return F_UnorderedOrLess;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
708 case F_UnorderedOrLessOrEqual : return F_UnorderedGreaterOrEqual;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
709 case F_GreaterOrEqual : return F_LessOrEqual;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
710 case F_UnorderedOrLess : return F_UnorderedOrGreater;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
711 case LessEqual : return GreaterEqual;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
712 case Greater : return Less;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
713 case Less : return Greater;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
714 case GreaterEqual : return LessEqual;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
715 case LessEqualUnsigned : return GreaterEqualUnsigned;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
716 case GreaterUnsigned : return LessUnsigned;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
717 case LessUnsigned : return GreaterUnsigned;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
718 case GreaterEqualUnsigned : return LessEqualUnsigned;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
719 default:
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
720 return this;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
721 //@formatter:on
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
722 }
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
723 }
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
724
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
725 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
726
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
727 public enum RCondition {
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
728 // @formatter:off
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
729
17109
1a92d77a851b [SPARC] Implementing ArrayEqualsOp for sparc
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17104
diff changeset
730 Rc_z(0b001, "rc_z"),
1a92d77a851b [SPARC] Implementing ArrayEqualsOp for sparc
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17104
diff changeset
731 Rc_lez(0b010, "rc_lez"),
1a92d77a851b [SPARC] Implementing ArrayEqualsOp for sparc
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17104
diff changeset
732 Rc_lz(0b011, "rc_lz"),
1a92d77a851b [SPARC] Implementing ArrayEqualsOp for sparc
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17104
diff changeset
733 Rc_nz(0b101, "rc_nz"),
1a92d77a851b [SPARC] Implementing ArrayEqualsOp for sparc
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17104
diff changeset
734 Rc_gz(0b110, "rc_gz"),
1a92d77a851b [SPARC] Implementing ArrayEqualsOp for sparc
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17104
diff changeset
735 Rc_gez(0b111, "rc_gez"),
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
736 Rc_last(Rc_gez.getValue(), "rc_last");
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
737
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
738 // @formatter:on
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
739
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
740 private final int value;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
741 private final String operator;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
742
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
743 private RCondition(int value, String op) {
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
744 this.value = value;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
745 this.operator = op;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
746 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
747
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
748 public int getValue() {
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
749 return value;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
750 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
751
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
752 public String getOperator() {
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
753 return operator;
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
754 }
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
755 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
756
16303
66c7e50a9a32 SPARCMove.java: Adding constant float and double loads
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 14908
diff changeset
757 /**
18163
c88ab4f1f04a re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents: 17207
diff changeset
758 * Represents the <b>Address Space Identifier</b> defined in the SPARC architecture.
16303
66c7e50a9a32 SPARCMove.java: Adding constant float and double loads
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 14908
diff changeset
759 */
10792
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
760 public enum Asi {
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
761 // @formatter:off
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
762
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
763 INVALID(-1),
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
764 ASI_PRIMARY(0x80),
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
765 ASI_PRIMARY_NOFAULT(0x82),
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
766 ASI_PRIMARY_LITTLE(0x88),
10792
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
767 // Block initializing store
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
768 ASI_ST_BLKINIT_PRIMARY(0xE2),
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
769 // Most-Recently-Used (MRU) BIS variant
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
770 ASI_ST_BLKINIT_MRU_PRIMARY(0xF2);
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
771
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
772 // @formatter:on
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
773
10792
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
774 private final int value;
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
775
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
776 private Asi(int value) {
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
777 this.value = value;
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
778 }
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
779
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
780 public int getValue() {
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
781 return value;
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
782 }
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
783
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
784 public boolean isValid() {
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
785 return value != INVALID.getValue();
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
786 }
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
787 }
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
788
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
789 public enum Fcn {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
790 SeveralWritesAndPossiblyReads(2),
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
791 SeveralReadsWeak(0),
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
792 OneRead(1),
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
793 OneWrite(3),
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
794 Page(4),
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
795 NearestUnifiedCache(17),
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
796 SeveralReadsStrong(20),
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
797 OneReadStrong(21),
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
798 SeveralWritesAndPossiblyReadsStrong(22),
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
799 OneWriteStrong(23);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
800
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
801 private final int value;
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
802
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
803 private Fcn(int value) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
804 this.value = value;
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
805 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
806
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
807 public int getValue() {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
808 return value;
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
809 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
810 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
811
17144
44a96c7413a7 [SPARC] Gearing up with CBcond instruction
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17117
diff changeset
812 public boolean hasFeature(CPUFeature feature) {
44a96c7413a7 [SPARC] Gearing up with CBcond instruction
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17117
diff changeset
813 return ((SPARC) this.target.arch).features.contains(feature);
44a96c7413a7 [SPARC] Gearing up with CBcond instruction
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17117
diff changeset
814 }
44a96c7413a7 [SPARC] Gearing up with CBcond instruction
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17117
diff changeset
815
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
816 public static final int simm(int x, int nbits) {
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
817 // assert_signed_range(x, nbits);
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
818 return x & ((1 << nbits) - 1);
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
819 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
820
19675
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
821 public static final boolean isImm(int x, int nbits) {
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
822 // assert_signed_range(x, nbits);
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
823 return simm(x, nbits) == x;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
824 }
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
825
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
826 /**
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
827 * Minimum value for signed immediate ranges.
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
828 */
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
829 public static long minSimm(long nbits) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
830 return -(1L << (nbits - 1));
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
831 }
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
832
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
833 /**
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
834 * Maximum value for signed immediate ranges.
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
835 */
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
836 public static long maxSimm(long nbits) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
837 return (1L << (nbits - 1)) - 1;
9831
705aca4ebf2f SPARC array, load / store and compare operations
Morris Meyer <morris.meyer@oracle.com>
parents: 9828
diff changeset
838 }
705aca4ebf2f SPARC array, load / store and compare operations
Morris Meyer <morris.meyer@oracle.com>
parents: 9828
diff changeset
839
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
840 /**
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
841 * Test if imm is within signed immediate range for nbits.
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
842 */
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
843 public static boolean isSimm(long imm, int nbits) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
844 return minSimm(nbits) <= imm && imm <= maxSimm(nbits);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
845 }
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
846
17164
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
847 public static boolean isSimm10(long imm) {
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
848 return isSimm(imm, 10);
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
849 }
5ecd1f298c64 [SPARC] Fix few issues (sign extension) on CBcond instructions, and one typo
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17144
diff changeset
850
17177
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
851 public static boolean isSimm11(long imm) {
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
852 return isSimm(imm, 11);
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
853 }
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
854
18187
9619ba4daf4c Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents: 18163
diff changeset
855 public static boolean isSimm11(JavaConstant constant) {
17207
5a7b82c1514e [SPARC] Add functionality to be able to do assembly in two passes (knowing offsets of forward branches)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17177
diff changeset
856 return constant.isNull() || isSimm11(constant.asLong());
5a7b82c1514e [SPARC] Add functionality to be able to do assembly in two passes (knowing offsets of forward branches)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17177
diff changeset
857 }
5a7b82c1514e [SPARC] Add functionality to be able to do assembly in two passes (knowing offsets of forward branches)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17177
diff changeset
858
18187
9619ba4daf4c Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents: 18163
diff changeset
859 public static boolean isSimm5(JavaConstant constant) {
17207
5a7b82c1514e [SPARC] Add functionality to be able to do assembly in two passes (knowing offsets of forward branches)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17177
diff changeset
860 return constant.isNull() || isSimm(constant.asLong(), 5);
17177
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
861 }
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
862
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
863 public static boolean isSimm13(int imm) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
864 return isSimm(imm, 13);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
865 }
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
866
21022
b4b103d7f46f [SPARC] Fix performance regression with CBcond; Do not use short branch, when constant fits into simm13 but not in simm5
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20968
diff changeset
867 public static boolean isSimm13(JavaConstant constant) {
b4b103d7f46f [SPARC] Fix performance regression with CBcond; Do not use short branch, when constant fits into simm13 but not in simm5
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20968
diff changeset
868 return constant.isNull() || isSimm13(constant.asLong());
b4b103d7f46f [SPARC] Fix performance regression with CBcond; Do not use short branch, when constant fits into simm13 but not in simm5
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20968
diff changeset
869 }
b4b103d7f46f [SPARC] Fix performance regression with CBcond; Do not use short branch, when constant fits into simm13 but not in simm5
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20968
diff changeset
870
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
871 public static boolean isSimm13(long imm) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
872 return NumUtil.isInt(imm) && isSimm(imm, 13);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
873 }
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
874
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
875 public static boolean isWordDisp30(long imm) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
876 return isSimm(imm, 30 + 2);
10694
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents: 10686
diff changeset
877 }
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents: 10686
diff changeset
878
9831
705aca4ebf2f SPARC array, load / store and compare operations
Morris Meyer <morris.meyer@oracle.com>
parents: 9828
diff changeset
879 public static final int hi22(int x) {
10792
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
880 return x >>> 10;
9831
705aca4ebf2f SPARC array, load / store and compare operations
Morris Meyer <morris.meyer@oracle.com>
parents: 9828
diff changeset
881 }
705aca4ebf2f SPARC array, load / store and compare operations
Morris Meyer <morris.meyer@oracle.com>
parents: 9828
diff changeset
882
705aca4ebf2f SPARC array, load / store and compare operations
Morris Meyer <morris.meyer@oracle.com>
parents: 9828
diff changeset
883 public static final int lo10(int x) {
705aca4ebf2f SPARC array, load / store and compare operations
Morris Meyer <morris.meyer@oracle.com>
parents: 9828
diff changeset
884 return x & ((1 << 10) - 1);
705aca4ebf2f SPARC array, load / store and compare operations
Morris Meyer <morris.meyer@oracle.com>
parents: 9828
diff changeset
885 }
705aca4ebf2f SPARC array, load / store and compare operations
Morris Meyer <morris.meyer@oracle.com>
parents: 9828
diff changeset
886
19675
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
887 // @formatter:off
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
888 /**
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
889 * Instruction format for Fmt00 instructions. This abstraction is needed as it
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
890 * makes the patching easier later on.
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
891 * <pre>
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
892 * | 00 | a | op2 | b |
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
893 * |31 30|29 25|24 22|21 0|
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
894 * </pre>
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
895 */
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
896 // @formatter:on
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
897 protected void fmt00(int a, int op2, int b) {
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
898 assert isImm(a, 5) && isImm(op2, 3) && isImm(b, 22) : String.format("a: 0x%x op2: 0x%x b: 0x%x", a, op2, b);
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
899 this.emitInt(a << 25 | op2 << 22 | b);
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
900 }
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
901
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
902 private void op3(Op3s op3, Opfs opf, Register rs1, Register rs2, Register rd) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
903 int b = opf.value << 5 | (rs2 == null ? 0 : rs2.encoding);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
904 fmt(op3.op.op, rd.encoding, op3.value, rs1 == null ? 0 : rs1.encoding, b);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
905 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
906
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
907 protected void op3(Op3s op3, Register rs1, Register rs2, Register rd) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
908 int b = rs2 == null ? 0 : rs2.encoding;
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
909 int xBit = getXBit(op3);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
910 fmt(op3.op.op, rd.encoding, op3.value, rs1 == null ? 0 : rs1.encoding, b | xBit);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
911 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
912
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
913 protected void op3(Op3s op3, Register rs1, int simm13, Register rd) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
914 assert isSimm13(simm13);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
915 int i = 1 << 13;
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
916 int simm13WithX = simm13 | getXBit(op3);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
917 fmt(op3.op.op, rd.encoding, op3.value, rs1.encoding, i | simm13WithX & ((1 << 13) - 1));
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
918 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
919
19675
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
920 // @formatter:off
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
921 /**
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
922 * Branch on Integer Condition Codes.
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
923 * <pre>
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
924 * | 00 |annul| cond| 010 | disp22 |
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
925 * |31 30|29 |28 25|24 22|21 0|
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
926 * </pre>
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
927 */
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
928 // @formatter:on
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
929 public void bicc(ConditionFlag cond, Annul annul, Label l) {
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
930 bcc(Op2s.Br, cond, annul, l);
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
931 }
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
932
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
933 // @formatter:off
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
934 /**
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
935 * Branch on Floating-Point Condition Codes.
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
936 * <pre>
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
937 * | 00 |annul| cond| 110 | disp22 |
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
938 * |31 30|29 |28 25|24 22|21 0|
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
939 * </pre>
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
940 */
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
941 // @formatter:on
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
942 public void fbcc(ConditionFlag cond, Annul annul, Label l) {
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
943 bcc(Op2s.Fb, cond, annul, l);
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
944 }
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
945
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
946 // @formatter:off
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
947 /**
19685
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19684
diff changeset
948 * Branch on (Integer|Floatingpoint) Condition Codes.
19675
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
949 * <pre>
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
950 * | 00 |annul| cond| op2 | disp22 |
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
951 * |31 30|29 |28 25|24 22|21 0|
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
952 * </pre>
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
953 */
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
954 // @formatter:on
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
955 private void bcc(Op2s op2, ConditionFlag cond, Annul annul, Label l) {
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
956 int pos = !l.isBound() ? patchUnbound(l) : (l.position() - position()) / 4;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
957 final int disp = 22;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
958 assert isSimm(pos, disp);
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
959 pos &= (1 << disp) - 1;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
960 int a = (annul.flag << 4) | cond.getValue();
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
961 fmt00(a, op2.getValue(), pos);
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
962 }
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
963
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
964 // @formatter:off
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
965 /**
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
966 * Branch on Integer Condition Codes with Prediction.
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
967 * <pre>
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
968 * | 00 |an|cond | 001 |cc1 2|p | disp19 |
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
969 * |31 30|29|28 25|24 22|21 20|19| 0|
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
970 * </pre>
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
971 */
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
972 // @formatter:on
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
973 public void bpcc(ConditionFlag cond, Annul annul, Label l, CC cc, BranchPredict predictTaken) {
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
974 bpcc(Op2s.Bp, cond, annul, l, cc, predictTaken);
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
975 }
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
976
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
977 // @formatter:off
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
978 /**
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
979 * Branch on Integer Condition Codes with Prediction.
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
980 * <pre>
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
981 * | 00 |an|cond | 101 |cc1 2|p | disp19 |
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
982 * |31 30|29|28 25|24 22|21 20|19| 0|
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
983 * </pre>
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
984 */
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
985 // @formatter:on
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
986 public void fbpcc(ConditionFlag cond, Annul annul, Label l, CC cc, BranchPredict predictTaken) {
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
987 bpcc(Op2s.Fbp, cond, annul, l, cc, predictTaken);
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
988 }
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
989
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
990 // @formatter:off
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
991 /**
19685
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19684
diff changeset
992 * Used for fbpcc (Float) and bpcc (Integer).
19675
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
993 * <pre>
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
994 * | 00 |an|cond | op2 |cc1 2|p | disp19 |
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
995 * |31 30|29|28 25|24 22|21 20|19| 0|
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
996 * </pre>
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
997 */
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
998 // @formatter:on
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
999 private void bpcc(Op2s op2, ConditionFlag cond, Annul annul, Label l, CC cc, BranchPredict predictTaken) {
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1000 int pos = !l.isBound() ? patchUnbound(l) : (l.position() - position()) / 4;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1001 final int disp = 19;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1002 assert isSimm(pos, disp);
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1003 pos &= (1 << disp) - 1;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1004 int a = (annul.flag << 4) | cond.getValue();
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1005 int b = (cc.getValue() << 20) | ((predictTaken.flag) << 19) | pos;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1006 fmt00(a, op2.getValue(), b);
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1007 }
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1008
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1009 // @formatter:off
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1010 /**
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1011 * Branch on Integer Register with Prediction.
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1012 * <pre>
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1013 * | 00 |an| 0|rcond | 011 |d16hi|p | rs1 | d16lo |
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1014 * |31 30|29|28|27 25 |24 22|21 20|19|18 14| 0|
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1015 * </pre>
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1016 */
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1017 // @formatter:on
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1018 public void bpr(RCondition cond, Annul annul, Label l, BranchPredict predictTaken, Register rs1) {
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1019 int pos = !l.isBound() ? patchUnbound(l) : (l.position() - position()) / 4;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1020 final int disp = 16;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1021 assert isSimm(pos, disp);
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1022 pos &= (1 << disp) - 1;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1023 int a = (annul.flag << 4) | cond.getValue();
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1024 int d16hi = (pos >> 13) << 13;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1025 int d16lo = d16hi ^ pos;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1026 int b = (d16hi << 20) | (predictTaken.flag << 19) | (rs1.encoding() << 14) | d16lo;
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1027 fmt00(a, Op2s.Bpr.getValue(), b);
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1028 }
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1029
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1030 private int patchUnbound(Label label) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1031 label.addPatchAt(position());
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1032 return 0;
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1033 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1034
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1035 public void cbcondw(ConditionFlag cf, Register rs1, Register rs2, Label lab) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1036 cbcond(0, 0, cf, rs1, rs2.encoding, lab);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1037 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1038
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1039 public void cbcondw(ConditionFlag cf, Register rs1, int rs2, Label lab) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1040 assert isSimm(rs2, 5);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1041 cbcond(0, 1, cf, rs1, rs2 & ((1 << 5) - 1), lab);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1042 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1043
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1044 public void cbcondx(ConditionFlag cf, Register rs1, Register rs2, Label lab) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1045 cbcond(1, 0, cf, rs1, rs2.encoding, lab);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1046 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1047
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1048 public void cbcondx(ConditionFlag cf, Register rs1, int rs2, Label lab) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1049 assert isSimm(rs2, 5);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1050 cbcond(1, 1, cf, rs1, rs2 & ((1 << 5) - 1), lab);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1051 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1052
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1053 private void cbcond(int cc2, int i, ConditionFlag cf, Register rs1, int rs2, Label l) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1054 int disp10 = !l.isBound() ? patchUnbound(l) : (l.position() - position()) / 4;
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1055 assert isSimm(disp10, 10) && isImm(rs2, 5);
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1056 disp10 &= (1 << 10) - 1;
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1057 final int cLo = cf.value & 0b111;
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1058 final int cHi = cf.value >> 3;
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1059 final int d10Lo = disp10 & ((1 << 8) - 1);
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1060 final int d10Hi = disp10 >> 8;
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1061 int a = cHi << 4 | 0b1000 | cLo;
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1062 int b = cc2 << 21 | d10Hi << D10HI_SHIFT | rs1.encoding << 14 | i << 13 | d10Lo << D10LO_SHIFT | rs2;
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1063 fmt00(a, Op2s.Bpr.value, b);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1064 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1065
19675
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1066 // @formatter:off
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1067 /**
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1068 * NOP.
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1069 * <pre>
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1070 * | 00 |00000| 100 | 0 |
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1071 * |31 30|29 25|24 22|21 0|
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1072 * </pre>
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1073 */
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1074 // @formatter:on
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1075 public void nop() {
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1076 emitInt(1 << 24);
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1077 }
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1078
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1079 public void sethi(int imm22, Register dst) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1080 fmt00(dst.encoding, Op2s.Sethi.value, imm22);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1081 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1082
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1083 // @formatter:off
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1084 /**
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1085 * Instruction format for calls.
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1086 * <pre>
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1087 * | 01 | disp30 |
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1088 * |31 30|29 0|
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1089 * </pre>
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1090 */
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1091 // @formatter:on
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1092 public void call(int disp30) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1093 assert isImm(disp30, 30);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1094 int instr = 1 << 30;
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1095 instr |= disp30;
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1096 emitInt(instr);
19675
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1097 }
413ac504d74e [SPARC] Simplify branch instructions (No more object allocations), Tidy up SPARCControlFlow and SPARCAssembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18844
diff changeset
1098
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1099 public void add(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1100 op3(Add, rs1, rs2, rd);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1101 }
10459
f78079947084 some basic SPARC arithmetic works
twisti
parents: 9949
diff changeset
1102
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1103 public void add(Register rs1, int simm13, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1104 op3(Add, rs1, simm13, rd);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1105 }
10459
f78079947084 some basic SPARC arithmetic works
twisti
parents: 9949
diff changeset
1106
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1107 public void addc(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1108 op3(Addc, rs1, rs2, rd);
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
1109 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
1110
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1111 public void addc(Register rs1, int simm13, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1112 op3(Addc, rs1, simm13, rd);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1113 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1114
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1115 public void addcc(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1116 op3(Addcc, rs1, rs2, rd);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1117 }
10459
f78079947084 some basic SPARC arithmetic works
twisti
parents: 9949
diff changeset
1118
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1119 public void addcc(Register rs1, int simm13, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1120 op3(Addcc, rs1, simm13, rd);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1121 }
10459
f78079947084 some basic SPARC arithmetic works
twisti
parents: 9949
diff changeset
1122
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1123 public void and(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1124 op3(And, rs1, rs2, rd);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1125 }
10459
f78079947084 some basic SPARC arithmetic works
twisti
parents: 9949
diff changeset
1126
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1127 public void and(Register rs1, int simm13, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1128 op3(And, rs1, simm13, rd);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1129 }
10459
f78079947084 some basic SPARC arithmetic works
twisti
parents: 9949
diff changeset
1130
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1131 public void andcc(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1132 op3(Andcc, rs1, rs2, rd);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1133 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1134
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1135 public void andcc(Register rs1, int simm13, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1136 op3(Andcc, rs1, simm13, rd);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1137 }
10459
f78079947084 some basic SPARC arithmetic works
twisti
parents: 9949
diff changeset
1138
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1139 public void andn(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1140 op3(Andn, rs1, rs2, rd);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1141 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1142
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1143 public void andn(Register rs1, int simm13, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1144 op3(Andn, rs1, simm13, rd);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1145 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1146
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1147 public void andncc(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1148 op3(Andncc, rs1, rs2, rd);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1149 }
10459
f78079947084 some basic SPARC arithmetic works
twisti
parents: 9949
diff changeset
1150
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1151 public void andncc(Register rs1, int simm13, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1152 op3(Andncc, rs1, simm13, rd);
16319
a4bd33d52985 Fixing tests with number conversions, float and double handling. Introducing new VIS3 instructions. Adding testcases.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16317
diff changeset
1153 }
a4bd33d52985 Fixing tests with number conversions, float and double handling. Introducing new VIS3 instructions. Adding testcases.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16317
diff changeset
1154
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1155 public void movwtos(Register rs2, Register rd) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1156 assert isSingleFloatRegister(rd) && isCPURegister(rs2) : String.format("%s %s", rs2, rd);
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1157 op3(Impdep1, Movwtos, null, rs2, rd);
16927
949347518b66 [SPARC] new vis3 instruction umulxhi
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16651
diff changeset
1158 }
949347518b66 [SPARC] new vis3 instruction umulxhi
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16651
diff changeset
1159
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1160 public void umulxhi(Register rs1, Register rs2, Register rd) {
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1161 op3(Impdep1, UMulxhi, rs1, rs2, rd);
16319
a4bd33d52985 Fixing tests with number conversions, float and double handling. Introducing new VIS3 instructions. Adding testcases.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16317
diff changeset
1162 }
a4bd33d52985 Fixing tests with number conversions, float and double handling. Introducing new VIS3 instructions. Adding testcases.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16317
diff changeset
1163
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1164 public void fdtos(Register rs2, Register rd) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1165 assert isSingleFloatRegister(rd) && isDoubleFloatRegister(rs2) : String.format("%s %s", rs2, rd);
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1166 op3(Fpop1, Fdtos, null, rs2, rd);
16321
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
1167 }
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
1168
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1169 public void movstouw(Register rs2, Register rd) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1170 assert isSingleFloatRegister(rs2) && isCPURegister(rd) : String.format("%s %s", rs2, rd);
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1171 op3(Impdep1, Movstosw, null, rs2, rd);
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1172 }
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1173
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1174 public void movstosw(Register rs2, Register rd) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1175 assert isSingleFloatRegister(rs2) && isCPURegister(rd) : String.format("%s %s", rs2, rd);
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1176 op3(Impdep1, Movstosw, null, rs2, rd);
16321
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
1177 }
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
1178
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1179 public void movdtox(Register rs2, Register rd) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1180 assert isDoubleFloatRegister(rs2) && isCPURegister(rd) : String.format("%s %s", rs2, rd);
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1181 op3(Impdep1, Movdtox, null, rs2, rd);
16321
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
1182 }
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
1183
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1184 public void movxtod(Register rs2, Register rd) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1185 assert isCPURegister(rs2) && isDoubleFloatRegister(rd) : String.format("%s %s", rs2, rd);
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1186 op3(Impdep1, Movxtod, null, rs2, rd);
9949
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
1187 }
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
1188
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1189 public void fadds(Register rs1, Register rs2, Register rd) {
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1190 op3(Fpop1, Fadds, rs1, rs2, rd);
9949
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
1191 }
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
1192
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1193 public void faddd(Register rs1, Register rs2, Register rd) {
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1194 op3(Fpop1, Faddd, rs1, rs2, rd);
9949
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
1195 }
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
1196
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1197 public void faddq(Register rs1, Register rs2, Register rd) {
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1198 op3(Fpop1, Faddq, rs1, rs2, rd);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1199 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1200
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1201 public void fdivs(Register rs1, Register rs2, Register rd) {
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1202 op3(Fpop1, Fdivs, rs1, rs2, rd);
9825
81d5d8089cda SPARC float arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9817
diff changeset
1203 }
81d5d8089cda SPARC float arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9817
diff changeset
1204
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1205 public void fdivd(Register rs1, Register rs2, Register rd) {
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1206 op3(Fpop1, Fdivd, rs1, rs2, rd);
9949
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
1207 }
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
1208
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1209 public void fmovs(Register rs2, Register rd) {
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1210 op3(Fpop1, Fmovs, null, rs2, rd);
9949
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
1211 }
41511d78546a SPARC UA 2011 assembler changes, bit manipulation synthetics
Morris Meyer <morris.meyer@oracle.com>
parents: 9846
diff changeset
1212
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1213 public void fmovd(Register rs2, Register rd) {
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1214 op3(Fpop1, Fmovd, null, rs2, rd);
16933
f011bf910f34 [SPARC] Fix sign extension, add debug messages to assertions in Assembler, add FSMULD , Entering frame is now possible with > 2k framesize
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16927
diff changeset
1215 }
f011bf910f34 [SPARC] Fix sign extension, add debug messages to assertions in Assembler, add FSMULD , Entering frame is now possible with > 2k framesize
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16927
diff changeset
1216
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1217 public void fmuls(Register rs1, Register rs2, Register rd) {
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1218 op3(Fpop1, Fmuls, rs1, rs2, rd);
10564
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
1219 }
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
1220
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1221 public void fsmuld(Register rs1, Register rs2, Register rd) {
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1222 op3(Fpop1, Fsmuld, rs1, rs2, rd);
10564
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
1223 }
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
1224
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1225 public void fmuld(Register rs1, Register rs2, Register rd) {
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1226 op3(Fpop1, Fmuld, rs1, rs2, rd);
10564
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
1227 }
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
1228
19680
4be296f6eeac [SPARC] Change part of the fpop assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19679
diff changeset
1229 public void fnegs(Register rs2, Register rd) {
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1230 op3(Fpop1, Fnegs, null, rs2, rd);
10564
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
1231 }
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
1232
19680
4be296f6eeac [SPARC] Change part of the fpop assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19679
diff changeset
1233 public void fnegd(Register rs2, Register rd) {
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1234 op3(Fpop1, Fnegd, null, rs2, rd);
19680
4be296f6eeac [SPARC] Change part of the fpop assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19679
diff changeset
1235 }
4be296f6eeac [SPARC] Change part of the fpop assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19679
diff changeset
1236
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1237 /**
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1238 * Helper method to determine if the instruction needs the X bit set.
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1239 */
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1240 private static int getXBit(Op3s op3) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1241 switch (op3) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1242 case Sllx:
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1243 case Srax:
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1244 case Srlx:
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1245 return 1 << 12;
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1246 default:
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1247 return 0;
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1248 }
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1249 }
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1250
19680
4be296f6eeac [SPARC] Change part of the fpop assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19679
diff changeset
1251 public void fstoi(Register rs2, Register rd) {
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1252 op3(Fpop1, Fstoi, null, rs2, rd);
9817
26960d32552c SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9816
diff changeset
1253 }
26960d32552c SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9816
diff changeset
1254
19680
4be296f6eeac [SPARC] Change part of the fpop assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19679
diff changeset
1255 public void fstox(Register rs2, Register rd) {
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1256 op3(Fpop1, Fstox, null, rs2, rd);
16321
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
1257 }
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
1258
19680
4be296f6eeac [SPARC] Change part of the fpop assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19679
diff changeset
1259 public void fdtox(Register rs2, Register rd) {
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1260 op3(Fpop1, Fdtox, null, rs2, rd);
16321
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
1261 }
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
1262
19680
4be296f6eeac [SPARC] Change part of the fpop assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19679
diff changeset
1263 public void fstod(Register rs2, Register rd) {
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1264 op3(Fpop1, Fstod, null, rs2, rd);
19680
4be296f6eeac [SPARC] Change part of the fpop assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19679
diff changeset
1265 }
4be296f6eeac [SPARC] Change part of the fpop assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19679
diff changeset
1266
4be296f6eeac [SPARC] Change part of the fpop assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19679
diff changeset
1267 public void fdtoi(Register rs2, Register rd) {
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1268 op3(Fpop1, Fdtoi, null, rs2, rd);
16319
a4bd33d52985 Fixing tests with number conversions, float and double handling. Introducing new VIS3 instructions. Adding testcases.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16317
diff changeset
1269 }
a4bd33d52985 Fixing tests with number conversions, float and double handling. Introducing new VIS3 instructions. Adding testcases.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16317
diff changeset
1270
19680
4be296f6eeac [SPARC] Change part of the fpop assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19679
diff changeset
1271 public void fitos(Register rs2, Register rd) {
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1272 op3(Fpop1, Fitos, null, rs2, rd);
9817
26960d32552c SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9816
diff changeset
1273 }
26960d32552c SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9816
diff changeset
1274
19680
4be296f6eeac [SPARC] Change part of the fpop assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19679
diff changeset
1275 public void fitod(Register rs2, Register rd) {
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1276 op3(Fpop1, Fitod, null, rs2, rd);
19680
4be296f6eeac [SPARC] Change part of the fpop assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19679
diff changeset
1277 }
4be296f6eeac [SPARC] Change part of the fpop assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19679
diff changeset
1278
4be296f6eeac [SPARC] Change part of the fpop assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19679
diff changeset
1279 public void fxtos(Register rs2, Register rd) {
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1280 op3(Fpop1, Fxtos, null, rs2, rd);
16315
b955d649fca8 Fixing BC_i2f, BC_i2c, BC_fadd
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16313
diff changeset
1281 }
b955d649fca8 Fixing BC_i2f, BC_i2c, BC_fadd
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16313
diff changeset
1282
19680
4be296f6eeac [SPARC] Change part of the fpop assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19679
diff changeset
1283 public void fxtod(Register rs2, Register rd) {
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1284 op3(Fpop1, Fxtod, null, rs2, rd);
16319
a4bd33d52985 Fixing tests with number conversions, float and double handling. Introducing new VIS3 instructions. Adding testcases.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16317
diff changeset
1285 }
a4bd33d52985 Fixing tests with number conversions, float and double handling. Introducing new VIS3 instructions. Adding testcases.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16317
diff changeset
1286
19680
4be296f6eeac [SPARC] Change part of the fpop assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19679
diff changeset
1287 public void fzeros(Register rd) {
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1288 op3(Impdep1, Fzeros, null, null, rd);
17082
f8586d059f9d [SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17029
diff changeset
1289 }
f8586d059f9d [SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17029
diff changeset
1290
19680
4be296f6eeac [SPARC] Change part of the fpop assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19679
diff changeset
1291 public void fzerod(Register rd) {
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1292 op3(Impdep1, Fzerod, null, null, rd);
16319
a4bd33d52985 Fixing tests with number conversions, float and double handling. Introducing new VIS3 instructions. Adding testcases.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16317
diff changeset
1293 }
a4bd33d52985 Fixing tests with number conversions, float and double handling. Introducing new VIS3 instructions. Adding testcases.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16317
diff changeset
1294
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1295 public void flushw() {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1296 op3(Flushw, g0, g0, g0);
10564
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
1297 }
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
1298
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1299 public void fsqrtd(Register rs2, Register rd) {
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1300 op3(Fpop1, Fsqrtd, null, rs2, rd);
10564
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
1301 }
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
1302
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1303 public void fsqrts(Register rs2, Register rd) {
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1304 op3(Fpop1, Fsqrts, null, rs2, rd);
10564
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
1305 }
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
1306
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1307 public void fabss(Register rs2, Register rd) {
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1308 op3(Fpop1, Fabss, null, rs2, rd);
17117
d980377abc6f [SPARC] MathIntrinsic for sqrt and abs
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17116
diff changeset
1309 }
d980377abc6f [SPARC] MathIntrinsic for sqrt and abs
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17116
diff changeset
1310
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1311 public void fabsd(Register rs2, Register rd) {
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1312 op3(Fpop1, Fabsd, null, rs2, rd);
10564
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
1313 }
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
1314
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1315 public void fsubs(Register rs1, Register rs2, Register rd) {
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1316 op3(Fpop1, Fsubs, rs1, rs2, rd);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1317 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1318
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1319 public void fsubd(Register rs1, Register rs2, Register rd) {
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1320 op3(Fpop1, Fsubd, rs1, rs2, rd);
10564
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
1321 }
1b864a1552e0 SPARCAssembler Fmt3p upgrade
Morris Meyer <morris.meyer@oracle.com>
parents: 10468
diff changeset
1322
19679
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1323 // @formatter:off
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1324 /**
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1325 * Instruction format for fcmp.
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1326 * <pre>
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1327 * | 10 | --- |cc1|cc0|desc | rs1 | opf | rs2 |
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1328 * |31 30|29 27|26 |25 |24 19|18 14|13 5|4 0|
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1329 * </pre>
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1330 */
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1331 // @formatter:on
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1332 public void fcmp(CC cc, Opfs opf, Register rs1, Register rs2) {
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1333 int a = cc.value;
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1334 int b = opf.value << 5 | rs2.encoding;
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1335 fmt10(a, Fcmp.value, rs1.encoding, b);
19679
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1336 }
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1337
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1338 // @formatter:off
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1339 /**
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1340 * Instruction format for most arithmetic stuff.
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1341 * <pre>
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1342 * | 10 | rd | op3 | rs1 | b |
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1343 * |31 30|29 25|24 19|18 14|13 0|
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1344 * </pre>
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1345 */
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1346 // @formatter:on
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1347 protected void fmt10(int rd, int op3, int rs1, int b) {
19684
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1348 fmt(0b10, rd, op3, rs1, b);
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1349 }
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1350
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1351 // @formatter:off
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1352 /**
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1353 * Instruction format for most arithmetic stuff.
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1354 * <pre>
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1355 * | op | rd | op3 | rs1 | b |
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1356 * |31 30|29 25|24 19|18 14|13 0|
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1357 * </pre>
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1358 */
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1359 // @formatter:on
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1360 protected void fmt(int op, int rd, int op3, int rs1, int b) {
19679
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1361 assert isImm(rd, 5) && isImm(op3, 6) && isImm(b, 14) : String.format("rd: 0x%x op3: 0x%x b: 0x%x", rd, op3, b);
19684
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1362 int instr = op << 30 | rd << 25 | op3 << 19 | rs1 << 14 | b;
19679
b1b887938753 [SPARC] Change fcmp
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19678
diff changeset
1363 emitInt(instr);
16321
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
1364 }
fac4af29aeb8 [SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16319
diff changeset
1365
19677
7d3afd4356a2 [SPARC] Remove all object oriented fmt00 instructions (sethi, nop, cbcond) and use simple function calls
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19675
diff changeset
1366 public void illtrap(int const22) {
7d3afd4356a2 [SPARC] Remove all object oriented fmt00 instructions (sethi, nop, cbcond) and use simple function calls
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19675
diff changeset
1367 fmt00(0, Op2s.Illtrap.value, const22);
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
1368 }
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
1369
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1370 public void jmpl(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1371 op3(Jmpl, rs1, rs2, rd);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1372 }
10459
f78079947084 some basic SPARC arithmetic works
twisti
parents: 9949
diff changeset
1373
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1374 public void jmpl(Register rs1, int simm13, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1375 op3(Jmpl, rs1, simm13, rd);
9844
2d1687e63484 SPARCMacroAssembler and synthetic instructions
Morris Meyer <morris.meyer@oracle.com>
parents: 9843
diff changeset
1376 }
2d1687e63484 SPARCMacroAssembler and synthetic instructions
Morris Meyer <morris.meyer@oracle.com>
parents: 9843
diff changeset
1377
19683
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1378 public void fmovdcc(ConditionFlag cond, CC cc, Register rs2, Register rd) {
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1379 fmovcc(cond, cc, rs2, rd, Fmovdcc.value);
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1380 }
17177
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
1381
19683
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1382 public void fmovscc(ConditionFlag cond, CC cc, Register rs2, Register rd) {
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1383 fmovcc(cond, cc, rs2, rd, Fmovscc.value);
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1384 }
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1385
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1386 private void fmovcc(ConditionFlag cond, CC cc, Register rs2, Register rd, int opfLow) {
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1387 int opfCC = cc.value;
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1388 int a = opfCC << 11 | opfLow << 5 | rs2.encoding;
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1389 fmt10(rd.encoding, Fpop2.value, cond.value, a);
17177
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
1390 }
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
1391
19683
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1392 public void movcc(ConditionFlag conditionFlag, CC cc, Register rs2, Register rd) {
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1393 movcc(conditionFlag, cc, 0, rs2.encoding, rd);
17177
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
1394 }
805a26002dc7 [SPARC] Implement stuffing of delay slots in branches and calls. Optimized the cmove for integer and fp ops
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17165
diff changeset
1395
19683
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1396 public void movcc(ConditionFlag conditionFlag, CC cc, int simm11, Register rd) {
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1397 assert isSimm11(simm11);
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1398 movcc(conditionFlag, cc, 1, simm11 & ((1 << 11) - 1), rd);
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1399 }
10468
cfbe4f978116 SPARC assembler enhancements and more fixes
twisti
parents: 10465
diff changeset
1400
19683
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1401 private void movcc(ConditionFlag conditionFlag, CC cc, int i, int imm, Register rd) {
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1402 int cc01 = 0b11 & cc.value;
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1403 int cc2 = cc.isFloat ? 0 : 1;
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1404 int a = cc2 << 4 | conditionFlag.value;
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1405 int b = cc01 << 11 | i << 13 | imm;
9459ec57fa73 [SPARC] Change conditional move ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
1406 fmt10(rd.encoding, Movcc.value, a, b);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1407 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1408
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1409 public void mulx(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1410 op3(Mulx, rs1, rs2, rd);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1411 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1412
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1413 public void mulx(Register rs1, int simm13, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1414 op3(Mulx, rs1, simm13, rd);
18844
5e80dd2f1783 Extend emitMul, emitAdd and emitSub in ArithmeticLIRGenerator for explicitly requesting to set the flags register. (In AMD64 flags are set implicitly, but on SPARC it is not)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18717
diff changeset
1415 }
5e80dd2f1783 Extend emitMul, emitAdd and emitSub in ArithmeticLIRGenerator for explicitly requesting to set the flags register. (In AMD64 flags are set implicitly, but on SPARC it is not)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18717
diff changeset
1416
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1417 public void or(Register rs1, Register rs2, Register rd) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1418 assert isCPURegister(rs1, rs2, rd) : String.format("%s %s %s", rs1, rs2, rd);
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1419 op3(Or, rs1, rs2, rd);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1420 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1421
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1422 public void or(Register rs1, int simm13, Register rd) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1423 assert isCPURegister(rs1, rd) : String.format("%s %s", rs1, rd);
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1424 op3(Or, rs1, simm13, rd);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1425 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1426
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1427 public void popc(Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1428 op3(Popc, g0, rs2, rd);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1429 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1430
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1431 public void popc(int simm13, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1432 op3(Popc, g0, simm13, rd);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1433 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1434
19684
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1435 public void prefetch(SPARCAddress addr, Fcn fcn) {
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1436 Register rs1 = addr.getBase();
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1437 if (addr.getIndex().equals(Register.None)) {
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1438 int dis = addr.getDisplacement();
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1439 assert isSimm13(dis);
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1440 fmt(Prefetch.op.op, fcn.value, Prefetch.value, rs1.encoding, 1 << 13 | dis & ((1 << 13) - 1));
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1441 } else {
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1442 Register rs2 = addr.getIndex();
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1443 fmt(Prefetch.op.op, fcn.value, Prefetch.value, rs1.encoding, rs2.encoding);
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1444 }
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1445 }
14013
4347ad3df3d7 make SPARC compile code again
twisti
parents: 12464
diff changeset
1446
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1447 // A.44 Read State Register
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1448
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1449 public void rdpc(Register rd) {
19684
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1450 op3(Rd, r5, g0, rd);
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
1451 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
1452
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1453 public void restore(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1454 op3(Restore, rs1, rs2, rd);
9844
2d1687e63484 SPARCMacroAssembler and synthetic instructions
Morris Meyer <morris.meyer@oracle.com>
parents: 9843
diff changeset
1455 }
2d1687e63484 SPARCMacroAssembler and synthetic instructions
Morris Meyer <morris.meyer@oracle.com>
parents: 9843
diff changeset
1456
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1457 public static final int PC_RETURN_OFFSET = 8;
10459
f78079947084 some basic SPARC arithmetic works
twisti
parents: 9949
diff changeset
1458
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1459 public void save(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1460 op3(Save, rs1, rs2, rd);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1461 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1462
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1463 public void save(Register rs1, int simm13, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1464 op3(Save, rs1, simm13, rd);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1465 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1466
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1467 public void sdivx(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1468 op3(Sdivx, rs1, rs2, rd);
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
1469 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
1470
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1471 public void sdivx(Register rs1, int simm13, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1472 op3(Sdivx, rs1, simm13, rd);
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
1473 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
1474
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1475 public void udivx(Register rs1, Register rs2, Register rd) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1476 op3(Udivx, rs1, rs2, rd);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1477 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1478
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1479 public void udivx(Register rs1, int simm13, Register rd) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1480 op3(Udivx, rs1, simm13, rd);
9831
705aca4ebf2f SPARC array, load / store and compare operations
Morris Meyer <morris.meyer@oracle.com>
parents: 9828
diff changeset
1481 }
705aca4ebf2f SPARC array, load / store and compare operations
Morris Meyer <morris.meyer@oracle.com>
parents: 9828
diff changeset
1482
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1483 public void sll(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1484 op3(Sll, rs1, rs2, rd);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1485 }
10459
f78079947084 some basic SPARC arithmetic works
twisti
parents: 9949
diff changeset
1486
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1487 public void sll(Register rs1, int shcnt32, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1488 assert isImm(shcnt32, 5);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1489 op3(Sll, rs1, shcnt32, rd);
9831
705aca4ebf2f SPARC array, load / store and compare operations
Morris Meyer <morris.meyer@oracle.com>
parents: 9828
diff changeset
1490 }
705aca4ebf2f SPARC array, load / store and compare operations
Morris Meyer <morris.meyer@oracle.com>
parents: 9828
diff changeset
1491
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1492 public void sllx(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1493 op3(Sllx, rs1, rs2, rd);
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
1494 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
1495
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1496 public void sllx(Register rs1, int shcnt64, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1497 assert isImm(shcnt64, 6);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1498 op3(Sllx, rs1, shcnt64, rd);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1499 }
10459
f78079947084 some basic SPARC arithmetic works
twisti
parents: 9949
diff changeset
1500
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1501 public void sra(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1502 op3(Sra, rs1, rs2, rd);
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
1503 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
1504
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1505 public void sra(Register rs1, int simm13, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1506 op3(Sra, rs1, simm13, rd);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1507 }
10459
f78079947084 some basic SPARC arithmetic works
twisti
parents: 9949
diff changeset
1508
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1509 public void srax(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1510 op3(Srax, rs1, rs2, rd);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1511 }
10459
f78079947084 some basic SPARC arithmetic works
twisti
parents: 9949
diff changeset
1512
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1513 public void srax(Register rs1, int shcnt64, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1514 assert isImm(shcnt64, 6);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1515 op3(Srax, rs1, shcnt64, rd);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1516 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1517
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1518 public void srl(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1519 op3(Srl, rs1, rs2, rd);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1520 }
10459
f78079947084 some basic SPARC arithmetic works
twisti
parents: 9949
diff changeset
1521
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1522 public void srl(Register rs1, int simm13, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1523 op3(Srl, rs1, simm13, rd);
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
1524 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
1525
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1526 public void srlx(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1527 op3(Srlx, rs1, rs2, rd);
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
1528 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents: 9695
diff changeset
1529
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1530 public void srlx(Register rs1, int shcnt64, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1531 assert isImm(shcnt64, 6);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1532 op3(Srlx, rs1, shcnt64, rd);
16520
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
1533 }
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
1534
19681
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1535 public void fandd(Register rs1, Register rs2, Register rd) {
32a5dd091f5f [SPARC] Replace fpop instructions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19680
diff changeset
1536 op3(Impdep1, Fandd, rs1, rs2, rd);
16520
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
1537 }
9a07bf8467a6 [SPARC] Implement floatingpoint branch instructions, removing math substitutions for SPARC; fixing problems with constants in debug info (Big/Little Endian problems)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16518
diff changeset
1538
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1539 public void sub(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1540 op3(Sub, rs1, rs2, rd);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1541 }
10459
f78079947084 some basic SPARC arithmetic works
twisti
parents: 9949
diff changeset
1542
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1543 public void sub(Register rs1, int simm13, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1544 op3(Sub, rs1, simm13, rd);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1545 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1546
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1547 public void subcc(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1548 op3(Subcc, rs1, rs2, rd);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1549 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1550
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1551 public void subcc(Register rs1, int simm13, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1552 op3(Subcc, rs1, simm13, rd);
18668
6ace9e5bc384 [SPARC] Fix trap instruction
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18187
diff changeset
1553 }
6ace9e5bc384 [SPARC] Fix trap instruction
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18187
diff changeset
1554
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1555 public void ta(int trap) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1556 tcc(Icc, Always, trap);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1557 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1558
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1559 public void tcc(CC cc, ConditionFlag flag, int trap) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1560 assert isImm(trap, 8);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1561 int b = cc.value << 11;
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1562 b |= 1 << 13;
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1563 b |= trap;
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1564 fmt10(flag.value, Op3s.Tcc.getValue(), 0, b);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1565 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1566
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1567 public void wrccr(Register rs1, Register rs2) {
19684
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1568 op3(Wr, rs1, rs2, r2);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1569 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1570
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1571 public void wrccr(Register rs1, int simm13) {
19684
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19683
diff changeset
1572 op3(Wr, rs1, simm13, r2);
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1573 }
10459
f78079947084 some basic SPARC arithmetic works
twisti
parents: 9949
diff changeset
1574
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1575 public void xor(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1576 op3(Xor, rs1, rs2, rd);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1577 }
10459
f78079947084 some basic SPARC arithmetic works
twisti
parents: 9949
diff changeset
1578
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1579 public void xor(Register rs1, int simm13, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1580 op3(Xor, rs1, simm13, rd);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1581 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1582
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1583 public void xorcc(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1584 op3(Xorcc, rs1, rs2, rd);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1585 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1586
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1587 public void xorcc(Register rs1, int simm13, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1588 op3(Xorcc, rs1, simm13, rd);
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1589 }
10459
f78079947084 some basic SPARC arithmetic works
twisti
parents: 9949
diff changeset
1590
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1591 public void xnor(Register rs1, Register rs2, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1592 op3(Xnor, rs1, rs2, rd);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1593 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1594
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1595 public void xnor(Register rs1, int simm13, Register rd) {
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19681
diff changeset
1596 op3(Xnor, rs1, simm13, rd);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1597 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1598
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1599 /*
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1600 * Load/Store
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1601 */
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1602 protected void ld(Op3s op3, SPARCAddress addr, Register rd, Asi asi) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1603 Register rs1 = addr.getBase();
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1604 if (!addr.getIndex().equals(Register.None)) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1605 Register rs2 = addr.getIndex();
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1606 if (asi != null) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1607 int b = rs2.encoding;
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1608 b |= asi.value << 5;
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1609 fmt(op3.op.op, rd.encoding, op3.value, rs1.encoding, b);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1610 } else {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1611 op3(op3, rs1, rs2, rd);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1612 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1613 } else {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1614 int imm = addr.getDisplacement();
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1615 op3(op3, rs1, imm, rd);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1616 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1617 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1618
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1619 protected void ld(Op3s op3, SPARCAddress addr, Register rd) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1620 ld(op3, addr, rd, null);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1621 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1622
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1623 public void lddf(SPARCAddress src, Register dst) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1624 assert isDoubleFloatRegister(dst) : dst;
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1625 ld(Lddf, src, dst);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1626 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1627
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1628 public void ldf(SPARCAddress src, Register dst) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1629 assert isSingleFloatRegister(dst) : dst;
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1630 ld(Ldf, src, dst);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1631 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1632
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1633 public void lduh(SPARCAddress src, Register dst) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1634 assert isCPURegister(dst) : dst;
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1635 ld(Lduh, src, dst);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1636 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1637
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1638 public void ldsh(SPARCAddress src, Register dst) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1639 assert isCPURegister(dst) : dst;
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1640 ld(Ldsh, src, dst);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1641 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1642
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1643 public void ldub(SPARCAddress src, Register dst) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1644 assert isCPURegister(dst) : dst;
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1645 ld(Ldub, src, dst);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1646 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1647
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1648 public void ldsb(SPARCAddress src, Register dst) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1649 assert isCPURegister(dst) : dst;
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1650 ld(Ldsb, src, dst);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1651 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1652
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1653 public void lduw(SPARCAddress src, Register dst) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1654 assert isCPURegister(dst) : dst;
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1655 ld(Lduw, src, dst);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1656 }
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1657
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1658 public void ldsw(SPARCAddress src, Register dst) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1659 assert isCPURegister(dst) : dst;
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1660 ld(Ldsw, src, dst);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1661 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1662
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1663 public void ldx(SPARCAddress src, Register dst) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1664 assert isCPURegister(dst) : dst;
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1665 ld(Ldx, src, dst);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1666 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1667
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1668 public void ldxa(Register rs1, Register rs2, Register rd, Asi asi) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1669 assert SPARC.isCPURegister(rs1, rs2, rd) : format("%s %s %s", rs1, rs2, rd);
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1670 ld(Ldxa, new SPARCAddress(rs1, rs2), rd, asi);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1671 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1672
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1673 public void lduwa(Register rs1, Register rs2, Register rd, Asi asi) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1674 assert SPARC.isCPURegister(rs1, rs2, rd) : format("%s %s %s", rs1, rs2, rd);
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1675 ld(Lduwa, new SPARCAddress(rs1, rs2), rd, asi);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1676 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1677
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1678 protected void st(Op3s op3, Register rs1, SPARCAddress dest) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1679 ld(op3, dest, rs1);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1680 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1681
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1682 public void stdf(Register rd, SPARCAddress addr) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1683 assert isDoubleFloatRegister(rd) : rd;
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1684 st(Stdf, rd, addr);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1685 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1686
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1687 public void stf(Register rd, SPARCAddress addr) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1688 assert isSingleFloatRegister(rd) : rd;
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1689 st(Stf, rd, addr);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1690 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1691
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1692 public void stb(Register rd, SPARCAddress addr) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1693 assert isCPURegister(rd) : rd;
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1694 st(Stb, rd, addr);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1695 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1696
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1697 public void sth(Register rd, SPARCAddress addr) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1698 assert isCPURegister(rd) : rd;
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1699 st(Sth, rd, addr);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1700 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1701
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1702 public void stw(Register rd, SPARCAddress addr) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1703 assert isCPURegister(rd) : rd;
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1704 st(Stw, rd, addr);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1705 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1706
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1707 public void stx(Register rd, SPARCAddress addr) {
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1708 assert isCPURegister(rd) : rd;
19690
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1709 st(Stx, rd, addr);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1710 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1711
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1712 public void membar(int barriers) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1713 op3(Membar, r15, barriers, g0);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1714 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1715
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1716 public void casa(Register rs1, Register rs2, Register rd, Asi asi) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1717 ld(Casa, new SPARCAddress(rs1, rs2), rd, asi);
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1718 }
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1719
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1720 public void casxa(Register rs1, Register rs2, Register rd, Asi asi) {
268f56a8ce55 [SPARC] Remove unused code from assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19685
diff changeset
1721 ld(Casxa, new SPARCAddress(rs1, rs2), rd, asi);
9695
a39e67ca883b partial SPARC assembler
Morris Meyer <morris.meyer@oracle.com>
parents: 8170
diff changeset
1722 }
20003
422e60a2f4b9 Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19690
diff changeset
1723
422e60a2f4b9 Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19690
diff changeset
1724 @Override
422e60a2f4b9 Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19690
diff changeset
1725 public InstructionCounter getInstructionCounter() {
422e60a2f4b9 Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19690
diff changeset
1726 return new SPARCInstructionCounter(this);
422e60a2f4b9 Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19690
diff changeset
1727 }
422e60a2f4b9 Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19690
diff changeset
1728
422e60a2f4b9 Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19690
diff changeset
1729 public void patchAddImmediate(int position, int simm13) {
422e60a2f4b9 Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19690
diff changeset
1730 int inst = getInt(position);
422e60a2f4b9 Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19690
diff changeset
1731 assert SPARCAssembler.isSimm13(simm13) : simm13;
422e60a2f4b9 Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19690
diff changeset
1732 assert (inst >>> 30) == 0b10 : String.format("0x%x", inst);
422e60a2f4b9 Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19690
diff changeset
1733 assert ((inst >>> 18) & 0b11_1111) == 0 : String.format("0x%x", inst);
422e60a2f4b9 Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19690
diff changeset
1734 assert (inst & (1 << 13)) != 0 : String.format("0x%x", inst);
422e60a2f4b9 Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19690
diff changeset
1735 inst = inst & (~((1 << 13) - 1));
422e60a2f4b9 Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19690
diff changeset
1736 inst |= simm13 & ((1 << 12) - 1);
422e60a2f4b9 Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19690
diff changeset
1737 emitInt(inst, position);
422e60a2f4b9 Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19690
diff changeset
1738 }
20149
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1739
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1740 public void fpadd32(Register rs1, Register rs2, Register rd) {
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1741 op3(Impdep1, Fpadd32, rs1, rs2, rd);
b1a8928fc4b9 [SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20003
diff changeset
1742 }
20968
d3b276db28b8 [SPARC] Use NOP only between CBcond
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20149
diff changeset
1743
d3b276db28b8 [SPARC] Use NOP only between CBcond
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20149
diff changeset
1744 public boolean isCbcond(int i) {
d3b276db28b8 [SPARC] Use NOP only between CBcond
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20149
diff changeset
1745 return (i & 0xC1C00000) == 0xC00000;
d3b276db28b8 [SPARC] Use NOP only between CBcond
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20149
diff changeset
1746 }
7740
5f8101629080 Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1747 }