annotate graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java @ 18408:2c3666f44855

Truffle: initial commit of object API implementation
author Andreas Woess <andreas.woess@jku.at>
date Tue, 18 Nov 2014 23:19:43 +0100
parents 2dc0d4dcb709
children 7b5106be0f18
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
1 /*
15104
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15066
diff changeset
2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
4 *
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
8 *
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
13 * accompanied this code).
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
14 *
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
18 *
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
21 * questions.
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
22 */
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
23
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
24 package com.oracle.graal.hotspot.hsail;
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
25
14768
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 14723
diff changeset
26 import static com.oracle.graal.api.code.ValueUtil.*;
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 14723
diff changeset
27
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
28 import com.oracle.graal.api.code.*;
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
29 import com.oracle.graal.api.meta.*;
15193
96bb07a5d667 Spit up and move GraalInternalError.
Josef Eisl <josef.eisl@jku.at>
parents: 15104
diff changeset
30 import com.oracle.graal.compiler.common.*;
15200
97eed257999b Move Condition to graal.compiler.common.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
31 import com.oracle.graal.compiler.common.calc.*;
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
32 import com.oracle.graal.compiler.hsail.*;
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
33 import com.oracle.graal.hotspot.*;
14723
4c5ed5a670ed HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents: 14633
diff changeset
34 import com.oracle.graal.hotspot.HotSpotVMConfig.CompressEncoding;
4c5ed5a670ed HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents: 14633
diff changeset
35 import com.oracle.graal.hotspot.meta.*;
18358
2dc0d4dcb709 Separate stamp for metaspace pointers.
Roland Schatz <roland.schatz@oracle.com>
parents: 18289
diff changeset
36 import com.oracle.graal.hotspot.nodes.type.*;
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
37 import com.oracle.graal.lir.*;
15104
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15066
diff changeset
38 import com.oracle.graal.lir.StandardOp.SaveRegistersOp;
15292
a38d791982e1 Move LIRGenerationResult* to graal.lir.
Josef Eisl <josef.eisl@jku.at>
parents: 15252
diff changeset
39 import com.oracle.graal.lir.gen.*;
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
40 import com.oracle.graal.lir.hsail.*;
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
41 import com.oracle.graal.lir.hsail.HSAILControlFlow.CondMoveOp;
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
42 import com.oracle.graal.lir.hsail.HSAILControlFlow.DeoptimizeOp;
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
43 import com.oracle.graal.lir.hsail.HSAILControlFlow.ForeignCall1ArgOp;
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
44 import com.oracle.graal.lir.hsail.HSAILControlFlow.ForeignCall2ArgOp;
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
45 import com.oracle.graal.lir.hsail.HSAILControlFlow.ForeignCallNoArgOp;
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
46 import com.oracle.graal.lir.hsail.HSAILMove.CompareAndSwapOp;
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
47 import com.oracle.graal.lir.hsail.HSAILMove.LoadAcquireOp;
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
48 import com.oracle.graal.lir.hsail.HSAILMove.LoadOp;
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
49 import com.oracle.graal.lir.hsail.HSAILMove.MoveToRegOp;
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
50 import com.oracle.graal.lir.hsail.HSAILMove.StoreConstantOp;
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
51 import com.oracle.graal.lir.hsail.HSAILMove.StoreOp;
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
52 import com.oracle.graal.lir.hsail.HSAILMove.StoreReleaseOp;
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
53 import com.oracle.graal.lir.hsail.HSAILMove.WorkItemAbsIdOp;
14768
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 14723
diff changeset
54 import com.oracle.graal.phases.util.*;
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
55
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
56 /**
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
57 * The HotSpot specific portion of the HSAIL LIR generator.
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
58 */
14945
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
59 public class HSAILHotSpotLIRGenerator extends HSAILLIRGenerator implements HotSpotLIRGenerator {
14768
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 14723
diff changeset
60
14846
43cd57700476 Apply LIRGenerator refactoring to HSAIL backend.
Josef Eisl <josef.eisl@jku.at>
parents: 14826
diff changeset
61 final HotSpotVMConfig config;
14768
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 14723
diff changeset
62
14846
43cd57700476 Apply LIRGenerator refactoring to HSAIL backend.
Josef Eisl <josef.eisl@jku.at>
parents: 14826
diff changeset
63 public HSAILHotSpotLIRGenerator(Providers providers, HotSpotVMConfig config, CallingConvention cc, LIRGenerationResult lirGenRes) {
18358
2dc0d4dcb709 Separate stamp for metaspace pointers.
Roland Schatz <roland.schatz@oracle.com>
parents: 18289
diff changeset
64 super(new HotSpotLIRKindTool(providers.getCodeCache().getTarget().wordKind), providers, cc, lirGenRes);
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
65 this.config = config;
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
66 }
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
67
14723
4c5ed5a670ed HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents: 14633
diff changeset
68 @Override
4c5ed5a670ed HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents: 14633
diff changeset
69 public HotSpotProviders getProviders() {
4c5ed5a670ed HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents: 14633
diff changeset
70 return (HotSpotProviders) super.getProviders();
4c5ed5a670ed HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents: 14633
diff changeset
71 }
4c5ed5a670ed HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents: 14633
diff changeset
72
14846
43cd57700476 Apply LIRGenerator refactoring to HSAIL backend.
Josef Eisl <josef.eisl@jku.at>
parents: 14826
diff changeset
73 int getLogMinObjectAlignment() {
12698
d59a65c11feb HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents: 12664
diff changeset
74 return config.logMinObjAlignment();
d59a65c11feb HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents: 12664
diff changeset
75 }
d59a65c11feb HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents: 12664
diff changeset
76
14846
43cd57700476 Apply LIRGenerator refactoring to HSAIL backend.
Josef Eisl <josef.eisl@jku.at>
parents: 14826
diff changeset
77 int getNarrowOopShift() {
12698
d59a65c11feb HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents: 12664
diff changeset
78 return config.narrowOopShift;
d59a65c11feb HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents: 12664
diff changeset
79 }
d59a65c11feb HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents: 12664
diff changeset
80
14846
43cd57700476 Apply LIRGenerator refactoring to HSAIL backend.
Josef Eisl <josef.eisl@jku.at>
parents: 14826
diff changeset
81 long getNarrowOopBase() {
12698
d59a65c11feb HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents: 12664
diff changeset
82 return config.narrowOopBase;
d59a65c11feb HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents: 12664
diff changeset
83 }
d59a65c11feb HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents: 12664
diff changeset
84
14846
43cd57700476 Apply LIRGenerator refactoring to HSAIL backend.
Josef Eisl <josef.eisl@jku.at>
parents: 14826
diff changeset
85 int getLogKlassAlignment() {
12698
d59a65c11feb HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents: 12664
diff changeset
86 return config.logKlassAlignment;
d59a65c11feb HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents: 12664
diff changeset
87 }
d59a65c11feb HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents: 12664
diff changeset
88
14846
43cd57700476 Apply LIRGenerator refactoring to HSAIL backend.
Josef Eisl <josef.eisl@jku.at>
parents: 14826
diff changeset
89 int getNarrowKlassShift() {
12698
d59a65c11feb HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents: 12664
diff changeset
90 return config.narrowKlassShift;
d59a65c11feb HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents: 12664
diff changeset
91 }
d59a65c11feb HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents: 12664
diff changeset
92
14846
43cd57700476 Apply LIRGenerator refactoring to HSAIL backend.
Josef Eisl <josef.eisl@jku.at>
parents: 14826
diff changeset
93 long getNarrowKlassBase() {
12698
d59a65c11feb HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents: 12664
diff changeset
94 return config.narrowKlassBase;
d59a65c11feb HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents: 12664
diff changeset
95 }
d59a65c11feb HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents: 12664
diff changeset
96
18187
9619ba4daf4c Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents: 18176
diff changeset
97 private static boolean canStoreConstant(JavaConstant c) {
15921
6d8c901814eb Support for compressed constants in HSAIL backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 15909
diff changeset
98 return !(c instanceof HotSpotObjectConstant);
6d8c901814eb Support for compressed constants in HSAIL backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 15909
diff changeset
99 }
6d8c901814eb Support for compressed constants in HSAIL backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 15909
diff changeset
100
6d8c901814eb Support for compressed constants in HSAIL backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 15909
diff changeset
101 @Override
18187
9619ba4daf4c Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents: 18176
diff changeset
102 public boolean canInlineConstant(JavaConstant c) {
15921
6d8c901814eb Support for compressed constants in HSAIL backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 15909
diff changeset
103 if (c instanceof HotSpotObjectConstant) {
6d8c901814eb Support for compressed constants in HSAIL backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 15909
diff changeset
104 return c.isNull();
6d8c901814eb Support for compressed constants in HSAIL backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 15909
diff changeset
105 } else {
6d8c901814eb Support for compressed constants in HSAIL backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 15909
diff changeset
106 return super.canInlineConstant(c);
6d8c901814eb Support for compressed constants in HSAIL backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 15909
diff changeset
107 }
13891
bc471f405eb8 HSAIL: support for storing immediates
Doug Simon <doug.simon@oracle.com>
parents: 13291
diff changeset
108 }
bc471f405eb8 HSAIL: support for storing immediates
Doug Simon <doug.simon@oracle.com>
parents: 13291
diff changeset
109
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
110 @Override
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
111 public Variable emitLoad(LIRKind kind, Value address, LIRFrameState state) {
10769
395d34c10e26 HSAIL backend changes
Doug Simon <doug.simon@oracle.com>
parents: 10662
diff changeset
112 HSAILAddressValue loadAddress = asAddressValue(address);
14945
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
113 Variable result = newVariable(kind);
16116
9e5a323e0a1e Remove hotspot specific NarrowOop kind, use LIRKind.reference(Kind.Int) instead.
Roland Schatz <roland.schatz@oracle.com>
parents: 16104
diff changeset
114 append(new LoadOp((Kind) kind.getPlatformKind(), result, loadAddress, state));
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
115 return result;
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
116 }
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
117
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
118 public Variable emitLoadAcquire(LIRKind kind, Value address, LIRFrameState state) {
16076
06eedda53e14 HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents: 15947
diff changeset
119 HSAILAddressValue loadAddress = asAddressValue(address);
06eedda53e14 HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents: 15947
diff changeset
120 Variable result = newVariable(kind);
16116
9e5a323e0a1e Remove hotspot specific NarrowOop kind, use LIRKind.reference(Kind.Int) instead.
Roland Schatz <roland.schatz@oracle.com>
parents: 16104
diff changeset
121 append(new LoadAcquireOp((Kind) kind.getPlatformKind(), result, loadAddress, state));
16076
06eedda53e14 HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents: 15947
diff changeset
122 return result;
06eedda53e14 HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents: 15947
diff changeset
123 }
06eedda53e14 HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents: 15947
diff changeset
124
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
125 @Override
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
126 public void emitStore(LIRKind kind, Value address, Value inputVal, LIRFrameState state) {
10769
395d34c10e26 HSAIL backend changes
Doug Simon <doug.simon@oracle.com>
parents: 10662
diff changeset
127 HSAILAddressValue storeAddress = asAddressValue(address);
13891
bc471f405eb8 HSAIL: support for storing immediates
Doug Simon <doug.simon@oracle.com>
parents: 13291
diff changeset
128 if (isConstant(inputVal)) {
18187
9619ba4daf4c Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents: 18176
diff changeset
129 JavaConstant c = asConstant(inputVal);
15909
e43591136d9f Support for compressed constants.
Roland Schatz <roland.schatz@oracle.com>
parents: 15846
diff changeset
130 if (HotSpotCompressedNullConstant.COMPRESSED_NULL.equals(c)) {
18187
9619ba4daf4c Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents: 18176
diff changeset
131 c = JavaConstant.INT_0;
15909
e43591136d9f Support for compressed constants.
Roland Schatz <roland.schatz@oracle.com>
parents: 15846
diff changeset
132 }
15947
3eedf7a653ea Remove unused oop compression code from backends.
Roland Schatz <roland.schatz@oracle.com>
parents: 15921
diff changeset
133 if (canStoreConstant(c)) {
16116
9e5a323e0a1e Remove hotspot specific NarrowOop kind, use LIRKind.reference(Kind.Int) instead.
Roland Schatz <roland.schatz@oracle.com>
parents: 16104
diff changeset
134 append(new StoreConstantOp((Kind) kind.getPlatformKind(), storeAddress, c, state));
15302
b3e4b32cb9f5 Remove deprecated isCompressed* checks from *HotSpotLIRGenerator.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
135 return;
13891
bc471f405eb8 HSAIL: support for storing immediates
Doug Simon <doug.simon@oracle.com>
parents: 13291
diff changeset
136 }
bc471f405eb8 HSAIL: support for storing immediates
Doug Simon <doug.simon@oracle.com>
parents: 13291
diff changeset
137 }
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
138 Variable input = load(inputVal);
16116
9e5a323e0a1e Remove hotspot specific NarrowOop kind, use LIRKind.reference(Kind.Int) instead.
Roland Schatz <roland.schatz@oracle.com>
parents: 16104
diff changeset
139 append(new StoreOp((Kind) kind.getPlatformKind(), storeAddress, input, state));
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
140 }
12664
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
141
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
142 public void emitStoreRelease(LIRKind kind, Value address, Value inputVal, LIRFrameState state) {
16076
06eedda53e14 HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents: 15947
diff changeset
143 HSAILAddressValue storeAddress = asAddressValue(address);
06eedda53e14 HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents: 15947
diff changeset
144 // TODO: handle Constants here
06eedda53e14 HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents: 15947
diff changeset
145 Variable input = load(inputVal);
16116
9e5a323e0a1e Remove hotspot specific NarrowOop kind, use LIRKind.reference(Kind.Int) instead.
Roland Schatz <roland.schatz@oracle.com>
parents: 16104
diff changeset
146 append(new StoreReleaseOp((Kind) kind.getPlatformKind(), storeAddress, input, state));
16076
06eedda53e14 HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents: 15947
diff changeset
147 }
06eedda53e14 HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents: 15947
diff changeset
148
15024
2ee777221036 Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents: 15018
diff changeset
149 public Value emitCompareAndSwap(Value address, Value expectedValue, Value newValue, Value trueValue, Value falseValue) {
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
150 LIRKind kind = newValue.getLIRKind();
16118
5cbaad0b7387 Verify usage of equals method in LIRKind.
Roland Schatz <roland.schatz@oracle.com>
parents: 16116
diff changeset
151 assert kind.equals(expectedValue.getLIRKind());
16116
9e5a323e0a1e Remove hotspot specific NarrowOop kind, use LIRKind.reference(Kind.Int) instead.
Roland Schatz <roland.schatz@oracle.com>
parents: 16104
diff changeset
152 Kind memKind = (Kind) kind.getPlatformKind();
15024
2ee777221036 Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents: 15018
diff changeset
153
2ee777221036 Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents: 15018
diff changeset
154 HSAILAddressValue addressValue = asAddressValue(address);
2ee777221036 Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents: 15018
diff changeset
155 Variable expected = emitMove(expectedValue);
2ee777221036 Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents: 15018
diff changeset
156 Variable casResult = newVariable(kind);
2ee777221036 Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents: 15018
diff changeset
157 append(new CompareAndSwapOp(memKind, casResult, addressValue, expected, asAllocatable(newValue)));
2ee777221036 Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents: 15018
diff changeset
158
16104
4dd2cedc7f57 Revert using LIRKind.reference(Kind.Int) instead of hotspot specific NarrowOop kind (part of c0b8d395368b).
Roland Schatz <roland.schatz@oracle.com>
parents: 16094
diff changeset
159 assert trueValue.getLIRKind().equals(falseValue.getLIRKind());
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
160 Variable nodeResult = newVariable(trueValue.getLIRKind());
15024
2ee777221036 Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents: 15018
diff changeset
161 append(new CondMoveOp(HSAILLIRGenerator.mapKindToCompareOp(memKind), casResult, expected, nodeResult, Condition.EQ, trueValue, falseValue));
2ee777221036 Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents: 15018
diff changeset
162 return nodeResult;
2ee777221036 Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents: 15018
diff changeset
163 }
2ee777221036 Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents: 15018
diff changeset
164
15344
8065d79ccd49 HSAIL: fixed AtomicReadAndWrite support
Doug Simon <doug.simon@oracle.com>
parents: 15302
diff changeset
165 @Override
15251
de1d50c121cd Unsafe.getAndAdd/Set method substitutions
twisti
parents: 15200
diff changeset
166 public Value emitAtomicReadAndAdd(Value address, Value delta) {
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
167 LIRKind kind = delta.getLIRKind();
16116
9e5a323e0a1e Remove hotspot specific NarrowOop kind, use LIRKind.reference(Kind.Int) instead.
Roland Schatz <roland.schatz@oracle.com>
parents: 16104
diff changeset
168 Kind memKind = (Kind) kind.getPlatformKind();
15251
de1d50c121cd Unsafe.getAndAdd/Set method substitutions
twisti
parents: 15200
diff changeset
169 Variable result = newVariable(kind);
de1d50c121cd Unsafe.getAndAdd/Set method substitutions
twisti
parents: 15200
diff changeset
170 HSAILAddressValue addressValue = asAddressValue(address);
de1d50c121cd Unsafe.getAndAdd/Set method substitutions
twisti
parents: 15200
diff changeset
171 append(new HSAILMove.AtomicReadAndAddOp(memKind, result, addressValue, asAllocatable(delta)));
de1d50c121cd Unsafe.getAndAdd/Set method substitutions
twisti
parents: 15200
diff changeset
172 return result;
de1d50c121cd Unsafe.getAndAdd/Set method substitutions
twisti
parents: 15200
diff changeset
173 }
de1d50c121cd Unsafe.getAndAdd/Set method substitutions
twisti
parents: 15200
diff changeset
174
14768
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 14723
diff changeset
175 @Override
15344
8065d79ccd49 HSAIL: fixed AtomicReadAndWrite support
Doug Simon <doug.simon@oracle.com>
parents: 15302
diff changeset
176 public Value emitAtomicReadAndWrite(Value address, Value newValue) {
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
177 LIRKind kind = newValue.getLIRKind();
16116
9e5a323e0a1e Remove hotspot specific NarrowOop kind, use LIRKind.reference(Kind.Int) instead.
Roland Schatz <roland.schatz@oracle.com>
parents: 16104
diff changeset
178 Kind memKind = (Kind) kind.getPlatformKind();
15344
8065d79ccd49 HSAIL: fixed AtomicReadAndWrite support
Doug Simon <doug.simon@oracle.com>
parents: 15302
diff changeset
179 Variable result = newVariable(kind);
8065d79ccd49 HSAIL: fixed AtomicReadAndWrite support
Doug Simon <doug.simon@oracle.com>
parents: 15302
diff changeset
180 HSAILAddressValue addressValue = asAddressValue(address);
8065d79ccd49 HSAIL: fixed AtomicReadAndWrite support
Doug Simon <doug.simon@oracle.com>
parents: 15302
diff changeset
181 append(new HSAILMove.AtomicReadAndWriteOp(memKind, result, addressValue, asAllocatable(newValue)));
8065d79ccd49 HSAIL: fixed AtomicReadAndWrite support
Doug Simon <doug.simon@oracle.com>
parents: 15302
diff changeset
182 return result;
8065d79ccd49 HSAIL: fixed AtomicReadAndWrite support
Doug Simon <doug.simon@oracle.com>
parents: 15302
diff changeset
183 }
8065d79ccd49 HSAIL: fixed AtomicReadAndWrite support
Doug Simon <doug.simon@oracle.com>
parents: 15302
diff changeset
184
8065d79ccd49 HSAIL: fixed AtomicReadAndWrite support
Doug Simon <doug.simon@oracle.com>
parents: 15302
diff changeset
185 @Override
15301
468b2428c403 Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents: 15292
diff changeset
186 public void emitDeoptimize(Value actionAndReason, Value failedSpeculation, LIRFrameState state) {
468b2428c403 Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents: 15292
diff changeset
187 emitDeoptimizeInner(actionAndReason, state, "emitDeoptimize");
14768
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 14723
diff changeset
188 }
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 14723
diff changeset
189
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 14723
diff changeset
190 /***
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 14723
diff changeset
191 * We need 64-bit and 32-bit scratch registers for the codegen $s0 can be live at this block.
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 14723
diff changeset
192 */
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 14723
diff changeset
193 private void emitDeoptimizeInner(Value actionAndReason, LIRFrameState lirFrameState, String emitName) {
15846
399aa56c6366 HSAIL: fix for -UseHSAILDeoptimization
twisti
parents: 15554
diff changeset
194 DeoptimizeOp deopt = new DeoptimizeOp(actionAndReason, lirFrameState, emitName, config.useHSAILDeoptimization, getMetaAccess());
14921
88dfaf6448e0 Remove LIRGenerationResult from NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 14853
diff changeset
195 ((HSAILHotSpotLIRGenerationResult) getResult()).addDeopt(deopt);
14768
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 14723
diff changeset
196 append(deopt);
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 14723
diff changeset
197 }
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 14723
diff changeset
198
12664
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
199 /***
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
200 * This is a very temporary solution to emitForeignCall. We don't really support foreign calls
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
201 * yet, but we do want to generate dummy code for them. The ForeignCallXXXOps just end up
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
202 * emitting a comment as to what Foreign call they would have made.
14768
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 14723
diff changeset
203 */
12664
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
204 @Override
15301
468b2428c403 Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents: 15292
diff changeset
205 public Variable emitForeignCall(ForeignCallLinkage linkage, LIRFrameState state, Value... args) {
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
206 Variable result = newVariable(LIRKind.reference(Kind.Object)); // linkage.getDescriptor().getResultType());
12664
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
207
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
208 // to make the LIRVerifier happy, we move any constants into registers
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
209 Value[] argLocations = new Value[args.length];
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
210 for (int i = 0; i < args.length; i++) {
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
211 Value arg = args[i];
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
212 AllocatableValue loc = newVariable(arg.getLIRKind());
12664
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
213 emitMove(loc, arg);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
214 argLocations[i] = loc;
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
215 }
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
216
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
217 // here we could check the callName if we wanted to only handle certain callnames
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
218 String callName = linkage.getDescriptor().getName();
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
219 switch (argLocations.length) {
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
220 case 0:
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
221 append(new ForeignCallNoArgOp(callName, result));
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
222 break;
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
223 case 1:
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
224 append(new ForeignCall1ArgOp(callName, result, argLocations[0]));
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
225 break;
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
226 case 2:
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
227 append(new ForeignCall2ArgOp(callName, result, argLocations[0], argLocations[1]));
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
228 break;
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
229 default:
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
230 throw new InternalError("NYI emitForeignCall " + callName + ", " + argLocations.length + ", " + linkage);
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
231 }
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
232 return result;
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
233 }
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
234
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
235 @Override
14945
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
236 protected HSAILLIRInstruction createMove(AllocatableValue dst, Value src) {
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
237 if (HotSpotCompressedNullConstant.COMPRESSED_NULL.equals(src)) {
18187
9619ba4daf4c Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents: 18176
diff changeset
238 return new MoveToRegOp(Kind.Int, dst, JavaConstant.INT_0);
18289
7acff34abbf7 replaced HotSpotObjectConstantImpl.isCompressed() with HotSpotObjectConstant.isCompressed()
Doug Simon <doug.simon@oracle.com>
parents: 18266
diff changeset
239 } else if (src instanceof HotSpotObjectConstant && ((HotSpotObjectConstant) src).isCompressed()) {
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
240 Variable uncompressed = newVariable(LIRKind.reference(Kind.Object));
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
241 append(new MoveToRegOp(Kind.Object, uncompressed, src));
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
242 CompressEncoding oopEncoding = config.getOopEncoding();
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
243 return new HSAILMove.CompressPointer(dst, newVariable(LIRKind.reference(Kind.Object)), uncompressed, oopEncoding.base, oopEncoding.shift, oopEncoding.alignment, true);
14945
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
244 } else {
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
245 return super.createMove(dst, src);
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
246 }
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
247 }
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
248
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
249 @Override
12664
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
250 protected void emitForeignCall(ForeignCallLinkage linkage, Value result, Value[] arguments, Value[] temps, LIRFrameState info) {
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
251 // this version of emitForeignCall not used for now
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
252 }
1fdecc36c8ac HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
253
14945
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
254 public void emitTailcall(Value[] args, Value address) {
15104
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15066
diff changeset
255 throw GraalInternalError.unimplemented();
14945
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
256 }
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
257
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
258 public void emitDeoptimizeCaller(DeoptimizationAction action, DeoptimizationReason reason) {
15104
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15066
diff changeset
259 throw GraalInternalError.unimplemented();
14945
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
260 }
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
261
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
262 public StackSlot getLockSlot(int lockDepth) {
15104
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15066
diff changeset
263 throw GraalInternalError.unimplemented();
14945
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
264 }
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
265
15058
895e9ecedfe8 Fix code generation for compressed metaspace pointers.
Roland Schatz <roland.schatz@oracle.com>
parents: 15024
diff changeset
266 @Override
895e9ecedfe8 Fix code generation for compressed metaspace pointers.
Roland Schatz <roland.schatz@oracle.com>
parents: 15024
diff changeset
267 public Value emitCompress(Value pointer, CompressEncoding encoding, boolean nonNull) {
16116
9e5a323e0a1e Remove hotspot specific NarrowOop kind, use LIRKind.reference(Kind.Int) instead.
Roland Schatz <roland.schatz@oracle.com>
parents: 16104
diff changeset
268 Variable result = newVariable(LIRKind.reference(Kind.Int));
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
269 append(new HSAILMove.CompressPointer(result, newVariable(pointer.getLIRKind()), asAllocatable(pointer), encoding.base, encoding.shift, encoding.alignment, nonNull));
14945
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
270 return result;
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
271 }
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
272
15058
895e9ecedfe8 Fix code generation for compressed metaspace pointers.
Roland Schatz <roland.schatz@oracle.com>
parents: 15024
diff changeset
273 @Override
895e9ecedfe8 Fix code generation for compressed metaspace pointers.
Roland Schatz <roland.schatz@oracle.com>
parents: 15024
diff changeset
274 public Value emitUncompress(Value pointer, CompressEncoding encoding, boolean nonNull) {
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
275 Variable result = newVariable(LIRKind.reference(Kind.Object));
15058
895e9ecedfe8 Fix code generation for compressed metaspace pointers.
Roland Schatz <roland.schatz@oracle.com>
parents: 15024
diff changeset
276 append(new HSAILMove.UncompressPointer(result, asAllocatable(pointer), encoding.base, encoding.shift, encoding.alignment, nonNull));
14945
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
277 return result;
b14cb2d9253d Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 14921
diff changeset
278 }
15104
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15066
diff changeset
279
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15066
diff changeset
280 public SaveRegistersOp emitSaveAllRegisters() {
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15066
diff changeset
281 throw GraalInternalError.unimplemented();
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15066
diff changeset
282 }
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15066
diff changeset
283
15554
cf994cc23b54 Move emitNullCheck from NodeLIRBuilderTool to LIRGeneratorTool.
Josef Eisl <josef.eisl@jku.at>
parents: 15456
diff changeset
284 public void emitNullCheck(Value address, LIRFrameState state) {
cf994cc23b54 Move emitNullCheck from NodeLIRBuilderTool to LIRGeneratorTool.
Josef Eisl <josef.eisl@jku.at>
parents: 15456
diff changeset
285 assert address.getKind() == Kind.Object : address + " - " + address.getKind() + " not an object!";
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
286 Variable obj = newVariable(LIRKind.reference(Kind.Object));
15554
cf994cc23b54 Move emitNullCheck from NodeLIRBuilderTool to LIRGeneratorTool.
Josef Eisl <josef.eisl@jku.at>
parents: 15456
diff changeset
287 emitMove(obj, address);
cf994cc23b54 Move emitNullCheck from NodeLIRBuilderTool to LIRGeneratorTool.
Josef Eisl <josef.eisl@jku.at>
parents: 15456
diff changeset
288 append(new HSAILMove.NullCheckOp(obj, state));
cf994cc23b54 Move emitNullCheck from NodeLIRBuilderTool to LIRGeneratorTool.
Josef Eisl <josef.eisl@jku.at>
parents: 15456
diff changeset
289 }
16076
06eedda53e14 HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents: 15947
diff changeset
290
06eedda53e14 HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents: 15947
diff changeset
291 public Variable emitWorkItemAbsId() {
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16076
diff changeset
292 Variable result = newVariable(LIRKind.value(Kind.Int));
16076
06eedda53e14 HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents: 15947
diff changeset
293 append(new WorkItemAbsIdOp(result));
06eedda53e14 HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents: 15947
diff changeset
294 return result;
06eedda53e14 HSAIL: add support to allocate new TLAB from GPU
Doug Simon <doug.simon@oracle.com>
parents: 15947
diff changeset
295 }
10662
4ef92b67aeae added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
296 }