Mercurial > hg > truffle
annotate graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java @ 12698:d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Contributed-by: Tom Deneau <tom.deneau@amd.com>
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 06 Nov 2013 18:49:59 +0100 |
parents | 1fdecc36c8ac |
children | 40924dbc623b |
rev | line source |
---|---|
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
1 /* |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
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 |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
26 import com.oracle.graal.api.code.*; |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
27 import com.oracle.graal.api.meta.*; |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
28 import com.oracle.graal.compiler.hsail.*; |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
29 import com.oracle.graal.hotspot.*; |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
30 import com.oracle.graal.lir.*; |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
31 import com.oracle.graal.lir.hsail.*; |
12664
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
32 import com.oracle.graal.lir.hsail.HSAILControlFlow.*; |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
33 import com.oracle.graal.lir.hsail.HSAILMove.*; |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
34 import com.oracle.graal.nodes.*; |
12363
78e5badf4b8e
moved lookupForeignCall() from CodeCacheProvider to ForeignCallsProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
11959
diff
changeset
|
35 import com.oracle.graal.phases.util.*; |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
36 |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
37 /** |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
38 * 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
|
39 */ |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
40 public class HSAILHotSpotLIRGenerator extends HSAILLIRGenerator { |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
41 |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
42 private final HotSpotVMConfig config; |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
43 |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
44 public HSAILHotSpotLIRGenerator(StructuredGraph graph, Providers providers, HotSpotVMConfig config, FrameMap frameMap, CallingConvention cc, LIR lir) { |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
45 super(graph, providers, frameMap, cc, lir); |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
46 this.config = config; |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
47 } |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
48 |
12698
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
49 private int getLogMinObjectAlignment() { |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
50 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
|
51 } |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
52 |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
53 private int getNarrowOopShift() { |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
54 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
|
55 } |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
56 |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
57 private long getNarrowOopBase() { |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
58 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
|
59 } |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
60 |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
61 private int getLogKlassAlignment() { |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
62 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
|
63 } |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
64 |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
65 private int getNarrowKlassShift() { |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
66 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
|
67 } |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
68 |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
69 private long getNarrowKlassBase() { |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
70 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
|
71 } |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
72 |
10769 | 73 private static boolean isCompressCandidate(DeoptimizingNode access) { |
10831
000ee2d0c518
Method renaming
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
10821
diff
changeset
|
74 return access != null && ((HeapAccess) access).isCompressible(); |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
75 } |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
76 |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
77 @Override |
10769 | 78 public Variable emitLoad(Kind kind, Value address, DeoptimizingNode access) { |
79 HSAILAddressValue loadAddress = asAddressValue(address); | |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
80 Variable result = newVariable(kind); |
10769 | 81 LIRFrameState state = access != null ? state(access) : null; |
82 assert access == null || access instanceof HeapAccess; | |
12698
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
83 if (isCompressCandidate(access) && config.useCompressedOops && kind == Kind.Object) { |
10769 | 84 Variable scratch = newVariable(Kind.Long); |
12698
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
85 append(new LoadCompressedPointer(kind, result, scratch, loadAddress, state, getNarrowOopBase(), getNarrowOopShift(), getLogMinObjectAlignment())); |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
86 } else if (isCompressCandidate(access) && config.useCompressedClassPointers && kind == Kind.Long) { |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
87 Variable scratch = newVariable(Kind.Long); |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
88 append(new LoadCompressedPointer(kind, result, scratch, loadAddress, state, getNarrowKlassBase(), getNarrowKlassShift(), getLogKlassAlignment())); |
10769 | 89 } else { |
90 append(new LoadOp(kind, result, loadAddress, state)); | |
91 } | |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
92 return result; |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
93 } |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
94 |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
95 @Override |
10769 | 96 public void emitStore(Kind kind, Value address, Value inputVal, DeoptimizingNode access) { |
97 HSAILAddressValue storeAddress = asAddressValue(address); | |
98 LIRFrameState state = access != null ? state(access) : null; | |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
99 Variable input = load(inputVal); |
12698
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
100 if (isCompressCandidate(access) && config.useCompressedOops && kind == Kind.Object) { |
10769 | 101 Variable scratch = newVariable(Kind.Long); |
12698
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
102 append(new StoreCompressedPointer(kind, storeAddress, input, scratch, state, getNarrowOopBase(), getNarrowOopShift(), getLogMinObjectAlignment())); |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
103 } else if (isCompressCandidate(access) && config.useCompressedClassPointers && kind == Kind.Long) { |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
104 Variable scratch = newVariable(Kind.Long); |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
105 append(new StoreCompressedPointer(kind, storeAddress, input, scratch, state, getNarrowKlassBase(), getNarrowKlassShift(), getLogKlassAlignment())); |
10769 | 106 } else { |
107 append(new StoreOp(kind, storeAddress, input, state)); | |
108 } | |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
109 } |
12664
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
110 |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
111 /*** |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
112 * 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
|
113 * 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
|
114 * emitting a comment as to what Foreign call they would have made. |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
115 **/ |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
116 @Override |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
117 public Variable emitForeignCall(ForeignCallLinkage linkage, DeoptimizingNode info, Value... args) { |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
118 Variable result = newVariable(Kind.Object); // linkage.getDescriptor().getResultType()); |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
119 |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
120 // 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
|
121 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
|
122 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
|
123 Value arg = args[i]; |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
124 AllocatableValue loc = newVariable(arg.getKind()); |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
125 emitMove(loc, arg); |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
126 argLocations[i] = loc; |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
127 } |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
128 |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
129 // 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
|
130 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
|
131 switch (argLocations.length) { |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
132 case 0: |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
133 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
|
134 break; |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
135 case 1: |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
136 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
|
137 break; |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
138 case 2: |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
139 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
|
140 break; |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
141 default: |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
142 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
|
143 } |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
144 return result; |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
145 } |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
146 |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
147 @Override |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
148 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
|
149 // 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
|
150 } |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
151 |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
152 } |