annotate graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java @ 20149:b1a8928fc4b9

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