Mercurial > hg > truffle
annotate graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java @ 19156:247419385312
[SPARC] do not create superfluous copies of variables.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Thu, 05 Feb 2015 10:34:13 +0100 |
parents | cd49455040c1 |
children | 7a300e47cec3 |
rev | line source |
---|---|
7740
5f8101629080
Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
13541 | 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 |
5f8101629080
Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 package com.oracle.graal.compiler.sparc; |
5f8101629080
Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
25 |
9828
5aedcaed6ccf
Initial SPARC control instructions
Morris Meyer <morris.meyer@oracle.com>
parents:
9825
diff
changeset
|
26 import static com.oracle.graal.api.code.ValueUtil.*; |
10686
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
10470
diff
changeset
|
27 import static com.oracle.graal.lir.sparc.SPARCArithmetic.*; |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
28 import static com.oracle.graal.lir.sparc.SPARCBitManipulationOp.IntrinsicOpcode.*; |
10686
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
10470
diff
changeset
|
29 import static com.oracle.graal.lir.sparc.SPARCCompare.*; |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
30 import static com.oracle.graal.lir.sparc.SPARCMathIntrinsicOp.IntrinsicOpcode.*; |
9814
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9739
diff
changeset
|
31 |
10686
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
10470
diff
changeset
|
32 import com.oracle.graal.api.code.*; |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
33 import com.oracle.graal.api.meta.*; |
10459 | 34 import com.oracle.graal.asm.sparc.*; |
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:
17145
diff
changeset
|
35 import com.oracle.graal.asm.sparc.SPARCAssembler.CC; |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
36 import com.oracle.graal.asm.sparc.SPARCAssembler.ConditionFlag; |
15193
96bb07a5d667
Spit up and move GraalInternalError.
Josef Eisl <josef.eisl@jku.at>
parents:
14962
diff
changeset
|
37 import com.oracle.graal.compiler.common.*; |
15200
97eed257999b
Move Condition to graal.compiler.common.
Josef Eisl <josef.eisl@jku.at>
parents:
15193
diff
changeset
|
38 import com.oracle.graal.compiler.common.calc.*; |
18358
2dc0d4dcb709
Separate stamp for metaspace pointers.
Roland Schatz <roland.schatz@oracle.com>
parents:
18187
diff
changeset
|
39 import com.oracle.graal.compiler.common.spi.*; |
9845
204e8f3209e9
SPARCMacroAssembler synthetic instructions and SPARCTestOp
Morris Meyer <morris.meyer@oracle.com>
parents:
9843
diff
changeset
|
40 import com.oracle.graal.lir.*; |
15292
a38d791982e1
Move LIRGenerationResult* to graal.lir.
Josef Eisl <josef.eisl@jku.at>
parents:
15261
diff
changeset
|
41 import com.oracle.graal.lir.gen.*; |
10686
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
10470
diff
changeset
|
42 import com.oracle.graal.lir.sparc.*; |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
43 import com.oracle.graal.lir.sparc.SPARCArithmetic.BinaryRegConst; |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
44 import com.oracle.graal.lir.sparc.SPARCArithmetic.BinaryRegReg; |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
45 import com.oracle.graal.lir.sparc.SPARCArithmetic.MulHighOp; |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
46 import com.oracle.graal.lir.sparc.SPARCArithmetic.RemOp; |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
47 import com.oracle.graal.lir.sparc.SPARCArithmetic.Unary2Op; |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
48 import com.oracle.graal.lir.sparc.SPARCCompare.CompareOp; |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
49 import com.oracle.graal.lir.sparc.SPARCControlFlow.BranchOp; |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
50 import com.oracle.graal.lir.sparc.SPARCControlFlow.CondMoveOp; |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
51 import com.oracle.graal.lir.sparc.SPARCControlFlow.ReturnOp; |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
52 import com.oracle.graal.lir.sparc.SPARCControlFlow.StrategySwitchOp; |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
53 import com.oracle.graal.lir.sparc.SPARCControlFlow.TableSwitchOp; |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
54 import com.oracle.graal.lir.sparc.SPARCMove.LoadAddressOp; |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
55 import com.oracle.graal.lir.sparc.SPARCMove.LoadDataAddressOp; |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
56 import com.oracle.graal.lir.sparc.SPARCMove.MembarOp; |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
57 import com.oracle.graal.lir.sparc.SPARCMove.MoveFpGp; |
17115
9a0bf0c3b21e
[SPARC] Use VIS3 moves between fp and gp registers when available
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17112
diff
changeset
|
58 import com.oracle.graal.lir.sparc.SPARCMove.MoveFpGpVIS3; |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
59 import com.oracle.graal.lir.sparc.SPARCMove.MoveFromRegOp; |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
60 import com.oracle.graal.lir.sparc.SPARCMove.MoveToRegOp; |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
61 import com.oracle.graal.lir.sparc.SPARCMove.StackLoadAddressOp; |
12363
78e5badf4b8e
moved lookupForeignCall() from CodeCacheProvider to ForeignCallsProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
11959
diff
changeset
|
62 import com.oracle.graal.phases.util.*; |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
63 import com.oracle.graal.sparc.*; |
18358
2dc0d4dcb709
Separate stamp for metaspace pointers.
Roland Schatz <roland.schatz@oracle.com>
parents:
18187
diff
changeset
|
64 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
|
65 |
5f8101629080
Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
66 /** |
5f8101629080
Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
67 * This class implements the SPARC specific portion of the LIR generator. |
5f8101629080
Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
68 */ |
10686
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
10470
diff
changeset
|
69 public abstract class SPARCLIRGenerator extends LIRGenerator { |
7740
5f8101629080
Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
70 |
18425
b856446ff7e0
Introduce StackSlotValue and VirtualStackSlot.
Josef Eisl <josef.eisl@jku.at>
parents:
18358
diff
changeset
|
71 private StackSlotValue tmpStackSlot; |
17112
4c9c347fa4da
[SPARC] Renamed member tmp to avoid compiler warnings
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17109
diff
changeset
|
72 |
14121
0ddb3b3665bd
Backed out changeset: 38c881305352
Roland Schatz <roland.schatz@oracle.com>
parents:
14061
diff
changeset
|
73 private class SPARCSpillMoveFactory implements LIR.SpillMoveFactory { |
0ddb3b3665bd
Backed out changeset: 38c881305352
Roland Schatz <roland.schatz@oracle.com>
parents:
14061
diff
changeset
|
74 |
0ddb3b3665bd
Backed out changeset: 38c881305352
Roland Schatz <roland.schatz@oracle.com>
parents:
14061
diff
changeset
|
75 @Override |
0ddb3b3665bd
Backed out changeset: 38c881305352
Roland Schatz <roland.schatz@oracle.com>
parents:
14061
diff
changeset
|
76 public LIRInstruction createMove(AllocatableValue result, Value input) { |
0ddb3b3665bd
Backed out changeset: 38c881305352
Roland Schatz <roland.schatz@oracle.com>
parents:
14061
diff
changeset
|
77 return SPARCLIRGenerator.this.createMove(result, input); |
0ddb3b3665bd
Backed out changeset: 38c881305352
Roland Schatz <roland.schatz@oracle.com>
parents:
14061
diff
changeset
|
78 } |
0ddb3b3665bd
Backed out changeset: 38c881305352
Roland Schatz <roland.schatz@oracle.com>
parents:
14061
diff
changeset
|
79 } |
0ddb3b3665bd
Backed out changeset: 38c881305352
Roland Schatz <roland.schatz@oracle.com>
parents:
14061
diff
changeset
|
80 |
18358
2dc0d4dcb709
Separate stamp for metaspace pointers.
Roland Schatz <roland.schatz@oracle.com>
parents:
18187
diff
changeset
|
81 public SPARCLIRGenerator(LIRKindTool lirKindTool, Providers providers, CallingConvention cc, LIRGenerationResult lirGenRes) { |
2dc0d4dcb709
Separate stamp for metaspace pointers.
Roland Schatz <roland.schatz@oracle.com>
parents:
18187
diff
changeset
|
82 super(lirKindTool, providers, cc, lirGenRes); |
14809
73774616a6b3
Decoupled LIRGenerator and LIRGenerationResult.
Josef Eisl <josef.eisl@jku.at>
parents:
14796
diff
changeset
|
83 lirGenRes.getLIR().setSpillMoveFactory(new SPARCSpillMoveFactory()); |
9814
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9739
diff
changeset
|
84 } |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9739
diff
changeset
|
85 |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9739
diff
changeset
|
86 @Override |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
18149
diff
changeset
|
87 public boolean canInlineConstant(JavaConstant c) { |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
88 switch (c.getKind()) { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
89 case Int: |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
90 return SPARCAssembler.isSimm13(c.asInt()) && !getCodeCache().needsDataPatch(c); |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
91 case Long: |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
92 return SPARCAssembler.isSimm13(c.asLong()) && !getCodeCache().needsDataPatch(c); |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
93 case Object: |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
94 return c.isNull(); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
95 default: |
11233 | 96 return false; |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
97 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
98 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
99 |
14121
0ddb3b3665bd
Backed out changeset: 38c881305352
Roland Schatz <roland.schatz@oracle.com>
parents:
14061
diff
changeset
|
100 protected SPARCLIRInstruction createMove(AllocatableValue dst, Value src) { |
0ddb3b3665bd
Backed out changeset: 38c881305352
Roland Schatz <roland.schatz@oracle.com>
parents:
14061
diff
changeset
|
101 if (src instanceof SPARCAddressValue) { |
0ddb3b3665bd
Backed out changeset: 38c881305352
Roland Schatz <roland.schatz@oracle.com>
parents:
14061
diff
changeset
|
102 return new LoadAddressOp(dst, (SPARCAddressValue) src); |
18436
59e65d3aa2fc
Use StackSlotValue where appropriate.
Josef Eisl <josef.eisl@jku.at>
parents:
18425
diff
changeset
|
103 } else if (isRegister(src) || isStackSlotValue(dst)) { |
14121
0ddb3b3665bd
Backed out changeset: 38c881305352
Roland Schatz <roland.schatz@oracle.com>
parents:
14061
diff
changeset
|
104 return new MoveFromRegOp(dst, src); |
0ddb3b3665bd
Backed out changeset: 38c881305352
Roland Schatz <roland.schatz@oracle.com>
parents:
14061
diff
changeset
|
105 } else { |
0ddb3b3665bd
Backed out changeset: 38c881305352
Roland Schatz <roland.schatz@oracle.com>
parents:
14061
diff
changeset
|
106 return new MoveToRegOp(dst, src); |
0ddb3b3665bd
Backed out changeset: 38c881305352
Roland Schatz <roland.schatz@oracle.com>
parents:
14061
diff
changeset
|
107 } |
0ddb3b3665bd
Backed out changeset: 38c881305352
Roland Schatz <roland.schatz@oracle.com>
parents:
14061
diff
changeset
|
108 } |
0ddb3b3665bd
Backed out changeset: 38c881305352
Roland Schatz <roland.schatz@oracle.com>
parents:
14061
diff
changeset
|
109 |
9814
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9739
diff
changeset
|
110 @Override |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9739
diff
changeset
|
111 public void emitMove(AllocatableValue dst, Value src) { |
14121
0ddb3b3665bd
Backed out changeset: 38c881305352
Roland Schatz <roland.schatz@oracle.com>
parents:
14061
diff
changeset
|
112 append(createMove(dst, src)); |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
113 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
114 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
115 @Override |
14735
c5ee41cf9823
replaced RawDataValue with LIRGeneratorTool.emitData(); accept only ASCII strings in log and VM error messages
Doug Simon <doug.simon@oracle.com>
parents:
14633
diff
changeset
|
116 public void emitData(AllocatableValue dst, byte[] data) { |
15345 | 117 append(new LoadDataAddressOp(dst, data)); |
14735
c5ee41cf9823
replaced RawDataValue with LIRGeneratorTool.emitData(); accept only ASCII strings in log and VM error messages
Doug Simon <doug.simon@oracle.com>
parents:
14633
diff
changeset
|
118 } |
c5ee41cf9823
replaced RawDataValue with LIRGeneratorTool.emitData(); accept only ASCII strings in log and VM error messages
Doug Simon <doug.simon@oracle.com>
parents:
14633
diff
changeset
|
119 |
c5ee41cf9823
replaced RawDataValue with LIRGeneratorTool.emitData(); accept only ASCII strings in log and VM error messages
Doug Simon <doug.simon@oracle.com>
parents:
14633
diff
changeset
|
120 @Override |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
121 public SPARCAddressValue emitAddress(Value base, long displacement, Value index, int scale) { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
122 AllocatableValue baseRegister; |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
123 long finalDisp = displacement; |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
124 if (isConstant(base)) { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
125 if (asConstant(base).isNull()) { |
18717
2206dae9a802
[SPARC] Allow null base register on memory access
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18436
diff
changeset
|
126 baseRegister = SPARC.g0.asValue(); |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
127 } else if (asConstant(base).getKind() != Kind.Object) { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
128 finalDisp += asConstant(base).asLong(); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
129 baseRegister = Value.ILLEGAL; |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
130 } else { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
131 baseRegister = load(base); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
132 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
133 } else { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
134 baseRegister = asAllocatable(base); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
135 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
136 |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
137 AllocatableValue indexRegister; |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
138 if (!index.equals(Value.ILLEGAL) && scale != 0) { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
139 if (isConstant(index)) { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
140 finalDisp += asConstant(index).asLong() * scale; |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
141 indexRegister = Value.ILLEGAL; |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
142 } else { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
143 if (scale != 1) { |
15345 | 144 Value longIndex = index.getKind() == Kind.Long ? index : emitSignExtend(index, 32, 64); |
11233 | 145 if (CodeUtil.isPowerOf2(scale)) { |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
18149
diff
changeset
|
146 indexRegister = emitShl(longIndex, JavaConstant.forLong(CodeUtil.log2(scale))); |
11233 | 147 } else { |
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:
18745
diff
changeset
|
148 indexRegister = emitMul(longIndex, JavaConstant.forLong(scale), false); |
11233 | 149 } |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
150 } else { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
151 indexRegister = asAllocatable(index); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
152 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
153 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
154 } else { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
155 indexRegister = Value.ILLEGAL; |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
156 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
157 |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
158 int displacementInt; |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
159 |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
160 // If we don't have an index register we can use a displacement, otherwise load the |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
161 // displacement into a register and add it to the base. |
17145
d75276c49399
[SPARC] Add a index register, when offset is too large
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17117
diff
changeset
|
162 if (indexRegister.equals(Value.ILLEGAL) && SPARCAssembler.isSimm13(finalDisp)) { |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
163 displacementInt = (int) finalDisp; |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
164 } else { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
165 displacementInt = 0; |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
166 if (baseRegister.equals(Value.ILLEGAL)) { |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
18149
diff
changeset
|
167 baseRegister = load(JavaConstant.forLong(finalDisp)); |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
168 } else { |
15345 | 169 if (finalDisp == 0) { |
170 // Nothing to do. Just use the base register. | |
171 } else { | |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
16092
diff
changeset
|
172 Variable longBaseRegister = newVariable(LIRKind.derivedReference(Kind.Long)); |
15345 | 173 emitMove(longBaseRegister, baseRegister); |
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:
18745
diff
changeset
|
174 baseRegister = emitAdd(longBaseRegister, JavaConstant.forLong(finalDisp), false); |
15345 | 175 } |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
176 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
177 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
178 |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
16092
diff
changeset
|
179 LIRKind resultKind = getAddressKind(base, displacement, index); |
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
16092
diff
changeset
|
180 return new SPARCAddressValue(resultKind, baseRegister, indexRegister, displacementInt); |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
181 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
182 |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
183 protected SPARCAddressValue asAddressValue(Value address) { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
184 if (address instanceof SPARCAddressValue) { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
185 return (SPARCAddressValue) address; |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
186 } else { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
187 return emitAddress(address, 0, Value.ILLEGAL, 0); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
188 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
189 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
190 |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
191 @Override |
19131
cd49455040c1
LIRGeneratorTool: change return type from Value to Variable for most emit methods.
Josef Eisl <josef.eisl@jku.at>
parents:
18976
diff
changeset
|
192 public Variable emitAddress(StackSlotValue address) { |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
16092
diff
changeset
|
193 Variable result = newVariable(LIRKind.value(target().wordKind)); |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
194 append(new StackLoadAddressOp(result, address)); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
195 return result; |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
196 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
197 |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
198 @Override |
14847
c132602c640e
Apply LIRGenerator refactoring to SPARC backend.
Josef Eisl <josef.eisl@jku.at>
parents:
14820
diff
changeset
|
199 public void emitReturn(Value input) { |
14949
b65036798097
Remove visitReturn from NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents:
14850
diff
changeset
|
200 AllocatableValue operand = Value.ILLEGAL; |
b65036798097
Remove visitReturn from NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents:
14850
diff
changeset
|
201 if (input != null) { |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
16092
diff
changeset
|
202 operand = resultOperandFor(input.getLIRKind()); |
14949
b65036798097
Remove visitReturn from NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents:
14850
diff
changeset
|
203 emitMove(operand, input); |
b65036798097
Remove visitReturn from NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents:
14850
diff
changeset
|
204 } |
b65036798097
Remove visitReturn from NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents:
14850
diff
changeset
|
205 append(new ReturnOp(operand)); |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
206 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
207 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
208 @Override |
8293
ae7e78091f03
Cleanup branching and jumps in LIRGenerator: JumpOp/BranchOp do not need a state. In emitBranch, emitNullCheckBranch, emitCompareBranch, emitOverflowCheckBranch and emitIntegerTestBranch both targets are always provided.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8292
diff
changeset
|
209 public void emitJump(LabelRef label) { |
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:
17145
diff
changeset
|
210 append(new SPARCJumpOp(label)); |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
211 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
212 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
213 @Override |
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:
17145
diff
changeset
|
214 public void emitCompareBranch(PlatformKind cmpKind, Value x, Value y, Condition cond, boolean unorderedIsTrue, LabelRef trueDestination, LabelRef falseDestination, |
14962
e4a5b8904695
Support for short and byte compare in AMD64 backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
14949
diff
changeset
|
215 double trueDestinationProbability) { |
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:
17145
diff
changeset
|
216 Variable left; |
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:
17145
diff
changeset
|
217 Value right; |
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:
17145
diff
changeset
|
218 Condition actualCondition = null; |
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:
17145
diff
changeset
|
219 if (isConstant(x)) { |
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:
17145
diff
changeset
|
220 left = load(y); |
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:
17145
diff
changeset
|
221 right = loadNonConst(x); |
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:
17145
diff
changeset
|
222 actualCondition = cond.mirror(); |
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:
17145
diff
changeset
|
223 } else { |
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:
17145
diff
changeset
|
224 left = load(x); |
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:
17145
diff
changeset
|
225 right = loadNonConst(y); |
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:
17145
diff
changeset
|
226 actualCondition = 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:
17145
diff
changeset
|
227 } |
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:
17145
diff
changeset
|
228 SPARCCompare opcode = null; |
11233 | 229 Kind kind = left.getKind().getStackKind(); |
230 switch (kind) { | |
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:
17145
diff
changeset
|
231 case Object: |
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:
17145
diff
changeset
|
232 opcode = ACMP; |
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:
17145
diff
changeset
|
233 break; |
9831
705aca4ebf2f
SPARC array, load / store and compare operations
Morris Meyer <morris.meyer@oracle.com>
parents:
9829
diff
changeset
|
234 case Long: |
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:
17145
diff
changeset
|
235 opcode = LCMP; |
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:
17145
diff
changeset
|
236 break; |
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:
17145
diff
changeset
|
237 case Int: |
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:
17145
diff
changeset
|
238 case Short: |
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:
17145
diff
changeset
|
239 case Char: |
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:
17145
diff
changeset
|
240 case Byte: |
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:
17145
diff
changeset
|
241 opcode = ICMP; |
9831
705aca4ebf2f
SPARC array, load / store and compare operations
Morris Meyer <morris.meyer@oracle.com>
parents:
9829
diff
changeset
|
242 break; |
16524
a08a58d0736b
[SPARC] Emit compareAndSwap for AtomicInteger and AtomicLong, Removing o7 register from usable ones, as this register is always overwritten, when using Call or JumpAndLink instructions in SPARC, even callee does not overwrite explicitly, implicit exception is defined when doing integer division, parameter constraint narrowed to only register on Unary2Op, Fix SPARCTestOp, as it did a compare instead of an and with condition codes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16520
diff
changeset
|
243 case Float: |
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:
17145
diff
changeset
|
244 opcode = FCMP; |
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:
17145
diff
changeset
|
245 break; |
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:
16519
diff
changeset
|
246 case Double: |
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:
17145
diff
changeset
|
247 opcode = DCMP; |
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:
16519
diff
changeset
|
248 break; |
9825
81d5d8089cda
SPARC float arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9817
diff
changeset
|
249 default: |
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:
17145
diff
changeset
|
250 GraalInternalError.shouldNotReachHere(kind.toString()); |
9825
81d5d8089cda
SPARC float arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9817
diff
changeset
|
251 } |
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:
17145
diff
changeset
|
252 append(new SPARCControlFlow.CompareBranchOp(opcode, left, right, actualCondition, trueDestination, falseDestination, kind, unorderedIsTrue, trueDestinationProbability)); |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
253 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
254 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
255 @Override |
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:
18745
diff
changeset
|
256 public void emitOverflowCheckBranch(LabelRef overflow, LabelRef noOverflow, LIRKind cmpLIRKind, double overflowProbability) { |
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:
18745
diff
changeset
|
257 Kind cmpKind = (Kind) cmpLIRKind.getPlatformKind(); |
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:
18745
diff
changeset
|
258 append(new BranchOp(ConditionFlag.OverflowSet, overflow, noOverflow, cmpKind)); |
8210
c64ecb1ef1a9
Create LIRGenerator.emitOverflowCheckBranch in preparation for emitDeoptimizeOnOverflow removal
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8127
diff
changeset
|
259 } |
c64ecb1ef1a9
Create LIRGenerator.emitOverflowCheckBranch in preparation for emitDeoptimizeOnOverflow removal
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8127
diff
changeset
|
260 |
c64ecb1ef1a9
Create LIRGenerator.emitOverflowCheckBranch in preparation for emitDeoptimizeOnOverflow removal
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8127
diff
changeset
|
261 @Override |
13908
8f3cd93813f1
Use branch probability for emitting conditional jump.
Roland Schatz <roland.schatz@oracle.com>
parents:
13907
diff
changeset
|
262 public void emitIntegerTestBranch(Value left, Value right, LabelRef trueDestination, LabelRef falseDestination, double trueDestinationProbability) { |
9845
204e8f3209e9
SPARCMacroAssembler synthetic instructions and SPARCTestOp
Morris Meyer <morris.meyer@oracle.com>
parents:
9843
diff
changeset
|
263 emitIntegerTest(left, right); |
13907
6fc05ad86490
Remove unused 'negated' arguments.
Roland Schatz <roland.schatz@oracle.com>
parents:
13641
diff
changeset
|
264 append(new BranchOp(Condition.EQ, trueDestination, falseDestination, left.getKind().getStackKind())); |
9845
204e8f3209e9
SPARCMacroAssembler synthetic instructions and SPARCTestOp
Morris Meyer <morris.meyer@oracle.com>
parents:
9843
diff
changeset
|
265 } |
204e8f3209e9
SPARCMacroAssembler synthetic instructions and SPARCTestOp
Morris Meyer <morris.meyer@oracle.com>
parents:
9843
diff
changeset
|
266 |
204e8f3209e9
SPARCMacroAssembler synthetic instructions and SPARCTestOp
Morris Meyer <morris.meyer@oracle.com>
parents:
9843
diff
changeset
|
267 private void emitIntegerTest(Value a, Value b) { |
12695
4aec62c32a82
Helper functions for identifying numeric kinds.
Roland Schatz <roland.schatz@oracle.com>
parents:
12656
diff
changeset
|
268 assert a.getKind().isNumericInteger(); |
9845
204e8f3209e9
SPARCMacroAssembler synthetic instructions and SPARCTestOp
Morris Meyer <morris.meyer@oracle.com>
parents:
9843
diff
changeset
|
269 if (LIRValueUtil.isVariable(b)) { |
204e8f3209e9
SPARCMacroAssembler synthetic instructions and SPARCTestOp
Morris Meyer <morris.meyer@oracle.com>
parents:
9843
diff
changeset
|
270 append(new SPARCTestOp(load(b), loadNonConst(a))); |
204e8f3209e9
SPARCMacroAssembler synthetic instructions and SPARCTestOp
Morris Meyer <morris.meyer@oracle.com>
parents:
9843
diff
changeset
|
271 } else { |
204e8f3209e9
SPARCMacroAssembler synthetic instructions and SPARCTestOp
Morris Meyer <morris.meyer@oracle.com>
parents:
9843
diff
changeset
|
272 append(new SPARCTestOp(load(a), loadNonConst(b))); |
204e8f3209e9
SPARCMacroAssembler synthetic instructions and SPARCTestOp
Morris Meyer <morris.meyer@oracle.com>
parents:
9843
diff
changeset
|
273 } |
204e8f3209e9
SPARCMacroAssembler synthetic instructions and SPARCTestOp
Morris Meyer <morris.meyer@oracle.com>
parents:
9843
diff
changeset
|
274 } |
204e8f3209e9
SPARCMacroAssembler synthetic instructions and SPARCTestOp
Morris Meyer <morris.meyer@oracle.com>
parents:
9843
diff
changeset
|
275 |
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:
17145
diff
changeset
|
276 private Value loadSimm11(Value 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:
17145
diff
changeset
|
277 if (isConstant(value)) { |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
18149
diff
changeset
|
278 JavaConstant c = asConstant(value); |
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:
17145
diff
changeset
|
279 if (c.isNull() || SPARCAssembler.isSimm11(c)) { |
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:
17145
diff
changeset
|
280 return 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:
17145
diff
changeset
|
281 } |
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:
17145
diff
changeset
|
282 } |
19156
247419385312
[SPARC] do not create superfluous copies of variables.
Josef Eisl <josef.eisl@jku.at>
parents:
19131
diff
changeset
|
283 return load(value); |
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:
17145
diff
changeset
|
284 } |
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:
17145
diff
changeset
|
285 |
9845
204e8f3209e9
SPARCMacroAssembler synthetic instructions and SPARCTestOp
Morris Meyer <morris.meyer@oracle.com>
parents:
9843
diff
changeset
|
286 @Override |
14962
e4a5b8904695
Support for short and byte compare in AMD64 backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
14949
diff
changeset
|
287 public Variable emitConditionalMove(PlatformKind cmpKind, Value left, Value right, Condition cond, boolean unorderedIsTrue, Value trueValue, Value falseValue) { |
16664
62f295bdea36
[SPARC] Fixing compare of short/char with constants, using half of single float registers as of now, otherwise it would overlap with double registers
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16659
diff
changeset
|
288 boolean mirrored = emitCompare(cmpKind, left, right); |
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:
17145
diff
changeset
|
289 CC conditionFlags; |
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:
17145
diff
changeset
|
290 Value actualTrueValue = trueValue; |
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:
17145
diff
changeset
|
291 Value actualFalseValue = falseValue; |
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:
17145
diff
changeset
|
292 switch ((Kind) left.getLIRKind().getPlatformKind()) { |
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:
17145
diff
changeset
|
293 case Byte: |
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:
17145
diff
changeset
|
294 case Short: |
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:
17145
diff
changeset
|
295 case Char: |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
296 case Int: |
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:
17145
diff
changeset
|
297 conditionFlags = CC.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:
17145
diff
changeset
|
298 actualTrueValue = loadSimm11(trueValue); |
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:
17145
diff
changeset
|
299 actualFalseValue = loadSimm11(falseValue); |
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:
17145
diff
changeset
|
300 break; |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
301 case Object: |
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:
17145
diff
changeset
|
302 case Long: |
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:
17145
diff
changeset
|
303 conditionFlags = CC.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:
17145
diff
changeset
|
304 actualTrueValue = loadSimm11(trueValue); |
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:
17145
diff
changeset
|
305 actualFalseValue = loadSimm11(falseValue); |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
306 break; |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
307 case Float: |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
308 case Double: |
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:
17145
diff
changeset
|
309 conditionFlags = CC.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:
17145
diff
changeset
|
310 actualTrueValue = load(trueValue); // Floats cannot be immediate at all |
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:
17145
diff
changeset
|
311 actualFalseValue = load(falseValue); |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
312 break; |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
313 default: |
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:
17145
diff
changeset
|
314 throw GraalInternalError.shouldNotReachHere(); |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
315 } |
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:
17145
diff
changeset
|
316 Variable result = newVariable(trueValue.getLIRKind()); |
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:
17145
diff
changeset
|
317 ConditionFlag finalCondition = ConditionFlag.fromCondtition(conditionFlags, mirrored ? cond.mirror() : cond, 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:
17145
diff
changeset
|
318 Kind kind = result.getKind().getStackKind(); |
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:
17145
diff
changeset
|
319 append(new CondMoveOp(kind, result, conditionFlags, finalCondition, actualTrueValue, actualFalseValue)); |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
320 return result; |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
321 } |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
322 |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
323 /** |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
324 * This method emits the compare instruction, and may reorder the operands. It returns true if |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
325 * it did so. |
14949
b65036798097
Remove visitReturn from NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents:
14850
diff
changeset
|
326 * |
16664
62f295bdea36
[SPARC] Fixing compare of short/char with constants, using half of single float registers as of now, otherwise it would overlap with double registers
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16659
diff
changeset
|
327 * @param cmpKind Kind how a and b have to be compared |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
328 * @param a the left operand of the comparison |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
329 * @param b the right operand of the comparison |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
330 * @return true if the left and right operands were switched, false otherwise |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
331 */ |
16664
62f295bdea36
[SPARC] Fixing compare of short/char with constants, using half of single float registers as of now, otherwise it would overlap with double registers
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16659
diff
changeset
|
332 protected boolean emitCompare(PlatformKind cmpKind, Value a, Value b) { |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
333 Variable left; |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
334 Value right; |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
335 boolean mirrored; |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
336 if (LIRValueUtil.isVariable(b)) { |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
337 left = load(b); |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
338 right = loadNonConst(a); |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
339 mirrored = true; |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
340 } else { |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
341 left = load(a); |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
342 right = loadNonConst(b); |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
343 mirrored = false; |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
344 } |
16664
62f295bdea36
[SPARC] Fixing compare of short/char with constants, using half of single float registers as of now, otherwise it would overlap with double registers
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16659
diff
changeset
|
345 switch ((Kind) cmpKind) { |
62f295bdea36
[SPARC] Fixing compare of short/char with constants, using half of single float registers as of now, otherwise it would overlap with double registers
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16659
diff
changeset
|
346 case Short: |
62f295bdea36
[SPARC] Fixing compare of short/char with constants, using half of single float registers as of now, otherwise it would overlap with double registers
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16659
diff
changeset
|
347 case Char: |
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:
16932
diff
changeset
|
348 append(new CompareOp(ICMP, emitSignExtend(left, 16, 32), emitSignExtend(right, 16, 32))); |
16664
62f295bdea36
[SPARC] Fixing compare of short/char with constants, using half of single float registers as of now, otherwise it would overlap with double registers
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16659
diff
changeset
|
349 break; |
62f295bdea36
[SPARC] Fixing compare of short/char with constants, using half of single float registers as of now, otherwise it would overlap with double registers
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16659
diff
changeset
|
350 case Byte: |
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:
16932
diff
changeset
|
351 append(new CompareOp(ICMP, emitSignExtend(left, 8, 32), emitSignExtend(right, 8, 32))); |
16664
62f295bdea36
[SPARC] Fixing compare of short/char with constants, using half of single float registers as of now, otherwise it would overlap with double registers
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16659
diff
changeset
|
352 break; |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
353 case Int: |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
354 append(new CompareOp(ICMP, left, right)); |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
355 break; |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
356 case Long: |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
357 append(new CompareOp(LCMP, left, right)); |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
358 break; |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
359 case Object: |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
360 append(new CompareOp(ACMP, left, right)); |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
361 break; |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
362 case Float: |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
363 append(new CompareOp(FCMP, left, right)); |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
364 break; |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
365 case Double: |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
366 append(new CompareOp(DCMP, left, right)); |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
367 break; |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
368 default: |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
369 throw GraalInternalError.shouldNotReachHere(); |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
370 } |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
371 return mirrored; |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
372 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
373 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
374 @Override |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
375 public Variable emitIntegerTestMove(Value left, Value right, Value trueValue, Value falseValue) { |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
376 emitIntegerTest(left, right); |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
16092
diff
changeset
|
377 Variable result = newVariable(trueValue.getLIRKind()); |
15345 | 378 Kind kind = left.getKind().getStackKind(); |
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:
17145
diff
changeset
|
379 CC conditionCode; |
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:
17145
diff
changeset
|
380 switch (kind) { |
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:
17145
diff
changeset
|
381 case Object: |
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:
17145
diff
changeset
|
382 case Long: |
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:
17145
diff
changeset
|
383 conditionCode = CC.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:
17145
diff
changeset
|
384 break; |
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:
17145
diff
changeset
|
385 case Int: |
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:
17145
diff
changeset
|
386 case Short: |
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:
17145
diff
changeset
|
387 case Char: |
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:
17145
diff
changeset
|
388 case Byte: |
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:
17145
diff
changeset
|
389 conditionCode = CC.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:
17145
diff
changeset
|
390 break; |
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:
17145
diff
changeset
|
391 default: |
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:
17145
diff
changeset
|
392 throw GraalInternalError.shouldNotReachHere(); |
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:
17145
diff
changeset
|
393 } |
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:
17145
diff
changeset
|
394 ConditionFlag flag = ConditionFlag.fromCondtition(conditionCode, Condition.EQ, false); |
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:
17145
diff
changeset
|
395 append(new CondMoveOp(kind, result, conditionCode, flag, loadSimm11(trueValue), loadSimm11(falseValue))); |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
396 return result; |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
397 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
398 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
399 @Override |
18976
3faa4f98d5c8
renamed LIRGenerator.emitForeignCall to emitForeignCallOp to avoid confusion
Doug Simon <doug.simon@oracle.com>
parents:
18843
diff
changeset
|
400 protected void emitForeignCallOp(ForeignCallLinkage linkage, Value result, Value[] arguments, Value[] temps, LIRFrameState info) { |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
401 long maxOffset = linkage.getMaxCallTargetOffset(); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
402 if (SPARCAssembler.isWordDisp30(maxOffset)) { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
403 append(new SPARCCall.DirectNearForeignCallOp(linkage, result, arguments, temps, info)); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
404 } else { |
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
10854
diff
changeset
|
405 append(new SPARCCall.DirectFarForeignCallOp(linkage, result, arguments, temps, info)); |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10850
diff
changeset
|
406 } |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
407 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
408 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
409 @Override |
15297
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
15294
diff
changeset
|
410 public void emitStrategySwitch(SwitchStrategy strategy, Variable key, LabelRef[] keyTargets, LabelRef defaultTarget) { |
16932
4d77f938aa02
[SPARC] Exclude AMD64 tests from SPARC testrun, always use tmp register when using StrategySwitch, using registerSaver in EnterUnpackStackFrame, LeaveCurrentStackframe, adding guarantee to load offsets when doing load reg+imm13 when the imm value does not fit in 13 bit, assertions for scratch register usage (tmp/def)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16926
diff
changeset
|
411 append(new StrategySwitchOp(strategy, keyTargets, defaultTarget, key, newVariable(key.getLIRKind()))); |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
412 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
413 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
414 @Override |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
415 protected void emitTableSwitch(int lowKey, LabelRef defaultTarget, LabelRef[] targets, Value key) { |
9828
5aedcaed6ccf
Initial SPARC control instructions
Morris Meyer <morris.meyer@oracle.com>
parents:
9825
diff
changeset
|
416 // Making a copy of the switch value is necessary because jump table destroys the input |
5aedcaed6ccf
Initial SPARC control instructions
Morris Meyer <morris.meyer@oracle.com>
parents:
9825
diff
changeset
|
417 // value |
5aedcaed6ccf
Initial SPARC control instructions
Morris Meyer <morris.meyer@oracle.com>
parents:
9825
diff
changeset
|
418 Variable tmp = emitMove(key); |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
16092
diff
changeset
|
419 append(new TableSwitchOp(lowKey, defaultTarget, targets, tmp, newVariable(LIRKind.value(target().wordKind)))); |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
420 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
421 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
422 @Override |
19131
cd49455040c1
LIRGeneratorTool: change return type from Value to Variable for most emit methods.
Josef Eisl <josef.eisl@jku.at>
parents:
18976
diff
changeset
|
423 public Variable emitBitCount(Value operand) { |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
424 Variable result = newVariable(LIRKind.derive(operand).changeType(Kind.Int)); |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
425 if (operand.getKind().getStackKind() == Kind.Int) { |
11233 | 426 append(new SPARCBitManipulationOp(IPOPCNT, result, asAllocatable(operand), this)); |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
427 } else { |
11233 | 428 append(new SPARCBitManipulationOp(LPOPCNT, result, asAllocatable(operand), this)); |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
429 } |
16092
51ba6c521922
Refactor LIRGeneratorTool methods.
Roland Schatz <roland.schatz@oracle.com>
parents:
15947
diff
changeset
|
430 return result; |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
431 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
432 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
433 @Override |
19131
cd49455040c1
LIRGeneratorTool: change return type from Value to Variable for most emit methods.
Josef Eisl <josef.eisl@jku.at>
parents:
18976
diff
changeset
|
434 public Variable emitBitScanForward(Value operand) { |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
435 Variable result = newVariable(LIRKind.derive(operand).changeType(Kind.Int)); |
11233 | 436 append(new SPARCBitManipulationOp(BSF, result, asAllocatable(operand), this)); |
16092
51ba6c521922
Refactor LIRGeneratorTool methods.
Roland Schatz <roland.schatz@oracle.com>
parents:
15947
diff
changeset
|
437 return result; |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
438 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
439 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
440 @Override |
19131
cd49455040c1
LIRGeneratorTool: change return type from Value to Variable for most emit methods.
Josef Eisl <josef.eisl@jku.at>
parents:
18976
diff
changeset
|
441 public Variable emitBitScanReverse(Value operand) { |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
442 Variable result = newVariable(LIRKind.derive(operand).changeType(Kind.Int)); |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
443 if (operand.getKind().getStackKind() == Kind.Int) { |
11233 | 444 append(new SPARCBitManipulationOp(IBSR, result, asAllocatable(operand), this)); |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
445 } else { |
11233 | 446 append(new SPARCBitManipulationOp(LBSR, result, asAllocatable(operand), this)); |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
447 } |
16092
51ba6c521922
Refactor LIRGeneratorTool methods.
Roland Schatz <roland.schatz@oracle.com>
parents:
15947
diff
changeset
|
448 return result; |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
449 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
450 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
451 @Override |
11290
686d6d99352c
Move MathIntrinsic operations to ArithmeticLIRGenerator.
Roland Schatz <roland.schatz@oracle.com>
parents:
11289
diff
changeset
|
452 public Value emitMathAbs(Value input) { |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
453 Variable result = newVariable(LIRKind.derive(input)); |
17117
d980377abc6f
[SPARC] MathIntrinsic for sqrt and abs
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17115
diff
changeset
|
454 append(new SPARCMathIntrinsicOp(ABS, result, asAllocatable(input))); |
11290
686d6d99352c
Move MathIntrinsic operations to ArithmeticLIRGenerator.
Roland Schatz <roland.schatz@oracle.com>
parents:
11289
diff
changeset
|
455 return result; |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
456 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
457 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
458 @Override |
11290
686d6d99352c
Move MathIntrinsic operations to ArithmeticLIRGenerator.
Roland Schatz <roland.schatz@oracle.com>
parents:
11289
diff
changeset
|
459 public Value emitMathSqrt(Value input) { |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
460 Variable result = newVariable(LIRKind.derive(input)); |
11290
686d6d99352c
Move MathIntrinsic operations to ArithmeticLIRGenerator.
Roland Schatz <roland.schatz@oracle.com>
parents:
11289
diff
changeset
|
461 append(new SPARCMathIntrinsicOp(SQRT, result, asAllocatable(input))); |
686d6d99352c
Move MathIntrinsic operations to ArithmeticLIRGenerator.
Roland Schatz <roland.schatz@oracle.com>
parents:
11289
diff
changeset
|
462 return result; |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
463 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
464 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
465 @Override |
11290
686d6d99352c
Move MathIntrinsic operations to ArithmeticLIRGenerator.
Roland Schatz <roland.schatz@oracle.com>
parents:
11289
diff
changeset
|
466 public Value emitMathLog(Value input, boolean base10) { |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
467 Variable result = newVariable(LIRKind.derive(input)); |
11290
686d6d99352c
Move MathIntrinsic operations to ArithmeticLIRGenerator.
Roland Schatz <roland.schatz@oracle.com>
parents:
11289
diff
changeset
|
468 append(new SPARCMathIntrinsicOp(LOG, result, asAllocatable(input))); |
686d6d99352c
Move MathIntrinsic operations to ArithmeticLIRGenerator.
Roland Schatz <roland.schatz@oracle.com>
parents:
11289
diff
changeset
|
469 return result; |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
470 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
471 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
472 @Override |
11290
686d6d99352c
Move MathIntrinsic operations to ArithmeticLIRGenerator.
Roland Schatz <roland.schatz@oracle.com>
parents:
11289
diff
changeset
|
473 public Value emitMathCos(Value input) { |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
474 Variable result = newVariable(LIRKind.derive(input)); |
11290
686d6d99352c
Move MathIntrinsic operations to ArithmeticLIRGenerator.
Roland Schatz <roland.schatz@oracle.com>
parents:
11289
diff
changeset
|
475 append(new SPARCMathIntrinsicOp(COS, result, asAllocatable(input))); |
686d6d99352c
Move MathIntrinsic operations to ArithmeticLIRGenerator.
Roland Schatz <roland.schatz@oracle.com>
parents:
11289
diff
changeset
|
476 return result; |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
477 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
478 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
479 @Override |
11290
686d6d99352c
Move MathIntrinsic operations to ArithmeticLIRGenerator.
Roland Schatz <roland.schatz@oracle.com>
parents:
11289
diff
changeset
|
480 public Value emitMathSin(Value input) { |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
481 Variable result = newVariable(LIRKind.derive(input)); |
11290
686d6d99352c
Move MathIntrinsic operations to ArithmeticLIRGenerator.
Roland Schatz <roland.schatz@oracle.com>
parents:
11289
diff
changeset
|
482 append(new SPARCMathIntrinsicOp(SIN, result, asAllocatable(input))); |
686d6d99352c
Move MathIntrinsic operations to ArithmeticLIRGenerator.
Roland Schatz <roland.schatz@oracle.com>
parents:
11289
diff
changeset
|
483 return result; |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
484 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
485 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
486 @Override |
11290
686d6d99352c
Move MathIntrinsic operations to ArithmeticLIRGenerator.
Roland Schatz <roland.schatz@oracle.com>
parents:
11289
diff
changeset
|
487 public Value emitMathTan(Value input) { |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
488 Variable result = newVariable(LIRKind.derive(input)); |
11290
686d6d99352c
Move MathIntrinsic operations to ArithmeticLIRGenerator.
Roland Schatz <roland.schatz@oracle.com>
parents:
11289
diff
changeset
|
489 append(new SPARCMathIntrinsicOp(TAN, result, asAllocatable(input))); |
686d6d99352c
Move MathIntrinsic operations to ArithmeticLIRGenerator.
Roland Schatz <roland.schatz@oracle.com>
parents:
11289
diff
changeset
|
490 return result; |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
491 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
492 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
493 @Override |
19131
cd49455040c1
LIRGeneratorTool: change return type from Value to Variable for most emit methods.
Josef Eisl <josef.eisl@jku.at>
parents:
18976
diff
changeset
|
494 public Variable emitByteSwap(Value input) { |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
495 Variable result = newVariable(LIRKind.derive(input)); |
16518
3eb13b910134
[SPARC] Fixing LongBits tests and some implicit exceptions
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16429
diff
changeset
|
496 append(new SPARCByteSwapOp(this, result, input)); |
16092
51ba6c521922
Refactor LIRGeneratorTool methods.
Roland Schatz <roland.schatz@oracle.com>
parents:
15947
diff
changeset
|
497 return result; |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
498 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
499 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
500 @Override |
19131
cd49455040c1
LIRGeneratorTool: change return type from Value to Variable for most emit methods.
Josef Eisl <josef.eisl@jku.at>
parents:
18976
diff
changeset
|
501 public Variable emitArrayEquals(Kind kind, Value array1, Value array2, Value length) { |
17109
1a92d77a851b
[SPARC] Implementing ArrayEqualsOp for sparc
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17105
diff
changeset
|
502 Variable result = newVariable(LIRKind.value(Kind.Int)); |
1a92d77a851b
[SPARC] Implementing ArrayEqualsOp for sparc
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17105
diff
changeset
|
503 append(new SPARCArrayEqualsOp(this, kind, result, load(array1), load(array2), asAllocatable(length))); |
1a92d77a851b
[SPARC] Implementing ArrayEqualsOp for sparc
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17105
diff
changeset
|
504 return result; |
13541 | 505 } |
506 | |
507 @Override | |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
508 public Value emitNegate(Value input) { |
11233 | 509 switch (input.getKind().getStackKind()) { |
16319
a4bd33d52985
Fixing tests with number conversions, float and double handling. Introducing new VIS3 instructions. Adding testcases.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16315
diff
changeset
|
510 case Long: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
511 return emitUnary(LNEG, input); |
9825
81d5d8089cda
SPARC float arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9817
diff
changeset
|
512 case Int: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
513 return emitUnary(INEG, input); |
9825
81d5d8089cda
SPARC float arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9817
diff
changeset
|
514 case Float: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
515 return emitUnary(FNEG, input); |
9825
81d5d8089cda
SPARC float arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9817
diff
changeset
|
516 case Double: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
517 return emitUnary(DNEG, input); |
9825
81d5d8089cda
SPARC float arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9817
diff
changeset
|
518 default: |
81d5d8089cda
SPARC float arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9817
diff
changeset
|
519 throw GraalInternalError.shouldNotReachHere(); |
81d5d8089cda
SPARC float arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9817
diff
changeset
|
520 } |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
521 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
522 |
11355
01269a181628
add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents:
11290
diff
changeset
|
523 @Override |
01269a181628
add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents:
11290
diff
changeset
|
524 public Value emitNot(Value input) { |
01269a181628
add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents:
11290
diff
changeset
|
525 switch (input.getKind().getStackKind()) { |
01269a181628
add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents:
11290
diff
changeset
|
526 case Int: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
527 return emitUnary(INOT, input); |
11355
01269a181628
add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents:
11290
diff
changeset
|
528 case Long: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
529 return emitUnary(LNOT, input); |
11355
01269a181628
add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents:
11290
diff
changeset
|
530 default: |
01269a181628
add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents:
11290
diff
changeset
|
531 throw GraalInternalError.shouldNotReachHere(); |
01269a181628
add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents:
11290
diff
changeset
|
532 } |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
533 } |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
534 |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
535 private Variable emitUnary(SPARCArithmetic op, Value input) { |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
536 Variable result = newVariable(LIRKind.derive(input)); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
537 append(new Unary2Op(op, result, load(input))); |
11355
01269a181628
add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents:
11290
diff
changeset
|
538 return result; |
01269a181628
add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents:
11290
diff
changeset
|
539 } |
01269a181628
add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents:
11290
diff
changeset
|
540 |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
541 private Variable emitBinary(SPARCArithmetic op, boolean commutative, Value a, Value b) { |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
542 return emitBinary(op, commutative, a, b, null); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
543 } |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
544 |
16518
3eb13b910134
[SPARC] Fixing LongBits tests and some implicit exceptions
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16429
diff
changeset
|
545 private Variable emitBinary(SPARCArithmetic op, boolean commutative, Value a, Value b, LIRFrameState state) { |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
546 if (isConstant(b) && canInlineConstant(asConstant(b))) { |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
547 return emitBinaryConst(op, load(a), asConstant(b), state); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
548 } else if (commutative && isConstant(a) && canInlineConstant(asConstant(a))) { |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
549 return emitBinaryConst(op, load(b), asConstant(a), state); |
11233 | 550 } else { |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
551 return emitBinaryVar(op, load(a), load(b), state); |
11233 | 552 } |
553 } | |
554 | |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
18149
diff
changeset
|
555 private Variable emitBinaryConst(SPARCArithmetic op, AllocatableValue a, JavaConstant b, LIRFrameState state) { |
11233 | 556 switch (op) { |
557 case IADD: | |
558 case LADD: | |
559 case ISUB: | |
560 case LSUB: | |
561 case IAND: | |
562 case LAND: | |
563 case IOR: | |
564 case LOR: | |
565 case IXOR: | |
566 case LXOR: | |
567 case IMUL: | |
568 case LMUL: | |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
569 if (canInlineConstant(b)) { |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
570 Variable result = newVariable(LIRKind.derive(a, b)); |
16518
3eb13b910134
[SPARC] Fixing LongBits tests and some implicit exceptions
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16429
diff
changeset
|
571 append(new BinaryRegConst(op, result, a, b, state)); |
11233 | 572 return result; |
573 } | |
9814
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9739
diff
changeset
|
574 break; |
11233 | 575 } |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
576 return emitBinaryVar(op, a, asAllocatable(b), state); |
11233 | 577 } |
578 | |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
579 private Variable emitBinaryVar(SPARCArithmetic op, AllocatableValue a, AllocatableValue b, LIRFrameState state) { |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
580 Variable result = newVariable(LIRKind.derive(a, b)); |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
581 append(new BinaryRegReg(op, result, a, b, state)); |
9814
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9739
diff
changeset
|
582 return result; |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
583 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
584 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
585 @Override |
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:
18745
diff
changeset
|
586 public Variable emitAdd(Value a, Value b, boolean setFlags) { |
11233 | 587 switch (a.getKind().getStackKind()) { |
588 case Int: | |
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:
18745
diff
changeset
|
589 return emitBinary(setFlags ? IADDCC : IADD, true, a, b); |
11233 | 590 case Long: |
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:
18745
diff
changeset
|
591 return emitBinary(setFlags ? LADDCC : LADD, true, a, b); |
11233 | 592 case Float: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
593 return emitBinary(FADD, true, a, b); |
11233 | 594 case Double: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
595 return emitBinary(DADD, true, a, b); |
11233 | 596 default: |
597 throw GraalInternalError.shouldNotReachHere(); | |
598 } | |
599 } | |
600 | |
601 @Override | |
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:
18745
diff
changeset
|
602 public Variable emitSub(Value a, Value b, boolean setFlags) { |
11233 | 603 switch (a.getKind().getStackKind()) { |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
604 case Int: |
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:
18745
diff
changeset
|
605 return emitBinary(setFlags ? ISUBCC : ISUB, false, a, b); |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
606 case Long: |
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:
18745
diff
changeset
|
607 return emitBinary(setFlags ? LSUBCC : LSUB, false, a, b); |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
608 case Float: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
609 return emitBinary(FSUB, false, a, b); |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
610 case Double: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
611 return emitBinary(DSUB, false, a, b); |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
612 default: |
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
613 throw GraalInternalError.shouldNotReachHere("missing: " + a.getKind()); |
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
614 } |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
615 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
616 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
617 @Override |
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:
18745
diff
changeset
|
618 public Variable emitMul(Value a, Value b, boolean setFlags) { |
11233 | 619 switch (a.getKind().getStackKind()) { |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
620 case Int: |
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:
18745
diff
changeset
|
621 return emitBinary(setFlags ? IMULCC : IMUL, true, a, b); |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
622 case Long: |
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:
18745
diff
changeset
|
623 if (setFlags) { |
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:
18745
diff
changeset
|
624 Variable result = newVariable(LIRKind.derive(a, b)); |
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:
18745
diff
changeset
|
625 append(new SPARCLMulccOp(result, a, b, this)); |
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:
18745
diff
changeset
|
626 return result; |
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:
18745
diff
changeset
|
627 } else { |
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:
18745
diff
changeset
|
628 return emitBinary(LMUL, true, a, b); |
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:
18745
diff
changeset
|
629 } |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
630 case Float: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
631 return emitBinary(FMUL, true, a, b); |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
632 case Double: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
633 return emitBinary(DMUL, true, a, b); |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
634 default: |
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
635 throw GraalInternalError.shouldNotReachHere("missing: " + a.getKind()); |
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
636 } |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
637 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
638 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
639 @Override |
15691
6a13c422fca4
API for high word multiplication.
Roland Schatz <roland.schatz@oracle.com>
parents:
15345
diff
changeset
|
640 public Value emitMulHigh(Value a, Value b) { |
16926
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
641 switch (a.getKind().getStackKind()) { |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
642 case Int: |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
643 return emitMulHigh(IMUL, a, b); |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
644 case Long: |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
645 return emitMulHigh(LMUL, a, b); |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
646 default: |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
647 throw GraalInternalError.shouldNotReachHere(); |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
648 } |
15691
6a13c422fca4
API for high word multiplication.
Roland Schatz <roland.schatz@oracle.com>
parents:
15345
diff
changeset
|
649 } |
6a13c422fca4
API for high word multiplication.
Roland Schatz <roland.schatz@oracle.com>
parents:
15345
diff
changeset
|
650 |
6a13c422fca4
API for high word multiplication.
Roland Schatz <roland.schatz@oracle.com>
parents:
15345
diff
changeset
|
651 @Override |
6a13c422fca4
API for high word multiplication.
Roland Schatz <roland.schatz@oracle.com>
parents:
15345
diff
changeset
|
652 public Value emitUMulHigh(Value a, Value b) { |
16926
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
653 switch (a.getKind().getStackKind()) { |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
654 case Int: |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
655 return emitMulHigh(IUMUL, a, b); |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
656 case Long: |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
657 return emitMulHigh(LUMUL, a, b); |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
658 default: |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
659 throw GraalInternalError.shouldNotReachHere(); |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
660 } |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
661 } |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
662 |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
663 private Value emitMulHigh(SPARCArithmetic opcode, Value a, Value b) { |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
664 Variable result = newVariable(LIRKind.derive(a, b)); |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
665 MulHighOp mulHigh = new MulHighOp(opcode, load(a), load(b), result, newVariable(LIRKind.derive(a, b))); |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
666 append(mulHigh); |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
667 return result; |
15691
6a13c422fca4
API for high word multiplication.
Roland Schatz <roland.schatz@oracle.com>
parents:
15345
diff
changeset
|
668 } |
6a13c422fca4
API for high word multiplication.
Roland Schatz <roland.schatz@oracle.com>
parents:
15345
diff
changeset
|
669 |
6a13c422fca4
API for high word multiplication.
Roland Schatz <roland.schatz@oracle.com>
parents:
15345
diff
changeset
|
670 @Override |
15301
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15297
diff
changeset
|
671 public Value emitDiv(Value a, Value b, LIRFrameState state) { |
11233 | 672 switch (a.getKind().getStackKind()) { |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
673 case Int: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
674 return emitBinary(IDIV, false, a, b, state); |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
675 case Long: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
676 return emitBinary(LDIV, false, a, b, state); |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
677 case Float: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
678 return emitBinary(FDIV, false, a, b, state); |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
679 case Double: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
680 return emitBinary(DDIV, false, a, b, state); |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
681 default: |
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
682 throw GraalInternalError.shouldNotReachHere("missing: " + a.getKind()); |
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
683 } |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
684 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
685 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
686 @Override |
15301
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15297
diff
changeset
|
687 public Value emitRem(Value a, Value b, LIRFrameState state) { |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
688 Variable result = newVariable(LIRKind.derive(a, b)); |
16321
fac4af29aeb8
[SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16319
diff
changeset
|
689 Variable q = null; |
11233 | 690 switch (a.getKind().getStackKind()) { |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
691 case Int: |
17081
62505bdc6960
[SPARC] fixing irem
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17029
diff
changeset
|
692 append(new RemOp(IREM, result, load(a), loadNonConst(b), state, this)); |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
693 break; |
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
694 case Long: |
17081
62505bdc6960
[SPARC] fixing irem
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17029
diff
changeset
|
695 append(new RemOp(LREM, result, load(a), loadNonConst(b), state, this)); |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
696 break; |
16321
fac4af29aeb8
[SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16319
diff
changeset
|
697 case Float: |
16327
5f01f7c48d40
Merge with 5cdcb94a7cf7d9782107cc582f3e4b50000d5d1f
Stefan Anzinger <stefan.anzinger@gmail.com>
diff
changeset
|
698 q = newVariable(LIRKind.value(Kind.Float)); |
17105
0a21f24f9a65
[SPARC] eliminating some redundant LIR types
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17099
diff
changeset
|
699 append(new BinaryRegReg(FDIV, q, a, b, state)); |
16321
fac4af29aeb8
[SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16319
diff
changeset
|
700 append(new Unary2Op(F2I, q, q)); |
fac4af29aeb8
[SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16319
diff
changeset
|
701 append(new Unary2Op(I2F, q, q)); |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
702 append(new BinaryRegReg(FMUL, q, q, b)); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
703 append(new BinaryRegReg(FSUB, result, a, q)); |
16321
fac4af29aeb8
[SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16319
diff
changeset
|
704 break; |
fac4af29aeb8
[SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16319
diff
changeset
|
705 case Double: |
16327
5f01f7c48d40
Merge with 5cdcb94a7cf7d9782107cc582f3e4b50000d5d1f
Stefan Anzinger <stefan.anzinger@gmail.com>
diff
changeset
|
706 q = newVariable(LIRKind.value(Kind.Double)); |
17105
0a21f24f9a65
[SPARC] eliminating some redundant LIR types
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17099
diff
changeset
|
707 append(new BinaryRegReg(DDIV, q, a, b, state)); |
16321
fac4af29aeb8
[SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16319
diff
changeset
|
708 append(new Unary2Op(D2L, q, q)); |
fac4af29aeb8
[SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16319
diff
changeset
|
709 append(new Unary2Op(L2D, q, q)); |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
710 append(new BinaryRegReg(DMUL, q, q, b)); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
711 append(new BinaryRegReg(DSUB, result, a, q)); |
16321
fac4af29aeb8
[SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16319
diff
changeset
|
712 break; |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
713 default: |
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
714 throw GraalInternalError.shouldNotReachHere("missing: " + a.getKind()); |
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
715 } |
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
716 return result; |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
717 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
718 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
719 @Override |
16659
b377d9e85bc6
[SPARC] Fist implementation of unsigned arithmethic (Still to improve)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16524
diff
changeset
|
720 public Value emitURem(Value a, Value b, LIRFrameState state) { |
b377d9e85bc6
[SPARC] Fist implementation of unsigned arithmethic (Still to improve)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16524
diff
changeset
|
721 Variable result = newVariable(LIRKind.derive(a, b)); |
11233 | 722 switch (a.getKind().getStackKind()) { |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
723 case Int: |
16926
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
724 append(new RemOp(IUREM, result, load(a), load(b), state, this)); |
16659
b377d9e85bc6
[SPARC] Fist implementation of unsigned arithmethic (Still to improve)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16524
diff
changeset
|
725 break; |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
726 case Long: |
16926
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
727 append(new RemOp(LUREM, result, load(a), loadNonConst(b), state, this)); |
16659
b377d9e85bc6
[SPARC] Fist implementation of unsigned arithmethic (Still to improve)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16524
diff
changeset
|
728 break; |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
729 default: |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
730 throw GraalInternalError.shouldNotReachHere(); |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
731 } |
16659
b377d9e85bc6
[SPARC] Fist implementation of unsigned arithmethic (Still to improve)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16524
diff
changeset
|
732 return result; |
b377d9e85bc6
[SPARC] Fist implementation of unsigned arithmethic (Still to improve)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16524
diff
changeset
|
733 |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
734 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
735 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
736 @Override |
16659
b377d9e85bc6
[SPARC] Fist implementation of unsigned arithmethic (Still to improve)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16524
diff
changeset
|
737 public Value emitUDiv(Value a, Value b, LIRFrameState state) { |
b377d9e85bc6
[SPARC] Fist implementation of unsigned arithmethic (Still to improve)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16524
diff
changeset
|
738 SPARCArithmetic op; |
16926
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
739 Value actualA = a; |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
740 Value actualB = b; |
11233 | 741 switch (a.getKind().getStackKind()) { |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
742 case Int: |
17029
790e5e5072a2
[SPARC] Checkstyle, blacklist for unittests
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17028
diff
changeset
|
743 op = LUDIV; |
16926
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
744 actualA = emitZeroExtend(actualA, 32, 64); |
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
745 actualB = emitZeroExtend(actualB, 32, 64); |
16942
ae0f235469db
[SPARC] Fix findbugs/checkstyle warnings
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16933
diff
changeset
|
746 break; |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
747 case Long: |
16659
b377d9e85bc6
[SPARC] Fist implementation of unsigned arithmethic (Still to improve)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16524
diff
changeset
|
748 op = LUDIV; |
b377d9e85bc6
[SPARC] Fist implementation of unsigned arithmethic (Still to improve)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16524
diff
changeset
|
749 break; |
9846
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
750 default: |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
751 throw GraalInternalError.shouldNotReachHere(); |
91a1041ec905
SPARCLIRGenerator, sqrt, condition move, breakpoint op, partial bit ops
Morris Meyer <morris.meyer@oracle.com>
parents:
9845
diff
changeset
|
752 } |
16926
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
753 return emitBinary(op, false, actualA, actualB, state); |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
754 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
755 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
756 @Override |
10792 | 757 public Variable emitAnd(Value a, Value b) { |
11233 | 758 switch (a.getKind().getStackKind()) { |
9829
04911dff1c66
SPARC logic and shift operations
Morris Meyer <morris.meyer@oracle.com>
parents:
9828
diff
changeset
|
759 case Int: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
760 return emitBinary(IAND, true, a, b); |
9829
04911dff1c66
SPARC logic and shift operations
Morris Meyer <morris.meyer@oracle.com>
parents:
9828
diff
changeset
|
761 case Long: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
762 return emitBinary(LAND, true, a, b); |
9829
04911dff1c66
SPARC logic and shift operations
Morris Meyer <morris.meyer@oracle.com>
parents:
9828
diff
changeset
|
763 |
04911dff1c66
SPARC logic and shift operations
Morris Meyer <morris.meyer@oracle.com>
parents:
9828
diff
changeset
|
764 default: |
04911dff1c66
SPARC logic and shift operations
Morris Meyer <morris.meyer@oracle.com>
parents:
9828
diff
changeset
|
765 throw GraalInternalError.shouldNotReachHere("missing: " + a.getKind()); |
04911dff1c66
SPARC logic and shift operations
Morris Meyer <morris.meyer@oracle.com>
parents:
9828
diff
changeset
|
766 } |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
767 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
768 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
769 @Override |
10792 | 770 public Variable emitOr(Value a, Value b) { |
11233 | 771 switch (a.getKind().getStackKind()) { |
9829
04911dff1c66
SPARC logic and shift operations
Morris Meyer <morris.meyer@oracle.com>
parents:
9828
diff
changeset
|
772 case Int: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
773 return emitBinary(IOR, true, a, b); |
9829
04911dff1c66
SPARC logic and shift operations
Morris Meyer <morris.meyer@oracle.com>
parents:
9828
diff
changeset
|
774 case Long: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
775 return emitBinary(LOR, true, a, b); |
9829
04911dff1c66
SPARC logic and shift operations
Morris Meyer <morris.meyer@oracle.com>
parents:
9828
diff
changeset
|
776 default: |
04911dff1c66
SPARC logic and shift operations
Morris Meyer <morris.meyer@oracle.com>
parents:
9828
diff
changeset
|
777 throw GraalInternalError.shouldNotReachHere("missing: " + a.getKind()); |
04911dff1c66
SPARC logic and shift operations
Morris Meyer <morris.meyer@oracle.com>
parents:
9828
diff
changeset
|
778 } |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
779 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
780 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
781 @Override |
10792 | 782 public Variable emitXor(Value a, Value b) { |
11233 | 783 switch (a.getKind().getStackKind()) { |
9829
04911dff1c66
SPARC logic and shift operations
Morris Meyer <morris.meyer@oracle.com>
parents:
9828
diff
changeset
|
784 case Int: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
785 return emitBinary(IXOR, true, a, b); |
9829
04911dff1c66
SPARC logic and shift operations
Morris Meyer <morris.meyer@oracle.com>
parents:
9828
diff
changeset
|
786 case Long: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
787 return emitBinary(LXOR, true, a, b); |
9829
04911dff1c66
SPARC logic and shift operations
Morris Meyer <morris.meyer@oracle.com>
parents:
9828
diff
changeset
|
788 default: |
04911dff1c66
SPARC logic and shift operations
Morris Meyer <morris.meyer@oracle.com>
parents:
9828
diff
changeset
|
789 throw GraalInternalError.shouldNotReachHere(); |
04911dff1c66
SPARC logic and shift operations
Morris Meyer <morris.meyer@oracle.com>
parents:
9828
diff
changeset
|
790 } |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
791 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
792 |
11233 | 793 private Variable emitShift(SPARCArithmetic op, Value a, Value b) { |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
794 Variable result = newVariable(LIRKind.derive(a, b).changeType(a.getPlatformKind())); |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
18149
diff
changeset
|
795 if (isConstant(b) && canInlineConstant((JavaConstant) b)) { |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
796 append(new BinaryRegConst(op, result, load(a), asConstant(b), null)); |
11233 | 797 } else { |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
798 append(new BinaryRegReg(op, result, load(a), load(b))); |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
799 } |
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
800 return result; |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
801 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
802 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
803 @Override |
11233 | 804 public Variable emitShl(Value a, Value b) { |
805 switch (a.getKind().getStackKind()) { | |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
806 case Int: |
11233 | 807 return emitShift(ISHL, a, b); |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
808 case Long: |
11233 | 809 return emitShift(LSHL, a, b); |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
810 default: |
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
811 throw GraalInternalError.shouldNotReachHere(); |
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
812 } |
11233 | 813 } |
814 | |
815 @Override | |
816 public Variable emitShr(Value a, Value b) { | |
817 switch (a.getKind().getStackKind()) { | |
818 case Int: | |
819 return emitShift(ISHR, a, b); | |
820 case Long: | |
821 return emitShift(LSHR, a, b); | |
822 default: | |
823 throw GraalInternalError.shouldNotReachHere(); | |
824 } | |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
825 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
826 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
827 @Override |
10792 | 828 public Variable emitUShr(Value a, Value b) { |
11233 | 829 switch (a.getKind().getStackKind()) { |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
830 case Int: |
11233 | 831 return emitShift(IUSHR, a, b); |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
832 case Long: |
11233 | 833 return emitShift(LUSHR, a, b); |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
834 default: |
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
835 throw GraalInternalError.shouldNotReachHere(); |
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
836 } |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
837 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
838 |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
16092
diff
changeset
|
839 private AllocatableValue emitConvertMove(LIRKind kind, AllocatableValue input) { |
12656
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
840 Variable result = newVariable(kind); |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
841 emitMove(result, input); |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
842 return result; |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
843 } |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
844 |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
16092
diff
changeset
|
845 private AllocatableValue emitConvert2Op(LIRKind kind, SPARCArithmetic op, AllocatableValue input) { |
12656
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
846 Variable result = newVariable(kind); |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
847 append(new Unary2Op(op, result, input)); |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
848 return result; |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
849 } |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
850 |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
851 @Override |
14000
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
852 public Value emitFloatConvert(FloatConvert op, Value inputVal) { |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
853 AllocatableValue input = asAllocatable(inputVal); |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
854 switch (op) { |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
855 case D2F: |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
856 return emitConvert2Op(LIRKind.derive(inputVal).changeType(Kind.Float), D2F, input); |
14000
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
857 case F2D: |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
858 return emitConvert2Op(LIRKind.derive(inputVal).changeType(Kind.Double), F2D, input); |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
859 case I2F: { |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
860 AllocatableValue convertedFloatReg = newVariable(LIRKind.derive(input).changeType(Kind.Float)); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
861 moveBetweenFpGp(convertedFloatReg, input); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
862 append(new Unary2Op(I2F, convertedFloatReg, convertedFloatReg)); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
863 return convertedFloatReg; |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
864 } |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
865 case I2D: { |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
866 // Unfortunately we must do int -> float -> double because fitod has float |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
867 // and double encoding in one instruction |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
868 AllocatableValue convertedFloatReg = newVariable(LIRKind.derive(input).changeType(Kind.Float)); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
869 moveBetweenFpGp(convertedFloatReg, input); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
870 AllocatableValue convertedDoubleReg = newVariable(LIRKind.derive(input).changeType(Kind.Double)); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
871 append(new Unary2Op(I2D, convertedDoubleReg, convertedFloatReg)); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
872 return convertedDoubleReg; |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
873 } |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
874 case L2D: { |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
875 AllocatableValue convertedDoubleReg = newVariable(LIRKind.derive(input).changeType(Kind.Double)); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
876 moveBetweenFpGp(convertedDoubleReg, input); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
877 append(new Unary2Op(L2D, convertedDoubleReg, convertedDoubleReg)); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
878 return convertedDoubleReg; |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
879 } |
17028
dc293c1d969c
[SPARC] Fixing conversions of l2d l2f i2d i2f ... Adding assertions for usage of
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17019
diff
changeset
|
880 case D2I: { |
dc293c1d969c
[SPARC] Fixing conversions of l2d l2f i2d i2f ... Adding assertions for usage of
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17019
diff
changeset
|
881 AllocatableValue convertedFloatReg = emitConvert2Op(LIRKind.derive(input).changeType(Kind.Float), D2I, input); |
dc293c1d969c
[SPARC] Fixing conversions of l2d l2f i2d i2f ... Adding assertions for usage of
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17019
diff
changeset
|
882 AllocatableValue convertedIntReg = newVariable(LIRKind.derive(convertedFloatReg).changeType(Kind.Int)); |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
883 moveBetweenFpGp(convertedIntReg, convertedFloatReg); |
17028
dc293c1d969c
[SPARC] Fixing conversions of l2d l2f i2d i2f ... Adding assertions for usage of
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17019
diff
changeset
|
884 return convertedIntReg; |
dc293c1d969c
[SPARC] Fixing conversions of l2d l2f i2d i2f ... Adding assertions for usage of
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17019
diff
changeset
|
885 } |
dc293c1d969c
[SPARC] Fixing conversions of l2d l2f i2d i2f ... Adding assertions for usage of
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17019
diff
changeset
|
886 case F2L: { |
dc293c1d969c
[SPARC] Fixing conversions of l2d l2f i2d i2f ... Adding assertions for usage of
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17019
diff
changeset
|
887 AllocatableValue convertedDoubleReg = emitConvert2Op(LIRKind.derive(input).changeType(Kind.Double), F2L, input); |
dc293c1d969c
[SPARC] Fixing conversions of l2d l2f i2d i2f ... Adding assertions for usage of
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17019
diff
changeset
|
888 AllocatableValue convertedLongReg = newVariable(LIRKind.derive(convertedDoubleReg).changeType(Kind.Long)); |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
889 moveBetweenFpGp(convertedLongReg, convertedDoubleReg); |
17028
dc293c1d969c
[SPARC] Fixing conversions of l2d l2f i2d i2f ... Adding assertions for usage of
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17019
diff
changeset
|
890 return convertedLongReg; |
dc293c1d969c
[SPARC] Fixing conversions of l2d l2f i2d i2f ... Adding assertions for usage of
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17019
diff
changeset
|
891 } |
dc293c1d969c
[SPARC] Fixing conversions of l2d l2f i2d i2f ... Adding assertions for usage of
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17019
diff
changeset
|
892 case F2I: { |
dc293c1d969c
[SPARC] Fixing conversions of l2d l2f i2d i2f ... Adding assertions for usage of
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17019
diff
changeset
|
893 AllocatableValue convertedFloatReg = emitConvert2Op(LIRKind.derive(input).changeType(Kind.Float), F2I, input); |
dc293c1d969c
[SPARC] Fixing conversions of l2d l2f i2d i2f ... Adding assertions for usage of
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17019
diff
changeset
|
894 AllocatableValue convertedIntReg = newVariable(LIRKind.derive(convertedFloatReg).changeType(Kind.Int)); |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
895 moveBetweenFpGp(convertedIntReg, convertedFloatReg); |
17028
dc293c1d969c
[SPARC] Fixing conversions of l2d l2f i2d i2f ... Adding assertions for usage of
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17019
diff
changeset
|
896 return convertedIntReg; |
dc293c1d969c
[SPARC] Fixing conversions of l2d l2f i2d i2f ... Adding assertions for usage of
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17019
diff
changeset
|
897 } |
dc293c1d969c
[SPARC] Fixing conversions of l2d l2f i2d i2f ... Adding assertions for usage of
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17019
diff
changeset
|
898 case D2L: { |
dc293c1d969c
[SPARC] Fixing conversions of l2d l2f i2d i2f ... Adding assertions for usage of
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17019
diff
changeset
|
899 AllocatableValue convertedDoubleReg = emitConvert2Op(LIRKind.derive(input).changeType(Kind.Double), D2L, input); |
dc293c1d969c
[SPARC] Fixing conversions of l2d l2f i2d i2f ... Adding assertions for usage of
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17019
diff
changeset
|
900 AllocatableValue convertedLongReg = newVariable(LIRKind.derive(convertedDoubleReg).changeType(Kind.Long)); |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
901 moveBetweenFpGp(convertedLongReg, convertedDoubleReg); |
17028
dc293c1d969c
[SPARC] Fixing conversions of l2d l2f i2d i2f ... Adding assertions for usage of
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17019
diff
changeset
|
902 return convertedLongReg; |
dc293c1d969c
[SPARC] Fixing conversions of l2d l2f i2d i2f ... Adding assertions for usage of
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17019
diff
changeset
|
903 } |
16429
3943a1a46a53
[SPARC] Fixing i2d and l2f and handling of implicit exceptions
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16346
diff
changeset
|
904 case L2F: { |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
905 // long -> double -> float see above |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
906 AllocatableValue convertedDoubleReg = newVariable(LIRKind.derive(input).changeType(Kind.Double)); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
907 moveBetweenFpGp(convertedDoubleReg, input); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
908 AllocatableValue convertedFloatReg = newVariable(LIRKind.derive(input).changeType(Kind.Float)); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
909 append(new Unary2Op(L2F, convertedFloatReg, convertedDoubleReg)); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
910 return convertedFloatReg; |
16429
3943a1a46a53
[SPARC] Fixing i2d and l2f and handling of implicit exceptions
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16346
diff
changeset
|
911 } |
14000
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
912 default: |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
913 throw GraalInternalError.shouldNotReachHere(); |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
914 } |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
915 } |
12656
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
916 |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
917 private void moveBetweenFpGp(AllocatableValue dst, AllocatableValue src) { |
17115
9a0bf0c3b21e
[SPARC] Use VIS3 moves between fp and gp registers when available
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17112
diff
changeset
|
918 if (!getArchitecture().getFeatures().contains(CPUFeature.VIS3)) { |
18425
b856446ff7e0
Introduce StackSlotValue and VirtualStackSlot.
Josef Eisl <josef.eisl@jku.at>
parents:
18358
diff
changeset
|
919 StackSlotValue tempSlot = getTempSlot(LIRKind.value(Kind.Long)); |
17115
9a0bf0c3b21e
[SPARC] Use VIS3 moves between fp and gp registers when available
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17112
diff
changeset
|
920 append(new MoveFpGp(dst, src, tempSlot)); |
9a0bf0c3b21e
[SPARC] Use VIS3 moves between fp and gp registers when available
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17112
diff
changeset
|
921 } else { |
9a0bf0c3b21e
[SPARC] Use VIS3 moves between fp and gp registers when available
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17112
diff
changeset
|
922 append(new MoveFpGpVIS3(dst, src)); |
9a0bf0c3b21e
[SPARC] Use VIS3 moves between fp and gp registers when available
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17112
diff
changeset
|
923 } |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
924 } |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
925 |
18425
b856446ff7e0
Introduce StackSlotValue and VirtualStackSlot.
Josef Eisl <josef.eisl@jku.at>
parents:
18358
diff
changeset
|
926 private StackSlotValue getTempSlot(LIRKind kind) { |
17112
4c9c347fa4da
[SPARC] Renamed member tmp to avoid compiler warnings
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17109
diff
changeset
|
927 if (tmpStackSlot == null) { |
18149
c6086a18c9ce
Rename LIRGenerationResult.getFrameMap() to getFrameMapBuilder().
Josef Eisl <josef.eisl@jku.at>
parents:
17314
diff
changeset
|
928 tmpStackSlot = getResult().getFrameMapBuilder().allocateSpillSlot(kind); |
17109
1a92d77a851b
[SPARC] Implementing ArrayEqualsOp for sparc
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17105
diff
changeset
|
929 } |
17112
4c9c347fa4da
[SPARC] Renamed member tmp to avoid compiler warnings
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17109
diff
changeset
|
930 return tmpStackSlot; |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
931 } |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
932 |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
933 protected SPARC getArchitecture() { |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
934 return (SPARC) target().arch; |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
935 } |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
936 |
14000
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
937 @Override |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
938 public Value emitNarrow(Value inputVal, int bits) { |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
939 if (inputVal.getKind() == Kind.Long && bits <= 32) { |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
940 return emitConvert2Op(LIRKind.derive(inputVal).changeType(Kind.Int), L2I, asAllocatable(inputVal)); |
14000
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
941 } else { |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
942 return inputVal; |
12656
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
943 } |
14000
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
944 } |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
945 |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
946 @Override |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
947 public Value emitSignExtend(Value inputVal, int fromBits, int toBits) { |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
948 assert fromBits <= toBits && toBits <= 64; |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
949 if (fromBits == toBits) { |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
950 return inputVal; |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
951 } else if (toBits > 32) { |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
952 // sign extend to 64 bits |
15345 | 953 switch (fromBits) { |
954 case 8: | |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
955 return emitConvert2Op(LIRKind.derive(inputVal).changeType(Kind.Long), B2L, asAllocatable(inputVal)); |
15345 | 956 case 16: |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
957 return emitConvert2Op(LIRKind.derive(inputVal).changeType(Kind.Long), S2L, asAllocatable(inputVal)); |
15345 | 958 case 32: |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
959 return emitConvert2Op(LIRKind.derive(inputVal).changeType(Kind.Long), I2L, asAllocatable(inputVal)); |
15345 | 960 default: |
961 throw GraalInternalError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)"); | |
14000
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
962 } |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
963 } else { |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
964 // sign extend to 32 bits (smaller values are internally represented as 32 bit values) |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
965 switch (fromBits) { |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
966 case 8: |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
967 return emitConvert2Op(LIRKind.derive(inputVal).changeType(Kind.Int), B2I, asAllocatable(inputVal)); |
14000
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
968 case 16: |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
969 return emitConvert2Op(LIRKind.derive(inputVal).changeType(Kind.Int), S2I, asAllocatable(inputVal)); |
14000
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
970 case 32: |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
971 return inputVal; |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
972 default: |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
973 throw GraalInternalError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)"); |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
974 } |
12656
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
975 } |
14000
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
976 } |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
977 |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
978 @Override |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
979 public Value emitZeroExtend(Value inputVal, int fromBits, int toBits) { |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
980 assert fromBits <= toBits && toBits <= 64; |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
981 if (fromBits == toBits) { |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
982 return inputVal; |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
983 } else if (fromBits > 32) { |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
984 assert inputVal.getKind() == Kind.Long; |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
985 Variable result = newVariable(LIRKind.derive(inputVal).changeType(Kind.Long)); |
17196
189479d72dc8
Move bit manipulation methods to CodeUtil class.
Roland Schatz <roland.schatz@oracle.com>
parents:
17177
diff
changeset
|
986 long mask = CodeUtil.mask(fromBits); |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
18149
diff
changeset
|
987 append(new BinaryRegConst(SPARCArithmetic.LAND, result, asAllocatable(inputVal), JavaConstant.forLong(mask), null)); |
14000
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
988 return result; |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
989 } else { |
16932
4d77f938aa02
[SPARC] Exclude AMD64 tests from SPARC testrun, always use tmp register when using StrategySwitch, using registerSaver in EnterUnpackStackFrame, LeaveCurrentStackframe, adding guarantee to load offsets when doing load reg+imm13 when the imm value does not fit in 13 bit, assertions for scratch register usage (tmp/def)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16926
diff
changeset
|
990 assert inputVal.getKind() == Kind.Int || inputVal.getKind() == Kind.Short || inputVal.getKind() == Kind.Byte || inputVal.getKind() == Kind.Char : inputVal.getKind(); |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
991 Variable result = newVariable(LIRKind.derive(inputVal).changeType(Kind.Int)); |
17196
189479d72dc8
Move bit manipulation methods to CodeUtil class.
Roland Schatz <roland.schatz@oracle.com>
parents:
17177
diff
changeset
|
992 long mask = CodeUtil.mask(fromBits); |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
18149
diff
changeset
|
993 JavaConstant constant = JavaConstant.forInt((int) mask); |
16926
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
994 if (fromBits == 32) { |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
18149
diff
changeset
|
995 append(new BinaryRegConst(IUSHR, result, inputVal, JavaConstant.forInt(0))); |
16926
5c8a0b322d15
[SPARC] Implement unsigned arithmethic, fix CAS, unary operations on stack and various other fixes
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
996 } else if (canInlineConstant(constant)) { |
16518
3eb13b910134
[SPARC] Fixing LongBits tests and some implicit exceptions
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16429
diff
changeset
|
997 append(new BinaryRegConst(SPARCArithmetic.IAND, result, asAllocatable(inputVal), constant, null)); |
16315
b955d649fca8
Fixing BC_i2f, BC_i2c, BC_fadd
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16313
diff
changeset
|
998 } else { |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
999 Variable maskVar = newVariable(LIRKind.derive(inputVal).changeType(Kind.Int)); |
16315
b955d649fca8
Fixing BC_i2f, BC_i2c, BC_fadd
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16313
diff
changeset
|
1000 emitMove(maskVar, constant); |
16664
62f295bdea36
[SPARC] Fixing compare of short/char with constants, using half of single float registers as of now, otherwise it would overlap with double registers
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16659
diff
changeset
|
1001 append(new BinaryRegReg(IAND, result, maskVar, asAllocatable(inputVal))); |
16315
b955d649fca8
Fixing BC_i2f, BC_i2c, BC_fadd
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16313
diff
changeset
|
1002 } |
14000
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
1003 if (toBits > 32) { |
16346
bbf051d717f5
Propagate reference information through arithmetics.
Roland Schatz <roland.schatz@oracle.com>
parents:
16327
diff
changeset
|
1004 Variable longResult = newVariable(LIRKind.derive(inputVal).changeType(Kind.Long)); |
14000
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
1005 emitMove(longResult, result); |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
1006 return longResult; |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
1007 } else { |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
1008 return result; |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
1009 } |
958c99d0790c
Split convert node into separate nodes for different conversions.
Roland Schatz <roland.schatz@oracle.com>
parents:
13973
diff
changeset
|
1010 } |
12656
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1011 } |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1012 |
14003
0c38906450a0
Make conversion from Stamp to PlatformKind extensible by backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
14000
diff
changeset
|
1013 @Override |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
16092
diff
changeset
|
1014 public AllocatableValue emitReinterpret(LIRKind to, Value inputVal) { |
12656
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1015 Kind from = inputVal.getKind(); |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1016 AllocatableValue input = asAllocatable(inputVal); |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
1017 Variable result = newVariable(to); |
12656
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1018 // These cases require a move between CPU and FPU registers: |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
16092
diff
changeset
|
1019 switch ((Kind) to.getPlatformKind()) { |
12656
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1020 case Int: |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1021 switch (from) { |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1022 case Float: |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1023 case Double: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
1024 moveBetweenFpGp(result, input); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
1025 return result; |
12656
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1026 } |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
1027 break; |
12656
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1028 case Long: |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1029 switch (from) { |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1030 case Float: |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1031 case Double: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
1032 moveBetweenFpGp(result, input); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
1033 return result; |
12656
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1034 } |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1035 break; |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1036 case Float: |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1037 switch (from) { |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1038 case Int: |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1039 case Long: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
1040 moveBetweenFpGp(result, input); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
1041 return result; |
12656
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1042 } |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
1043 break; |
12656
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1044 case Double: |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1045 switch (from) { |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1046 case Int: |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1047 case Long: |
17082
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
1048 moveBetweenFpGp(result, input); |
f8586d059f9d
[SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17081
diff
changeset
|
1049 return result; |
12656
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1050 } |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1051 break; |
9817
26960d32552c
SPARC integer arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
9816
diff
changeset
|
1052 } |
12656
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1053 |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1054 // Otherwise, just emit an ordinary move instruction. |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1055 // Instructions that move or generate 32-bit register values also set the upper 32 |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1056 // bits of the register to zero. |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1057 // Consequently, there is no need for a special zero-extension move. |
9334392ed279
Refactor ConvertNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
12503
diff
changeset
|
1058 return emitConvertMove(to, input); |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
1059 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
1060 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
1061 @Override |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
1062 public void emitMembar(int barriers) { |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
1063 int necessaryBarriers = target().arch.requiredBarriers(barriers); |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
1064 if (target().isMP && necessaryBarriers != 0) { |
9845
204e8f3209e9
SPARCMacroAssembler synthetic instructions and SPARCTestOp
Morris Meyer <morris.meyer@oracle.com>
parents:
9843
diff
changeset
|
1065 append(new MembarOp(necessaryBarriers)); |
204e8f3209e9
SPARCMacroAssembler synthetic instructions and SPARCTestOp
Morris Meyer <morris.meyer@oracle.com>
parents:
9843
diff
changeset
|
1066 } |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
1067 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
1068 |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
1069 @Override |
15301
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15297
diff
changeset
|
1070 public void emitDeoptimize(Value actionAndReason, Value speculation, LIRFrameState state) { |
9831
705aca4ebf2f
SPARC array, load / store and compare operations
Morris Meyer <morris.meyer@oracle.com>
parents:
9829
diff
changeset
|
1071 append(new ReturnOp(Value.ILLEGAL)); |
7743
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
1072 } |
7732a91e5f6d
Added more skeleton code to SPARC projects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7740
diff
changeset
|
1073 |
7740
5f8101629080
Add projects and skeletons for SPARC port.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1074 } |